From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id D13B81F461 for ; Mon, 8 Jul 2019 01:46:18 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 0F95B120954; Mon, 8 Jul 2019 10:46:12 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 80944120954 for ; Mon, 8 Jul 2019 10:46:10 +0900 (JST) Received: by filter0034p3iad2.sendgrid.net with SMTP id filter0034p3iad2-12667-5D22A063-1C 2019-07-08 01:46:11.967445738 +0000 UTC m=+369280.339524752 Received: from herokuapp.com (unknown [35.175.150.18]) by ismtpd0045p1mdw1.sendgrid.net (SG) with ESMTP id o7kVA8FkTGaIXtnl7ijXzA for ; Mon, 08 Jul 2019 01:46:11.870 +0000 (UTC) Date: Mon, 08 Jul 2019 01:46:12 +0000 (UTC) From: nobu@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 69098 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 10928 X-Redmine-Issue-Author: gettalong X-Redmine-Issue-Assignee: nobu X-Redmine-Sender: nobu X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?q8Dly+pU2+3ektTtZVXgZtbJPXwqo7p86jCsvYTW4Bx1p=2FNYDII7ZP3rIZeu67?= =?us-ascii?Q?doIR=2FpSCCNfF=2FMOmTvVOQmYQgP0vuWD56MghzoS?= =?us-ascii?Q?z2fWtzhat7hHzjyqROyA80HLbx4Q4DoseoDZX8T?= =?us-ascii?Q?CtNTtav88DBUML3wGRwpysm2zNWailRzQBfJT1c?= =?us-ascii?Q?zSrh9eDXyTVnEvd5XWQR3toqlXg=2FQ9aoNGA=3D=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 93604 Subject: [ruby-core:93604] [Ruby master Bug#10928] optparse Switch#summarize code doesn't reflect its documentation X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" 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/