From: nobu@... Date: 2019-07-08T01:46:12+00:00 Subject: [ruby-core:93604] [Ruby master Bug#10928] optparse Switch#summarize code doesn't reflect its documentation 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/ Unsubscribe: