Issue #8865 has been reported by drbrain (Eric Hodel).

----------------------------------------
Bug #8865: OptionParser acceptable bugs
https://bugs.ruby-lang.org/issues/8865

Author: drbrain (Eric Hodel)
Status: Assigned
Priority: Normal
Assignee: nobu (Nobuyoshi Nakada)
Category: lib
Target version: 
ruby -v: -
Backport: 1.9.3: REQUIRED, 2.0.0: REQUIRED


I have found a few bugs in OptionParser's accept feature:

Hexadecimal and binary numbers are not properly supported for Integer

OptionParser::DecimalInteger, OptionParser::OctalInteger and OptionParser::DecimalNumeric convert invalid input to 0 or nil instead of raising InvalidArgument.

The attached patch fixes the validation regular expression for handling binary and hexadecimal arguments and adds verification for DecimalInteger, OctalInteger and DecimalNumeric


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