[ruby-core:75372] [Ruby trunk Bug#12323] Wrong example code in OptionParser documentation

From: nagachika00@...
Date: 2016-05-05 17:30:50 UTC
List: ruby-core #75372
Issue #12323 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.1: DONTNEED, 2.2: DONTNEED, 2.3: REQUIRED to 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE

ruby_2_3 r54924 merged revision(s) 54808.

----------------------------------------
Bug #12323: Wrong example code in OptionParser documentation
https://bugs.ruby-lang.org/issues/12323#change-58500

* Author: Semyon Gaivoronskiy
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
* Backport: 2.1: DONTNEED, 2.2: DONTNEED, 2.3: DONE
----------------------------------------
There is a complete example code in OptionParser documentation (http://ruby-doc.org/stdlib-2.3.0/libdoc/optparse/rdoc/OptionParser.html). Trying to run it got next error message:
`example.rb:33:in 'parse': undefined local variable or method 'option_parser' for OptparseExample:Class (NameError)
from example.rb:138:in '<main>'`

I fixed a code of that example and attached it to this ticket. Maybe it should be moderated.

---Files--------------------------------
example.rb (4.08 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next