kakutani-yaml_waml 0.1.2 → 0.2.0
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/lib/yaml_waml.rb +9 -1
- metadata +2 -2
data/lib/yaml_waml.rb
CHANGED
|
@@ -12,9 +12,17 @@ ObjectSpace.each_object(Class) do |klass|
|
|
|
12
12
|
def to_yaml_with_decode(*args)
|
|
13
13
|
result = to_yaml_without_decode(*args)
|
|
14
14
|
if result.kind_of? String
|
|
15
|
-
# decode
|
|
15
|
+
# decode to workaround
|
|
16
16
|
result.gsub(/\\x(\w{2})/){
|
|
17
17
|
[Regexp.last_match.captures.first.to_i(16)].pack("C")}
|
|
18
|
+
elsif result.kind_of? StringIO
|
|
19
|
+
str = result.string
|
|
20
|
+
# decode to workaround
|
|
21
|
+
str.gsub!(/\\x(\w{2})/){
|
|
22
|
+
[Regexp.last_match.captures.first.to_i(16)].pack("C")}
|
|
23
|
+
result.rewind
|
|
24
|
+
result.write str
|
|
25
|
+
result
|
|
18
26
|
else
|
|
19
27
|
result
|
|
20
28
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kakutani-yaml_waml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- KAKUTANI Shintaro
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-09-02
|
|
12
|
+
date: 2008-09-02 18:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|