nori 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nori might be problematic. Click here for more details.
- data/CHANGELOG.md +14 -0
- data/lib/nori/version.rb +1 -1
- data/lib/nori/xml_utility_node.rb +5 -1
- data/spec/nori/nori_spec.rb +2 -2
- metadata +5 -7
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== 1.0.2 (2011-07-04)
|
2
|
+
|
3
|
+
* Fix: When specifying a custom formula to convert tags, XML attributes were ignored.
|
4
|
+
Now, a formula is applied to both XML tags and attributes.
|
5
|
+
|
1
6
|
== 1.0.1 (2011-06-21)
|
2
7
|
|
3
8
|
* Fix: Make sure to always load both StringWithAttributes and StringIOFile
|
@@ -34,6 +39,15 @@
|
|
34
39
|
xml = '<userResponse><accountStatus>active</accountStatus></userResponse>'
|
35
40
|
parse(xml).should == { :user_response => { :account_status => "active" }
|
36
41
|
|
42
|
+
== 0.2.4 (2011-06-21)
|
43
|
+
|
44
|
+
* Fix: backported fixes from v1.0.1
|
45
|
+
|
46
|
+
== 0.2.3 (2011-05-26)
|
47
|
+
|
48
|
+
* Fix: Use extended core classes StringWithAttributes and StringIOFile instead of
|
49
|
+
creating singletons to prevent serialization problems.
|
50
|
+
|
37
51
|
== 0.2.2 (2011-05-16)
|
38
52
|
|
39
53
|
* Fix: namespaced xs:nil values should be nil objects.
|
data/lib/nori/version.rb
CHANGED
@@ -88,11 +88,15 @@ module Nori
|
|
88
88
|
|
89
89
|
def prefixed_attributes
|
90
90
|
attributes.inject({}) do |memo, (key, value)|
|
91
|
-
memo["@#{key}"] = value
|
91
|
+
memo[prefixed_attribute_name("@#{key}")] = value
|
92
92
|
memo
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
+
def prefixed_attribute_name(attribute)
|
97
|
+
Nori.convert_tags? ? Nori.convert_tag(attribute) : attribute
|
98
|
+
end
|
99
|
+
|
96
100
|
def add_node(node)
|
97
101
|
@text = true if node.is_a? String
|
98
102
|
@children << node
|
data/spec/nori/nori_spec.rb
CHANGED
@@ -296,8 +296,8 @@ describe Nori do
|
|
296
296
|
end
|
297
297
|
|
298
298
|
it "transforms the tags to snakecase Symbols" do
|
299
|
-
xml = '<userResponse><accountStatus>active</accountStatus></userResponse>'
|
300
|
-
parse(xml).should == { :user_response => { :account_status => "active" } }
|
299
|
+
xml = '<userResponse id="1"><accountStatus>active</accountStatus></userResponse>'
|
300
|
+
parse(xml).should == { :user_response => { :@id => "1", :account_status => "active" } }
|
301
301
|
end
|
302
302
|
end
|
303
303
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nori
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel Harrington
|
@@ -17,8 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-
|
21
|
-
default_executable:
|
20
|
+
date: 2011-07-04 00:00:00 Z
|
22
21
|
dependencies:
|
23
22
|
- !ruby/object:Gem::Dependency
|
24
23
|
name: nokogiri
|
@@ -104,7 +103,6 @@ files:
|
|
104
103
|
- spec/nori/nori_spec.rb
|
105
104
|
- spec/nori/parser_spec.rb
|
106
105
|
- spec/spec_helper.rb
|
107
|
-
has_rdoc: true
|
108
106
|
homepage: http://github.com/rubiii/nori
|
109
107
|
licenses: []
|
110
108
|
|
@@ -134,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
132
|
requirements: []
|
135
133
|
|
136
134
|
rubyforge_project: nori
|
137
|
-
rubygems_version: 1.
|
135
|
+
rubygems_version: 1.8.5
|
138
136
|
signing_key:
|
139
137
|
specification_version: 3
|
140
138
|
summary: XML to Hash translator
|