Search
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (332 Bytes)
Bug #13722
ยป ruby-op-octal-bug.rb
Reproduces the bug -
wmccumstie (William McCumstie)
, 07/06/2017 09:58 AM
#!/usr/local/bin/ruby
require
'optionparser'
input
=
[
"--decimal"
,
"035"
]
results
=
{}
op
=
OptionParser
.
new
op
.
on
(
"--decimal NUMBER"
,
OptionParser
::
DecimalInteger
,
"DecimalInteger bug will convert as octal"
)
do
|
v
|
results
[
:decimal
]
=
v
end
op
.
parse
(
input
)
puts
"Input:
#{
input
[
1
]
}
"
puts
"Parsed:
#{
results
[
:decimal
]
}
"
(1-1/1)
Loading...