ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: t_leitner@gmx.at
To: ruby-core@ruby-lang.org
Subject: [ruby-core:68378] [Ruby trunk - Bug #10928] [Open] optparse Switch#summarize code doesn't reflect its documentation
Date: Mon, 02 Mar 2015 17:25:41 +0000	[thread overview]
Message-ID: <redmine.issue-10928.20150302172540.bc5ed44995c7a0fc@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-10928.20150302172540@ruby-lang.org

Issue #10928 has been reported by Thomas Leitner.

----------------------------------------
Bug #10928: optparse Switch#summarize code doesn't reflect its documentation
https://bugs.ruby-lang.org/issues/10928

* Author: Thomas Leitner
* Status: Open
* Priority: Low
* Assignee: 
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
The documentation for `Switch#summarize` says "+sdone+::  Already summarized short style options keyed hash." for the `sdone` argument (similar problem with `ldone`). I.e. it mentions it should be a Hash.

However, the actual method definition line shows otherwise, namely an Array.

~~~
def summarize(sdone = [], ldone = [], width = 1, max = width - 1, indent = "")
~~~

The `OptionParser#summarize` command does actually invoke it with Hashes as arguments (line 566): `visit(:summarize, {}, {}, width, max, indent, &blk)`.

So the method definition for `Switch#summarize` is probably false.



-- 
https://bugs.ruby-lang.org/

       reply	other threads:[~2015-03-02 17:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <redmine.issue-10928.20150302172540@ruby-lang.org>
2015-03-02 17:25 ` t_leitner [this message]
2015-06-16 22:17 ` [ruby-core:69620] [Ruby trunk - Bug #10928] optparse Switch#summarize code doesn't reflect its documentation antondavydov.o
2019-07-07 20:57 ` [ruby-core:93593] [Ruby master Bug#10928] " merch-redmine
2019-07-08  1:46 ` [ruby-core:93604] " nobu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=redmine.issue-10928.20150302172540.bc5ed44995c7a0fc@ruby-lang.org \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).