summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2009-09-29 21:20:25 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2009-09-29 21:20:25 -0700
commit1fb4171aae09eeed11f00dcc3b2ddd8a609394be (patch)
treeadf50ce59376a117f54a4b0be18513534e4168bd
parent00c5b7eb6da8fcfbbb94e0e33c8279eb715dbbbf (diff)
downloadpsych-1fb4171aae09eeed11f00dcc3b2ddd8a609394be.zip
reducing regular expression
-rw-r--r--lib/psych/visitors/to_ruby.rb3
-rw-r--r--test/visitors/test_yast_builder.rb1
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/psych/visitors/to_ruby.rb b/lib/psych/visitors/to_ruby.rb
index 9b5a253..10e03fe 100644
--- a/lib/psych/visitors/to_ruby.rb
+++ b/lib/psych/visitors/to_ruby.rb
@@ -14,8 +14,7 @@ module Psych
return nil if o.tag == 'tag:yaml.org,2002:null'
unless o.quoted
- return nil if o.value =~ /^null$/i
- return nil if o.value == '~'
+ return nil if o.value =~ /^(null|~)$/i
end
o.value
diff --git a/test/visitors/test_yast_builder.rb b/test/visitors/test_yast_builder.rb
index 30374c1..aa6f332 100644
--- a/test/visitors/test_yast_builder.rb
+++ b/test/visitors/test_yast_builder.rb
@@ -47,6 +47,7 @@ module Psych
assert_equal nil, Psych.load('~')
assert_round_trip 'null'
+ assert_round_trip 'nUll'
assert_round_trip '~'
end