summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-11-07 08:42:50 -0300
committerAaron Patterson <aaron.patterson@gmail.com>2011-11-07 08:42:50 -0300
commit8dd7448b183456a1dff5ce30dc3e3d49c78bd813 (patch)
tree4c3871a5a8b1b4584a41d11b969982185c49e5ca /lib
parent7f812e945b73e3c696b1baeebbc1516e94f8d16a (diff)
downloadpsych-8dd7448b183456a1dff5ce30dc3e3d49c78bd813.zip
* ext/psych/lib/psych/scalar_scanner.rb: make sure strings that look
like base 60 numbers are serialized as quoted strings. * test/psych/test_string.rb: test for change. Fixes #25
Diffstat (limited to 'lib')
-rw-r--r--lib/psych/scalar_scanner.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/psych/scalar_scanner.rb b/lib/psych/scalar_scanner.rb
index e390cbb..a265a2b 100644
--- a/lib/psych/scalar_scanner.rb
+++ b/lib/psych/scalar_scanner.rb
@@ -61,7 +61,7 @@ module Psych
else
string.sub(/^:/, '').to_sym
end
- when /^[-+]?[1-9][0-9_]*(:[0-5]?[0-9])+$/
+ when /^[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+$/
i = 0
string.split(':').each_with_index do |n,e|
i += (n.to_i * 60 ** (e - 2).abs)