diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2009-11-17 21:16:03 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2009-11-17 21:16:03 -0800 |
commit | 44bfff0204555e6a9d8bd764d9ee68bb47e0bffd (patch) | |
tree | 725e07c29ec37e79eab643f3d9df254cb1bab9c3 /lib | |
parent | 83ff66422fd23f883a90a65b25644267a27e25bf (diff) | |
download | psych-44bfff0204555e6a9d8bd764d9ee68bb47e0bffd.zip |
making more tests pass!
Diffstat (limited to 'lib')
-rw-r--r-- | lib/psych/scalar_scanner.rb | 4 | ||||
-rw-r--r-- | lib/psych/visitors/to_ruby.rb | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/psych/scalar_scanner.rb b/lib/psych/scalar_scanner.rb index 2a3afa9..6a18fa1 100644 --- a/lib/psych/scalar_scanner.rb +++ b/lib/psych/scalar_scanner.rb @@ -19,9 +19,9 @@ module Psych case @string when /^(null|~)$/i [:NULL, nil] - when /^(y|yes|true|on)$/i + when /^(yes|true|on)$/i [:BOOLEAN, true] - when /^(n|no|false|off)$/i + when /^(no|false|off)$/i [:BOOLEAN, false] else [:SCALAR, @string] diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb index d4a48a1..41a5302 100644 --- a/lib/psych/visitors/to_ruby.rb +++ b/lib/psych/visitors/to_ruby.rb @@ -15,7 +15,7 @@ module Psych return result if Psych.domain_types.empty? if target.respond_to?(:tag) && target.tag - short_name = target.tag.sub(/^!/, '').split('/').last + short_name = target.tag.sub(/^!/, '').split('/', 2).last if Psych.domain_types.key? short_name url, block = Psych.domain_types[short_name] block.call "http://#{url}:#{short_name}", result |