om 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/History.textile CHANGED
@@ -1,3 +1,9 @@
1
+ h3. 3.0.3 (19 Jul 2013)
2
+ Fix overly-aggressive template inheritance bug introduced in 3.0.2
3
+
4
+ h3. 3.0.2 (15 Jul 2013)
5
+ Add terminology and template inheritance
6
+
1
7
  h3. 3.0.1 (25 Jun 2013)
2
8
  Fix bug where values that were the same as the existing values were
3
9
  removed from the update list
data/lib/om/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Om
2
- VERSION = "3.0.2"
2
+ VERSION = "3.0.3"
3
3
  end
@@ -32,8 +32,8 @@
32
32
 
33
33
  class OM::XML::TemplateRegistry
34
34
 
35
- def initialize
36
- @templates = {}
35
+ def initialize(templates={})
36
+ @templates = templates.dup
37
37
  end
38
38
 
39
39
  # Define an XML template
@@ -127,6 +127,11 @@ class OM::XML::TemplateRegistry
127
127
  attach_node(:swap, target_node, :parent, node_type, *args, &block)
128
128
  end
129
129
 
130
+ def dup
131
+ result = self.class.new(@templates)
132
+ result
133
+ end
134
+
130
135
  def methods
131
136
  super + @templates.keys.collect { |k| k.to_s }
132
137
  end
@@ -63,9 +63,18 @@ describe "Inherited terminology" do
63
63
 
64
64
  class ConcreteTerminology < AbstractTerminology
65
65
  end
66
+
67
+ class OtherConcreteTerminology < AbstractTerminology
68
+ define_template :foo do |xml, *args|
69
+ args.each { |arg|
70
+ xml.foo(arg)
71
+ }
72
+ end
73
+ end
66
74
  end
67
75
 
68
76
  after(:all) do
77
+ Object.send(:remove_const, :OtherConcreteTerminology)
69
78
  Object.send(:remove_const, :ConcreteTerminology)
70
79
  Object.send(:remove_const, :AbstractTerminology)
71
80
  end
@@ -80,6 +89,13 @@ describe "Inherited terminology" do
80
89
  subject.add_child_node subject.ng_xml.root, :creator, 'Test author', 'Primary'
81
90
  subject.ng_xml.xpath('//pbcoreCreator/creatorRole[@source="PBCore creatorRole"]').text.should == "Primary"
82
91
  end
92
+
93
+ it "should inherit but not extend its parent's templates" do
94
+ OtherConcreteTerminology.template_registry.should have_node_type(:creator)
95
+ OtherConcreteTerminology.template_registry.should have_node_type(:foo)
96
+ AbstractTerminology.template_registry.should_not have_node_type(:foo)
97
+ ConcreteTerminology.template_registry.should_not have_node_type(:foo)
98
+ end
83
99
  end
84
100
  end
85
101
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: om
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Matt Zumwalt
@@ -9,39 +10,44 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-07-15 00:00:00.000000000 Z
13
+ date: 2013-07-19 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: activesupport
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
- - - '>='
20
+ - - ! '>='
19
21
  - !ruby/object:Gem::Version
20
22
  version: '0'
21
23
  type: :runtime
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
- - - '>='
28
+ - - ! '>='
26
29
  - !ruby/object:Gem::Version
27
30
  version: '0'
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: activemodel
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
- - - '>='
36
+ - - ! '>='
33
37
  - !ruby/object:Gem::Version
34
38
  version: '0'
35
39
  type: :runtime
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
- - - '>='
44
+ - - ! '>='
40
45
  - !ruby/object:Gem::Version
41
46
  version: '0'
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: solrizer
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
52
  - - ~>
47
53
  - !ruby/object:Gem::Version
@@ -49,6 +55,7 @@ dependencies:
49
55
  type: :runtime
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
52
59
  requirements:
53
60
  - - ~>
54
61
  - !ruby/object:Gem::Version
@@ -56,48 +63,55 @@ dependencies:
56
63
  - !ruby/object:Gem::Dependency
57
64
  name: nokogiri
58
65
  requirement: !ruby/object:Gem::Requirement
66
+ none: false
59
67
  requirements:
