lib/rationalist.rb in rationalist-2.0.0 vs lib/rationalist.rb in rationalist-2.0.1

- old
+ new

@@ -1,7 +1,7 @@ module Rationalist - VERSION = '2.0.0' + VERSION = '2.0.1' def self.parse(args = ARGV, **options, &unknown_block) Argv.new(args, options, unknown_block).argv end @@ -230,11 +230,13 @@ (@aliases[key] ? !(Array(@aliases[key]).any?{ |a| @bools[a] }) : true) end def numeric?(value) value.is_a?(Numeric) || - !(value !~ /\A0x[0-9a-f]+\z/) || - !(value !~ /\A[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?\z/) + value.is_a?(String) && ( + !(value !~ /\A0x[0-9a-f]+\z/) || + !(value !~ /\A[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?\z/) + ) end def Numeric(value) case value when Numeric