nori 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/nori/version.rb +1 -1
- data/lib/nori/xml_utility_node.rb +1 -0
- data/spec/nori/nori_spec.rb +5 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -56,7 +56,7 @@ Nori lets you specify a custom formula to convert XML tags to Hash keys.
|
|
56
56
|
Let me give you an example:
|
57
57
|
|
58
58
|
``` ruby
|
59
|
-
parser = Nori.new(:convert_tags_to => lambda { |tag| tag.
|
59
|
+
parser = Nori.new(:convert_tags_to => lambda { |tag| tag.snakecase.to_sym })
|
60
60
|
|
61
61
|
xml = '<userResponse><accountStatus>active</accountStatus></userResponse>'
|
62
62
|
parser.parse(xml) # => { :user_response => { :account_status => "active" }
|
data/lib/nori/version.rb
CHANGED
data/spec/nori/nori_spec.rb
CHANGED
@@ -7,6 +7,11 @@ describe Nori do
|
|
7
7
|
|
8
8
|
let(:parser) { parser }
|
9
9
|
|
10
|
+
it "should work with unnormalized characters" do
|
11
|
+
xml = '<root>&</root>'
|
12
|
+
parse(xml).should == { 'root' => "&" }
|
13
|
+
end
|
14
|
+
|
10
15
|
it "should transform a simple tag with content" do
|
11
16
|
xml = "<tag>This is the contents</tag>"
|
12
17
|
parse(xml).should == { 'tag' => 'This is the contents' }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nori
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-02-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rake
|
@@ -109,7 +109,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
segments:
|
111
111
|
- 0
|
112
|
-
hash:
|
112
|
+
hash: 1629927021843471619
|
113
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
114
|
none: false
|
115
115
|
requirements:
|
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
118
|
version: '0'
|
119
119
|
segments:
|
120
120
|
- 0
|
121
|
-
hash:
|
121
|
+
hash: 1629927021843471619
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project: nori
|
124
124
|
rubygems_version: 1.8.24
|