60
- - - '>='
68
+ - - ! '>='
61
69
  - !ruby/object:Gem::Version
62
70
  version: 1.4.2
63
71
  type: :runtime
64
72
  prerelease: false
65
73
  version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
66
75
  requirements:
67
- - - '>='
76
+ - - ! '>='
68
77
  - !ruby/object:Gem::Version
69
78
  version: 1.4.2
70
79
  - !ruby/object:Gem::Dependency
71
80
  name: mediashelf-loggable
72
81
  requirement: !ruby/object:Gem::Requirement
82
+ none: false
73
83
  requirements:
74
- - - '>='
84
+ - - ! '>='
75
85
  - !ruby/object:Gem::Version
76
86
  version: '0'
77
87
  type: :runtime
78
88
  prerelease: false
79
89
  version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
80
91
  requirements:
81
- - - '>='
92
+ - - ! '>='
82
93
  - !ruby/object:Gem::Version
83
94
  version: '0'
84
95
  - !ruby/object:Gem::Dependency
85
96
  name: deprecation
86
97
  requirement: !ruby/object:Gem::Requirement
98
+ none: false
87
99
  requirements:
88
- - - '>='
100
+ - - ! '>='
89
101
  - !ruby/object:Gem::Version
90
102
  version: '0'
91
103
  type: :runtime
92
104
  prerelease: false
93
105
  version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
94
107
  requirements:
95
- - - '>='
108
+ - - ! '>='
96
109
  - !ruby/object:Gem::Version
97
110
  version: '0'
98
111
  - !ruby/object:Gem::Dependency
99
112
  name: rspec
100
113
  requirement: !ruby/object:Gem::Requirement
114
+ none: false
101
115
  requirements:
102
116
  - - ~>
103
117
  - !ruby/object:Gem::Version
@@ -105,6 +119,7 @@ dependencies:
105
119
  type: :development
106
120
  prerelease: false
107
121
  version_requirements: !ruby/object:Gem::Requirement
122
+ none: false
108
123
  requirements:
109
124
  - - ~>
110
125
  - !ruby/object:Gem::Version
@@ -112,88 +127,100 @@ dependencies:
112
127
  - !ruby/object:Gem::Dependency
113
128
  name: rake
114
129
  requirement: !ruby/object:Gem::Requirement
130
+ none: false
115
131
  requirements:
116
- - - '>='
132
+ - - ! '>='
117
133
  - !ruby/object:Gem::Version
118
134
  version: '0'
119
135
  type: :development
120
136
  prerelease: false
121
137
  version_requirements: !ruby/object:Gem::Requirement
138
+ none: false
122
139
  requirements:
123
- - - '>='
140
+ - - ! '>='
124
141
  - !ruby/object:Gem::Version
125
142
  version: '0'
126
143
  - !ruby/object:Gem::Dependency
127
144
  name: yard
128
145
  requirement: !ruby/object:Gem::Requirement
146
+ none: false
129
147
  requirements:
130
- - - '>='
148
+ - - ! '>='
131
149
  - !ruby/object:Gem::Version
132
150
  version: '0'
133
151
  type: :development
134
152
  prerelease: false
135
153
  version_requirements: !ruby/object:Gem::Requirement
154
+ none: false
136
155
  requirements:
137
- - - '>='
156
+ - - ! '>='
138
157
  - !ruby/object:Gem::Version
139
158
  version: '0'
140
159
  - !ruby/object:Gem::Dependency
141
160
  name: rdoc
142
161
  requirement: !ruby/object:Gem::Requirement
162
+ none: false
143
163
  requirements:
144
- - - '>='
164
+ - - ! '>='
145
165
  - !ruby/object:Gem::Version
146
166
  version: '0'
147
167
  type: :development
148
168
  prerelease: false
149
169
  version_requirements: !ruby/object:Gem::Requirement
170
+ none: false
150
171
  requirements:
151
- - - '>='
172
+ - - ! '>='
152
173
  - !ruby/object:Gem::Version
153
174
  version: '0'
154
175
  - !ruby/object:Gem::Dependency
155
176
  name: RedCloth
156
177
  requirement: !ruby/object:Gem::Requirement
178
+ none: false
157
179
  requirements:
