From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 53F1119411B1 for ; Wed, 17 Jun 2015 06:55:25 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 4A0C9B5D9C0 for ; Wed, 17 Jun 2015 07:17:50 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 0516C97A846 for ; Wed, 17 Jun 2015 07:17:51 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=sendgrid.me Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Sa8ubnsl2j9y for ; Wed, 17 Jun 2015 07:17:50 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 94B9197A845 for ; Wed, 17 Jun 2015 07:17:50 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id B98BA952447 for ; Wed, 17 Jun 2015 07:17:49 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 5F797120462; Wed, 17 Jun 2015 07:17:47 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id 8666E120458 for ; Wed, 17 Jun 2015 07:17:42 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=VkFBLPhTftH34k0LCHcZIBG1hdg=; b=x66Lkm4bNXkTbfXTpF dVMyumDMPnRNHurDTe8uRzlSf7uOpEn5dDJh+nzIUM1uUaHLynUo222DfzdP6zop oe3vId5+26rYwZ/ec3XFxobngeuFScYjCDOWYQ9lAOupHymGu6i0iGsWCFLSWreb YeLXFSPxBykTAc8rix9/6IFkc= Received: by filter0448p1mdw1.sendgrid.net with SMTP id filter0448p1mdw1.28862.5580A0801D 2015-06-16 22:17:36.979379167 +0000 UTC Received: from herokuapp.com (ec2-54-145-73-29.compute-1.amazonaws.com [54.145.73.29]) by ismtpd-009 (SG) with ESMTP id 14dfe72f7a8.481f.8c240 for ; Tue, 16 Jun 2015 22:17:36 +0000 (UTC) Date: Tue, 16 Jun 2015 22:17:36 +0000 From: antondavydov.o@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 44150 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 10928 X-Redmine-Issue-Author: gettalong X-Redmine-Sender: davydov_anton 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS5lhM3h2jsKoT7Ebx12V78wtAqEA8aWyt5u/m 5agIRM4AEaQtXwJQ+jBUdIU2E+IQzfNQDpzO7gt6mkmulwsw/2nfzWMDmOvXQYQAdrC5pFeNpQssLE TM+i/x0aO83kJc0GhA9nBHvQXQoOZpqpa1Te X-ML-Name: ruby-core X-Mail-Count: 69620 Subject: [ruby-core:69620] [Ruby trunk - 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: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #10928 has been updated by Anton Davydov. Hello, > However, the actual method definition line shows otherwise, namely an Array. In documentations says that `sdone` and `ldone` options take keyed hash. It's mean that this options take array with hash keys. > The `OptionParser#summarize` command does actually invoke it with Hashes as arguments (line 566): `visit(:summarize, {}, {}, width, max, indent, &blk)`. It's different methods. In first case it's `Switch#summarize` and in second case it's `OptionParser#summarize`. ---------------------------------------- Bug #10928: optparse Switch#summarize code doesn't reflect its documentation https://bugs.ruby-lang.org/issues/10928#change-52963 * 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/