roxml 3.2.0 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +12 -0
- data/Gemfile.lock +50 -0
- data/Rakefile +0 -10
- data/VERSION +1 -1
- data/lib/roxml.rb +2 -2
- data/lib/roxml/xml/references.rb +8 -15
- data/roxml.gemspec +11 -2
- data/spec/regression_spec.rb +19 -0
- metadata +37 -12
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
activemodel (3.1.3)
|
5
|
+
activesupport (= 3.1.3)
|
6
|
+
builder (~> 3.0.0)
|
7
|
+
i18n (~> 0.6)
|
8
|
+
activerecord (3.1.3)
|
9
|
+
activemodel (= 3.1.3)
|
10
|
+
activesupport (= 3.1.3)
|
11
|
+
arel (~> 2.2.1)
|
12
|
+
tzinfo (~> 0.3.29)
|
13
|
+
activesupport (3.1.3)
|
14
|
+
multi_json (~> 1.0)
|
15
|
+
arel (2.2.1)
|
16
|
+
builder (3.0.0)
|
17
|
+
diff-lcs (1.1.3)
|
18
|
+
git (1.2.5)
|
19
|
+
i18n (0.6.0)
|
20
|
+
jeweler (1.6.4)
|
21
|
+
bundler (~> 1.0)
|
22
|
+
git (>= 1.2.5)
|
23
|
+
rake
|
24
|
+
multi_json (1.0.4)
|
25
|
+
nokogiri (1.5.0)
|
26
|
+
rake (0.9.2.2)
|
27
|
+
rspec (2.8.0)
|
28
|
+
rspec-core (~> 2.8.0)
|
29
|
+
rspec-expectations (~> 2.8.0)
|
30
|
+
rspec-mocks (~> 2.8.0)
|
31
|
+
rspec-core (2.8.0)
|
32
|
+
rspec-expectations (2.8.0)
|
33
|
+
diff-lcs (~> 1.1.2)
|
34
|
+
rspec-mocks (2.8.0)
|
35
|
+
sqlite3 (1.3.5)
|
36
|
+
sqlite3-ruby (1.3.3)
|
37
|
+
sqlite3 (>= 1.3.3)
|
38
|
+
tzinfo (0.3.31)
|
39
|
+
|
40
|
+
PLATFORMS
|
41
|
+
ruby
|
42
|
+
|
43
|
+
DEPENDENCIES
|
44
|
+
activerecord (>= 2.2.2)
|
45
|
+
activesupport (>= 2.3.0)
|
46
|
+
jeweler
|
47
|
+
nokogiri (>= 1.3.3)
|
48
|
+
rake
|
49
|
+
rspec (>= 2.0.0)
|
50
|
+
sqlite3-ruby (>= 1.2.4)
|
data/Rakefile
CHANGED
@@ -21,18 +21,8 @@ EOF
|
|
21
21
|
gem.authors = ["Ben Woosley", "Zak Mandhro", "Anders Engstrom", "Russ Olsen"]
|
22
22
|
|
23
23
|
gem.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.rdoc"]
|
24
|
-
|
25
|
-
gem.add_dependency 'activesupport', '>= 2.3.0'
|
26
|
-
gem.add_dependency 'nokogiri', '>= 1.3.3'
|
27
|
-
|
28
|
-
gem.add_development_dependency "rspec", '>= 2.0.0'
|
29
|
-
gem.add_development_dependency "sqlite3-ruby", '>= 1.2.4'
|
30
|
-
gem.add_development_dependency "activerecord", '>= 2.2.2'
|
31
24
|
end
|
32
25
|
Jeweler::GemcutterTasks.new
|
33
|
-
Jeweler::RubyforgeTasks.new do |rubyforge|
|
34
|
-
rubyforge.doc_task = "rdoc"
|
35
|
-
end
|
36
26
|
|
37
27
|
Dir['tasks/**/*.rake'].each { |t| load t }
|
38
28
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.1
|
data/lib/roxml.rb
CHANGED
@@ -171,9 +171,9 @@ module ROXML # :nodoc:
|
|
171
171
|
end
|
172
172
|
|
173
173
|
def roxml_naming_convention # :nodoc:
|
174
|
-
|
174
|
+
@roxml_naming_convention || begin
|
175
175
|
superclass.roxml_naming_convention if superclass.respond_to?(:roxml_naming_convention)
|
176
|
-
end
|
176
|
+
end
|
177
177
|
end
|
178
178
|
|
179
179
|
# Declares a reference to a certain xml element, whether an attribute, a node,
|
data/lib/roxml/xml/references.rb
CHANGED
@@ -32,11 +32,12 @@ module ROXML
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def value_in(xml)
|
35
|
-
|
36
|
-
value = fetch_value(xml)
|
35
|
+
value = fetch_value(XML::Node.from(xml))
|
37
36
|
value = default if value.nil?
|
38
37
|
|
39
|
-
|
38
|
+
value = apply_blocks(value)
|
39
|
+
value = freeze(value) if value && opts.frozen?
|
40
|
+
value
|
40
41
|
end
|
41
42
|
|
42
43
|
private
|
@@ -67,12 +68,8 @@ module ROXML
|
|
67
68
|
end
|
68
69
|
|
69
70
|
def freeze(val)
|
70
|
-
if
|
71
|
-
|
72
|
-
val.freeze
|
73
|
-
else
|
74
|
-
val
|
75
|
-
end
|
71
|
+
val.each(&:freeze) if val.is_a?(Enumerable)
|
72
|
+
val.freeze
|
76
73
|
end
|
77
74
|
|
78
75
|
def xpath
|
@@ -269,12 +266,8 @@ module ROXML
|
|
269
266
|
end
|
270
267
|
|
271
268
|
def freeze(vals)
|
272
|
-
|
273
|
-
|
274
|
-
vals.freeze
|
275
|
-
else
|
276
|
-
vals
|
277
|
-
end
|
269
|
+
vals.each_pair{|k, v| k.freeze; v.freeze }
|
270
|
+
vals.freeze
|
278
271
|
end
|
279
272
|
|
280
273
|
def to_hash(array)
|
data/roxml.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{roxml}
|
8
|
-
s.version = "3.2.
|
8
|
+
s.version = "3.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = [%q{Ben Woosley}, %q{Zak Mandhro}, %q{Anders Engstrom}, %q{Russ Olsen}]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2012-01-05}
|
13
13
|
s.description = %q{ROXML is a Ruby library designed to make it easier for Ruby developers to work with XML.
|
14
14
|
Using simple annotations, it enables Ruby classes to be mapped to XML. ROXML takes care
|
15
15
|
of the marshalling and unmarshalling of mapped attributes so that developers can focus on
|
@@ -24,6 +24,8 @@ RESTful applications, Web Services, and XML-RPC.
|
|
24
24
|
s.files = [
|
25
25
|
".gitmodules",
|
26
26
|
".rspec",
|
27
|
+
"Gemfile",
|
28
|
+
"Gemfile.lock",
|
27
29
|
"History.txt",
|
28
30
|
"LICENSE",
|
29
31
|
"README.rdoc",
|
@@ -63,6 +65,7 @@ RESTful applications, Web Services, and XML-RPC.
|
|
63
65
|
"spec/examples/post_spec.rb",
|
64
66
|
"spec/examples/twitter_spec.rb",
|
65
67
|
"spec/reference_spec.rb",
|
68
|
+
"spec/regression_spec.rb",
|
66
69
|
"spec/roxml_spec.rb",
|
67
70
|
"spec/shared_specs.rb",
|
68
71
|
"spec/spec_helper.rb",
|
@@ -139,12 +142,16 @@ RESTful applications, Web Services, and XML-RPC.
|
|
139
142
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
140
143
|
s.add_runtime_dependency(%q<activesupport>, [">= 2.3.0"])
|
141
144
|
s.add_runtime_dependency(%q<nokogiri>, [">= 1.3.3"])
|
145
|
+
s.add_development_dependency(%q<rake>, [">= 0"])
|
146
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
142
147
|
s.add_development_dependency(%q<rspec>, [">= 2.0.0"])
|
143
148
|
s.add_development_dependency(%q<sqlite3-ruby>, [">= 1.2.4"])
|
144
149
|
s.add_development_dependency(%q<activerecord>, [">= 2.2.2"])
|
145
150
|
else
|
146
151
|
s.add_dependency(%q<activesupport>, [">= 2.3.0"])
|
147
152
|
s.add_dependency(%q<nokogiri>, [">= 1.3.3"])
|
153
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
154
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
148
155
|
s.add_dependency(%q<rspec>, [">= 2.0.0"])
|
149
156
|
s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.4"])
|
150
157
|
s.add_dependency(%q<activerecord>, [">= 2.2.2"])
|
@@ -152,6 +159,8 @@ RESTful applications, Web Services, and XML-RPC.
|
|
152
159
|
else
|
153
160
|
s.add_dependency(%q<activesupport>, [">= 2.3.0"])
|
154
161
|
s.add_dependency(%q<nokogiri>, [">= 1.3.3"])
|
162
|
+
s.add_dependency(%q<rake>, [">= 0"])
|
163
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
155
164
|
s.add_dependency(%q<rspec>, [">= 2.0.0"])
|
156
165
|
s.add_dependency(%q<sqlite3-ruby>, [">= 1.2.4"])
|
157
166
|
s.add_dependency(%q<activerecord>, [">= 2.2.2"])
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe ROXML do
|
4
|
+
describe 'frozen nils' do
|
5
|
+
subject { nil }
|
6
|
+
|
7
|
+
context 'before unmarshalling an XML document' do
|
8
|
+
it { should_not be_frozen }
|
9
|
+
end
|
10
|
+
|
11
|
+
context 'after unmarshalling an XML document' do
|
12
|
+
before do
|
13
|
+
lib = Library.from_xml(fixture(:library))
|
14
|
+
end
|
15
|
+
|
16
|
+
it { should_not be_frozen }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roxml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,11 +12,11 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2012-01-05 00:00:00.000000000Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activesupport
|
19
|
-
requirement: &
|
19
|
+
requirement: &2165456080 !ruby/object:Gem::Requirement
|
20
20
|
none: false
|
21
21
|
requirements:
|
22
22
|
- - ! '>='
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
version: 2.3.0
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements: *
|
27
|
+
version_requirements: *2165456080
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: nokogiri
|
30
|
-
requirement: &
|
30
|
+
requirement: &2165455600 !ruby/object:Gem::Requirement
|
31
31
|
none: false
|
32
32
|
requirements:
|
33
33
|
- - ! '>='
|
@@ -35,10 +35,32 @@ dependencies:
|
|
35
35
|
version: 1.3.3
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
|
-
version_requirements: *
|
38
|
+
version_requirements: *2165455600
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
name: rake
|
41
|
+
requirement: &2165455120 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
type: :development
|
48
|
+
prerelease: false
|
49
|
+
version_requirements: *2165455120
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: jeweler
|
52
|
+
requirement: &2165454640 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
58
|
+
type: :development
|
59
|
+
prerelease: false
|
60
|
+
version_requirements: *2165454640
|
39
61
|
- !ruby/object:Gem::Dependency
|
40
62
|
name: rspec
|
41
|
-
requirement: &
|
63
|
+
requirement: &2165454160 !ruby/object:Gem::Requirement
|
42
64
|
none: false
|
43
65
|
requirements:
|
44
66
|
- - ! '>='
|
@@ -46,10 +68,10 @@ dependencies:
|
|
46
68
|
version: 2.0.0
|
47
69
|
type: :development
|
48
70
|
prerelease: false
|
49
|
-
version_requirements: *
|
71
|
+
version_requirements: *2165454160
|
50
72
|
- !ruby/object:Gem::Dependency
|
51
73
|
name: sqlite3-ruby
|
52
|
-
requirement: &
|
74
|
+
requirement: &2165453680 !ruby/object:Gem::Requirement
|
53
75
|
none: false
|
54
76
|
requirements:
|
55
77
|
- - ! '>='
|
@@ -57,10 +79,10 @@ dependencies:
|
|
57
79
|
version: 1.2.4
|
58
80
|
type: :development
|
59
81
|
prerelease: false
|
60
|
-
version_requirements: *
|
82
|
+
version_requirements: *2165453680
|
61
83
|
- !ruby/object:Gem::Dependency
|
62
84
|
name: activerecord
|
63
|
-
requirement: &
|
85
|
+
requirement: &2165453200 !ruby/object:Gem::Requirement
|
64
86
|
none: false
|
65
87
|
requirements:
|
66
88
|
- - ! '>='
|
@@ -68,7 +90,7 @@ dependencies:
|
|
68
90
|
version: 2.2.2
|
69
91
|
type: :development
|
70
92
|
prerelease: false
|
71
|
-
version_requirements: *
|
93
|
+
version_requirements: *2165453200
|
72
94
|
description: ! 'ROXML is a Ruby library designed to make it easier for Ruby developers
|
73
95
|
to work with XML.
|
74
96
|
|
@@ -93,6 +115,8 @@ extra_rdoc_files:
|
|
93
115
|
files:
|
94
116
|
- .gitmodules
|
95
117
|
- .rspec
|
118
|
+
- Gemfile
|
119
|
+
- Gemfile.lock
|
96
120
|
- History.txt
|
97
121
|
- LICENSE
|
98
122
|
- README.rdoc
|
@@ -132,6 +156,7 @@ files:
|
|
132
156
|
- spec/examples/post_spec.rb
|
133
157
|
- spec/examples/twitter_spec.rb
|
134
158
|
- spec/reference_spec.rb
|
159
|
+
- spec/regression_spec.rb
|
135
160
|
- spec/roxml_spec.rb
|
136
161
|
- spec/shared_specs.rb
|
137
162
|
- spec/spec_helper.rb
|