multipass 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/lib/multipass.rb +8 -6
- data/multipass.gemspec +1 -1
- metadata +1 -1
data/VERSION.yml
CHANGED
data/lib/multipass.rb
CHANGED
@@ -102,12 +102,14 @@ class MultiPass
|
|
102
102
|
# converts unicode (\u003c) to the actual character
|
103
103
|
# http://rishida.net/tools/conversion/
|
104
104
|
def unencode_javascript_unicode_escape(str)
|
105
|
-
str.gsub!
|
106
|
-
|
107
|
-
|
108
|
-
s
|
109
|
-
|
110
|
-
|
105
|
+
if str.respond_to?(:gsub!)
|
106
|
+
str.gsub!(/\\u([0-9a-fA-F]{4})/) do |s|
|
107
|
+
int = $1.to_i(16)
|
108
|
+
if int.zero? && s != "0000"
|
109
|
+
s
|
110
|
+
else
|
111
|
+
[int].pack("U")
|
112
|
+
end
|
111
113
|
end
|
112
114
|
end
|
113
115
|
str
|
data/multipass.gemspec
CHANGED