158
- - - '>='
180
+ - - ! '>='
159
181
  - !ruby/object:Gem::Version
160
182
  version: '0'
161
183
  type: :development
162
184
  prerelease: false
163
185
  version_requirements: !ruby/object:Gem::Requirement
186
+ none: false
164
187
  requirements:
165
- - - '>='
188
+ - - ! '>='
166
189
  - !ruby/object:Gem::Version
167
190
  version: '0'
168
191
  - !ruby/object:Gem::Dependency
169
192
  name: awesome_print
170
193
  requirement: !ruby/object:Gem::Requirement
194
+ none: false
171
195
  requirements:
172
- - - '>='
196
+ - - ! '>='
173
197
  - !ruby/object:Gem::Version
174
198
  version: '0'
175
199
  type: :development
176
200
  prerelease: false
177
201
  version_requirements: !ruby/object:Gem::Requirement
202
+ none: false
178
203
  requirements:
179
- - - '>='
204
+ - - ! '>='
180
205
  - !ruby/object:Gem::Version
181
206
  version: '0'
182
207
  - !ruby/object:Gem::Dependency
183
208
  name: equivalent-xml
184
209
  requirement: !ruby/object:Gem::Requirement
210
+ none: false
185
211
  requirements:
186
- - - '>='
212
+ - - ! '>='
187
213
  - !ruby/object:Gem::Version
188
214
  version: 0.2.4
189
215
  type: :development
190
216
  prerelease: false
191
217
  version_requirements: !ruby/object:Gem::Requirement
218
+ none: false
192
219
  requirements:
193
- - - '>='
220
+ - - ! '>='
194
221
  - !ruby/object:Gem::Version
195
222
  version: 0.2.4
196
- description: 'OM (Opinionated Metadata): A library to help you tame sprawling XML
223
+ description: ! 'OM (Opinionated Metadata): A library to help you tame sprawling XML
197
224
  schemas like MODS. Wraps Nokogiri documents in objects with miscellaneous helper
198
225
  methods for doing things like retrieve generated xpath queries or look up properties
199
226
  based on a simplified DSL'
@@ -282,27 +309,28 @@ files:
282
309
  - spec/unit/xml_terminology_based_solrizer_spec.rb
283
310
  homepage: http://github.com/projecthydra/om
284
311
  licenses: []
285
- metadata: {}
286
312
  post_install_message:
287
313
  rdoc_options: []
288
314
  require_paths:
289
315
  - lib
290
316
  required_ruby_version: !ruby/object:Gem::Requirement
317
+ none: false
291
318
  requirements:
292
- - - '>='
319
+ - - ! '>='
293
320
  - !ruby/object:Gem::Version
294
321
  version: 1.9.3
295
322
  required_rubygems_version: !ruby/object:Gem::Requirement
323
+ none: false
296
324
  requirements:
297
- - - '>='
325
+ - - ! '>='
298
326
  - !ruby/object:Gem::Version
299
327
  version: '0'
300
328
  requirements: []
301
329
  rubyforge_project:
302
- rubygems_version: 2.0.3
330
+ rubygems_version: 1.8.23
303
331
  signing_key:
304
- specification_version: 4
305
- summary: 'OM (Opinionated Metadata): A library to help you tame sprawling XML schemas
332
+ specification_version: 3
333
+ summary: ! 'OM (Opinionated Metadata): A library to help you tame sprawling XML schemas
306
334
  like MODS.'
307
335
  test_files:
308
336
  - spec/fixtures/CBF_MODS/ARS0025_016.xml
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: b8853ffe68e14cbf9ff2ff97cc6a11dc742f66b9
4
- data.tar.gz: 1f871031a8b66f0537598d05c05fc1bbcbbeca2d
5
- SHA512:
6
- metadata.gz: 8eb12d59198a4a22597551376e8142be99c0e5567e273490fd4eab40659419f89727267a79795e5049e3a1876c6f479df471146455f69d5c37cbd7cf167390a2
7
- data.tar.gz: d8e3386ff684e7fe87d599b5842753050494fba9f6043f070882d21709de794052c46bc3fd64881638476cf099fdaeee277f63b2644fe305ad805ec290553b6c