You can clone with
HTTPS or Subversion.
Psych.dump will refuse to serialize a string value which has the form of an ISO8601 timestamp but which does not represent a valid time. E.g.:
1.9.3p194 :006 > Psych.dump('9333-93-93T93:93:93')
ArgumentError: argument out of range
from /Users/rsutphin/.rvm/gems/ruby-1.9.3-p194@tmp/gems/psych-1.3.4/lib/psych/scalar_scanner.rb:111:in `utc'
from /Users/rsutphin/.rvm/gems/ruby-1.9.3-p194@tmp/gems/psych-1.3.4/lib/psych/scalar_scanner.rb:111:in `parse_time'
from /Users/rsutphin/.rvm/gems/ruby-1.9.3-p194@tmp/gems/psych-1.3.4/lib/psych/scalar_scanner.rb:48:in `tokenize'
from /Users/rsutphin/.rvm/gems/ruby-1.9.3-p194@tmp/gems/psych-1.3.4/lib/psych/visitors/yaml_tree.rb:242:in `visit_String'
from /Users/rsutphin/.rvm/gems/ruby-1.9.3-p194@tmp/gems/psych-1.3.4/lib/psych/visitors/yaml_tree.rb:103:in `accept'
from /Users/rsutphin/.rvm/gems/ruby-1.9.3-p194@tmp/gems/psych-1.3.4/lib/psych/visitors/yaml_tree.rb:67:in `push'
from /Users/rsutphin/.rvm/gems/ruby-1.9.3-p194@tmp/gems/psych-1.3.4/lib/psych.rb:242:in `dump'
from /Users/rsutphin/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'
This happens with both Psych 1.3.2 and 1.3.4 (the latest released version as of this writing).
While I agree that values like the one in the example are weird, it doesn't seem like a serialization library ought to express an opinion. Would it be reasonable to fall back to treating the value as a string if it isn't a valid time? I could provide a pull request for this if so.
Ignore bad timestamps. #82.
If something looks like a timestamp but has an invalid component,
treat it as a string instead of throwing an ArgumentError.
Yes, this is a bug. Please send a PR and I'll merge! Thanks.
Handled by #83.