hydra-pbcore 3.0.0.rc1 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/hydra_pbcore/templates.rb +4 -4
- data/lib/hydra_pbcore/version.rb +1 -1
- data/spec/instantiation_spec.rb +1 -1
- data/spec/templates_spec.rb +31 -8
- metadata +35 -7
- checksums.yaml +0 -15
data/Gemfile.lock
CHANGED
@@ -43,9 +43,9 @@ module HydraPbcore::Templates
|
|
43
43
|
}
|
44
44
|
end
|
45
45
|
|
46
|
-
define_template :event_place do |xml, location|
|
46
|
+
define_template :event_place do |xml, location, type="Event Place"|
|
47
47
|
xml.pbcoreCoverage {
|
48
|
-
xml.coverage(location, :annotation=>
|
48
|
+
xml.coverage(location, :annotation=>type)
|
49
49
|
xml.coverageType {
|
50
50
|
xml.text "Spatial"
|
51
51
|
}
|
@@ -61,9 +61,9 @@ module HydraPbcore::Templates
|
|
61
61
|
}
|
62
62
|
end
|
63
63
|
|
64
|
-
define_template :relation do |xml, value, annotation|
|
64
|
+
define_template :relation do |xml, value, annotation, type="Is Part Of"|
|
65
65
|
xml.pbcoreRelation {
|
66
|
-
xml.pbcoreRelationType(
|
66
|
+
xml.pbcoreRelationType(type, :source=>"PBCore relationType", :ref=>"http://pbcore.org/vocabularies/relationType#is-part-of")
|
67
67
|
xml.pbcoreRelationIdentifier(value, :annotation=>annotation)
|
68
68
|
}
|
69
69
|
end
|
data/lib/hydra_pbcore/version.rb
CHANGED
data/spec/instantiation_spec.rb
CHANGED
@@ -76,7 +76,7 @@ describe HydraPbcore::Datastream::Instantiation do
|
|
76
76
|
@digital.format.should == []
|
77
77
|
end
|
78
78
|
|
79
|
-
it "should match an
|
79
|
+
it "should match an exemplar with all fields shown" do
|
80
80
|
@digital.checksum_type = "inserted"
|
81
81
|
@digital.note = "inserted"
|
82
82
|
@digital.checksum_value = "inserted"
|
data/spec/templates_spec.rb
CHANGED
@@ -3,34 +3,57 @@ require 'spec_helper'
|
|
3
3
|
describe HydraPbcore::Templates do
|
4
4
|
|
5
5
|
before :each do
|
6
|
-
class TestClass
|
7
|
-
|
6
|
+
class TestClass < ActiveFedora::OmDatastream
|
8
7
|
class_attribute :institution, :relator, :address
|
9
8
|
self.institution = "Rock and Roll Hall of Fame and Museum"
|
10
9
|
self.relator = "MARC relator terms"
|
11
10
|
self.address = "Rock and Roll Hall of Fame and Museum,\n2809 Woodland Ave.,\nCleveland, OH, 44115\n216-515-1956\nlibrary@rockhall.org"
|
12
11
|
|
13
|
-
def self.define_template arg
|
14
|
-
end
|
15
|
-
|
16
12
|
include HydraPbcore::Templates
|
17
13
|
end
|
18
|
-
@test = TestClass.new
|
19
14
|
end
|
15
|
+
subject { TestClass.new }
|
16
|
+
|
17
|
+
let(:xml) { subject.ng_xml }
|
20
18
|
|
21
19
|
describe "#digital_instantiation" do
|
22
20
|
it "should return a template for a digital instantiaion" do
|
23
|
-
save_template
|
21
|
+
save_template subject.digital_instantiation, "digital_instantiation_template.xml"
|
24
22
|
tmp_file_should_match_exemplar("digital_instantiation_template.xml")
|
25
23
|
end
|
26
24
|
end
|
27
25
|
|
28
26
|
describe "#physical_instantiation" do
|
29
27
|
it "should create a template for physical instantiaions such as tapes" do
|
30
|
-
save_template
|
28
|
+
save_template subject.physical_instantiation, "physical_instantiation_template.xml"
|
31
29
|
tmp_file_should_match_exemplar("physical_instantiation_template.xml")
|
32
30
|
end
|
33
31
|
end
|
34
32
|
|
33
|
+
describe "#relation" do
|
34
|
+
it "should take a two arg constructor" do
|
35
|
+
subject.add_child_node(subject.ng_xml.root, :relation, 'foo', 'bar')
|
36
|
+
xml.xpath('//pbcoreRelation/pbcoreRelationType[@source="PBCore relationType"]').text.should == "Is Part Of"
|
37
|
+
xml.xpath('//pbcoreRelation/pbcoreRelationIdentifier[@annotation="bar"]').text.should == "foo"
|
38
|
+
end
|
39
|
+
it "should take a three arg constructor" do
|
40
|
+
subject.add_child_node(subject.ng_xml.root, :relation, 'foo', 'bar', 'baz')
|
41
|
+
xml.xpath('//pbcoreRelation/pbcoreRelationType[@source="PBCore relationType"]').text.should == "baz"
|
42
|
+
xml.xpath('//pbcoreRelation/pbcoreRelationIdentifier[@annotation="bar"]').text.should == "foo"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe "#event_place" do
|
47
|
+
it "should take a one arg constructor" do
|
48
|
+
subject.add_child_node(subject.ng_xml.root, :event_place, 'foo')
|
49
|
+
xml.xpath('//pbcoreCoverage/coverage[@annotation="Event Place"]').text.should == "foo"
|
50
|
+
xml.xpath('//pbcoreCoverage/coverageType').text.should == "Spatial"
|
51
|
+
end
|
52
|
+
it "should take a two arg constructor" do
|
53
|
+
subject.add_child_node(subject.ng_xml.root, :event_place, 'foo', 'bar')
|
54
|
+
xml.xpath('//pbcoreCoverage/coverage[@annotation="bar"]').text.should == "foo"
|
55
|
+
xml.xpath('//pbcoreCoverage/coverageType').text.should == "Spatial"
|
56
|
+
end
|
57
|
+
end
|
35
58
|
|
36
59
|
end
|
metadata
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hydra-pbcore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0
|
4
|
+
version: 3.0.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Adam Wead
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-13 00:00:00.000000000 Z
|
12
13
|
dependencies:
|
13
14
|
- !ruby/object:Gem::Dependency
|
14
15
|
name: active-fedora
|
15
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
16
18
|
requirements:
|
17
19
|
- - ! '>='
|
18
20
|
- !ruby/object:Gem::Version
|
@@ -20,6 +22,7 @@ dependencies:
|
|
20
22
|
type: :runtime
|
21
23
|
prerelease: false
|
22
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
23
26
|
requirements:
|
24
27
|
- - ! '>='
|
25
28
|
- !ruby/object:Gem::Version
|
@@ -27,6 +30,7 @@ dependencies:
|
|
27
30
|
- !ruby/object:Gem::Dependency
|
28
31
|
name: solrizer
|
29
32
|
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
30
34
|
requirements:
|
31
35
|
- - ! '>='
|
32
36
|
- !ruby/object:Gem::Version
|
@@ -34,6 +38,7 @@ dependencies:
|
|
34
38
|
type: :runtime
|
35
39
|
prerelease: false
|
36
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
37
42
|
requirements:
|
38
43
|
- - ! '>='
|
39
44
|
- !ruby/object:Gem::Version
|
@@ -41,6 +46,7 @@ dependencies:
|
|
41
46
|
- !ruby/object:Gem::Dependency
|
42
47
|
name: yard
|
43
48
|
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
44
50
|
requirements:
|
45
51
|
- - ! '>='
|
46
52
|
- !ruby/object:Gem::Version
|
@@ -48,6 +54,7 @@ dependencies:
|
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
51
58
|
requirements:
|
52
59
|
- - ! '>='
|
53
60
|
- !ruby/object:Gem::Version
|
@@ -55,6 +62,7 @@ dependencies:
|
|
55
62
|
- !ruby/object:Gem::Dependency
|
56
63
|
name: redcarpet
|
57
64
|
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
58
66
|
requirements:
|
59
67
|
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
@@ -62,6 +70,7 @@ dependencies:
|
|
62
70
|
type: :development
|
63
71
|
prerelease: false
|
64
72
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
65
74
|
requirements:
|
66
75
|
- - ! '>='
|
67
76
|
- !ruby/object:Gem::Version
|
@@ -69,6 +78,7 @@ dependencies:
|
|
69
78
|
- !ruby/object:Gem::Dependency
|
70
79
|
name: rake
|
71
80
|
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
72
82
|
requirements:
|
73
83
|
- - ! '>='
|
74
84
|
- !ruby/object:Gem::Version
|
@@ -76,6 +86,7 @@ dependencies:
|
|
76
86
|
type: :development
|
77
87
|
prerelease: false
|
78
88
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
79
90
|
requirements:
|
80
91
|
- - ! '>='
|
81
92
|
- !ruby/object:Gem::Version
|
@@ -83,6 +94,7 @@ dependencies:
|
|
83
94
|
- !ruby/object:Gem::Dependency
|
84
95
|
name: rspec
|
85
96
|
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
86
98
|
requirements:
|
87
99
|
- - ! '>='
|
88
100
|
- !ruby/object:Gem::Version
|
@@ -90,6 +102,7 @@ dependencies:
|
|
90
102
|
type: :development
|
91
103
|
prerelease: false
|
92
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
93
106
|
requirements:
|
94
107
|
- - ! '>='
|
95
108
|
- !ruby/object:Gem::Version
|
@@ -97,6 +110,7 @@ dependencies:
|
|
97
110
|
- !ruby/object:Gem::Dependency
|
98
111
|
name: rdoc
|
99
112
|
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
100
114
|
requirements:
|
101
115
|
- - ! '>='
|
102
116
|
- !ruby/object:Gem::Version
|
@@ -104,6 +118,7 @@ dependencies:
|
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
107
122
|
requirements:
|
108
123
|
- - ! '>='
|
109
124
|
- !ruby/object:Gem::Version
|
@@ -111,6 +126,7 @@ dependencies:
|
|
111
126
|
- !ruby/object:Gem::Dependency
|
112
127
|
name: equivalent-xml
|
113
128
|
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
114
130
|
requirements:
|
115
131
|
- - ! '>='
|
116
132
|
- !ruby/object:Gem::Version
|
@@ -118,6 +134,7 @@ dependencies:
|
|
118
134
|
type: :development
|
119
135
|
prerelease: false
|
120
136
|
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
121
138
|
requirements:
|
122
139
|
- - ! '>='
|
123
140
|
- !ruby/object:Gem::Version
|
@@ -125,6 +142,7 @@ dependencies:
|
|
125
142
|
- !ruby/object:Gem::Dependency
|
126
143
|
name: debugger
|
127
144
|
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
128
146
|
requirements:
|
129
147
|
- - ! '>='
|
130
148
|
- !ruby/object:Gem::Version
|
@@ -132,6 +150,7 @@ dependencies:
|
|
132
150
|
type: :development
|
133
151
|
prerelease: false
|
134
152
|
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
135
154
|
requirements:
|
136
155
|
- - ! '>='
|
137
156
|
- !ruby/object:Gem::Version
|
@@ -139,6 +158,7 @@ dependencies:
|
|
139
158
|
- !ruby/object:Gem::Dependency
|
140
159
|
name: pry
|
141
160
|
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
142
162
|
requirements:
|
143
163
|
- - ! '>='
|
144
164
|
- !ruby/object:Gem::Version
|
@@ -146,6 +166,7 @@ dependencies:
|
|
146
166
|
type: :development
|
147
167
|
prerelease: false
|
148
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
149
170
|
requirements:
|
150
171
|
- - ! '>='
|
151
172
|
- !ruby/object:Gem::Version
|
@@ -191,26 +212,33 @@ files:
|
|
191
212
|
- tmp/.gitkeep
|
192
213
|
homepage: ''
|
193
214
|
licenses: []
|
194
|
-
metadata: {}
|
195
215
|
post_install_message:
|
196
216
|
rdoc_options: []
|
197
217
|
require_paths:
|
198
218
|
- lib
|
199
219
|
required_ruby_version: !ruby/object:Gem::Requirement
|
220
|
+
none: false
|
200
221
|
requirements:
|
201
222
|
- - ! '>='
|
202
223
|
- !ruby/object:Gem::Version
|
203
224
|
version: '0'
|
225
|
+
segments:
|
226
|
+
- 0
|
227
|
+
hash: 3304002747740437640
|
204
228
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
229
|
+
none: false
|
205
230
|
requirements:
|
206
|
-
- - ! '
|
231
|
+
- - ! '>='
|
207
232
|
- !ruby/object:Gem::Version
|
208
|
-
version:
|
233
|
+
version: '0'
|
234
|
+
segments:
|
235
|
+
- 0
|
236
|
+
hash: 3304002747740437640
|
209
237
|
requirements: []
|
210
238
|
rubyforge_project:
|
211
|
-
rubygems_version:
|
239
|
+
rubygems_version: 1.8.23
|
212
240
|
signing_key:
|
213
|
-
specification_version:
|
241
|
+
specification_version: 3
|
214
242
|
summary: A Hydra gem that offers PBCore datastream definitions using OM
|
215
243
|
test_files:
|
216
244
|
- spec/config_spec.rb
|
checksums.yaml
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
---
|
2
|
-
!binary "U0hBMQ==":
|
3
|
-
metadata.gz: !binary |-
|
4
|
-
OTNhOTQ2MTY5MTMxMjc1YTJhYmEzMDc1M2RkMmU0NzlkOTVmODRlMg==
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MzMwNjE5NjliMjc3YWQwZjViODIwNzk3MTQzMmJlYWZkNDRjMjM1Mg==
|
7
|
-
!binary "U0hBNTEy":
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
Nzc5Y2I1ZGQ5OTdmMGI0MjA3ZDQzYjYzNzlhODU2Zjc1YmFlZWY1ZTJmNzYz
|
10
|
-
NmYyM2UzMmM0YmJjYTQ0ZGJkNmM0YTVjYzMwNmQxNzFjNzg2OWZjYjVlNTJl
|
11
|
-
ZjU0NzhiYmEyNzU4NDNlNzY5YzBjYWMwODA3ZjkzNWQ4NTY1Mjc=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YTNhZDI5YmVhMWUyMmE3N2U2ZmRjY2JmZDM5MzUxNGMwYzg2ZjRlNGI5YzQx
|
14
|
-
OWIwNzI1ZjAyNzU2OGZjOTdlMWJhZjU2YWY0YWY1MWY1YmI0NDVmY2M2NTZm
|
15
|
-
MTk1NDUzY2Y4YTdmYjE1YmIzMjg3ZTlmNTI4MzUzZDMyNjEyMzc=
|