Project

General

Profile

Actions

Bug #10928

closed

optparse Switch#summarize code doesn't reflect its documentation

Added by gettalong (Thomas Leitner) about 9 years ago. Updated over 4 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
[ruby-core:68378]

Description

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) optparse-switch-summarize.patch jeremyevans0 (Jeremy Evans), 07/07/2019 08:56 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0