From: nobu@ruby-lang.org
To: ruby-core@ruby-lang.org
Subject: [ruby-core:93604] [Ruby master Bug#10928] optparse Switch#summarize code doesn't reflect its documentation
Date: Mon, 08 Jul 2019 01:46:12 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-79200.20190708014611.7dbe257665cd1dad@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-10928.20150302172540@ruby-lang.org
Issue #10928 has been updated by nobu (Nobuyoshi Nakada).
Thank you, I've missed it.
Commit it please.
----------------------------------------
Bug #10928: optparse Switch#summarize code doesn't reflect its documentation
https://bugs.ruby-lang.org/issues/10928#change-79200
* Author: gettalong (Thomas Leitner)
* Status: Assigned
* Priority: Normal
* Assignee: nobu (Nobuyoshi Nakada)
* Target version:
* 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.
---Files--------------------------------
optparse-switch-summarize.patch (1.19 KB)
--
https://bugs.ruby-lang.org/
prev parent reply other threads:[~2019-07-08 1:46 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 ` [ruby-core:68378] [Ruby trunk - Bug #10928] [Open] optparse Switch#summarize code doesn't reflect its documentation t_leitner
2015-06-16 22:17 ` [ruby-core:69620] [Ruby trunk - Bug #10928] " antondavydov.o
2019-07-07 20:57 ` [ruby-core:93593] [Ruby master Bug#10928] " merch-redmine
2019-07-08 1:46 ` nobu [this message]
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.journal-79200.20190708014611.7dbe257665cd1dad@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).