summaryrefslogtreecommitdiff
path: root/lib/yaml/encoding.rb
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-19 11:45:39 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-19 11:45:39 +0000
commit09f5560c5721ad779cc2e740c4a77ad6aca1b530 (patch)
tree5d8d6ada2d2bed32c7d8f39dc616d9c26dbfac51 /lib/yaml/encoding.rb
parent8e3bfe98614414f027eed4e33b80dab0e938d13b (diff)
Merge everything from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml/encoding.rb')
-rw-r--r--lib/yaml/encoding.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/yaml/encoding.rb b/lib/yaml/encoding.rb
index 37f5cfda64..57dc553606 100644
--- a/lib/yaml/encoding.rb
+++ b/lib/yaml/encoding.rb
@@ -10,8 +10,8 @@ module YAML
def YAML.escape( value, skip = "" )
value.gsub( /\\/, "\\\\\\" ).
gsub( /"/, "\\\"" ).
- gsub( /([\x00-\x1f])/ ) do |x|
- skip[x] || ESCAPES[ x.unpack("C")[0] ]
+ gsub( /([\x00-\x1f])/ ) do
+ skip[$&] || ESCAPES[ $&.unpack("C")[0] ]
end
end
@@ -19,7 +19,7 @@ module YAML
# Unescape the condenses escapes
#
def YAML.unescape( value )
- value.gsub( /\\(?:([nevfbart\\])|0?x([0-9a-fA-F]{2})|u([0-9a-fA-F]{4}))/ ) { |x|
+ value.gsub( /\\(?:([nevfbart\\])|0?x([0-9a-fA-F]{2})|u([0-9a-fA-F]{4}))/ ) {
if $3
["#$3".hex ].pack('U*')
elsif $2