hydra-pbcore 1.1.3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -4,6 +4,7 @@
4
4
  .bundle
5
5
  .config
6
6
  .yardoc
7
+ .rvmrc
7
8
  Gemfile.lock
8
9
  InstalledFiles
9
10
  _yardoc
@@ -15,4 +16,6 @@ rdoc
15
16
  spec/reports
16
17
  test/tmp
17
18
  test/version_tmp
18
- tmp
19
+ tmp/*
20
+ !tmp/.gitkeep
21
+ *.sw[opn]
data/README.md CHANGED
@@ -46,6 +46,15 @@ validate against the PBCore XML v.2 schema. Additionally, there are several tem
46
46
  to insert additional terms into your xml documents, such as contributors, publishers, as well as next and previous
47
47
  fields that specify which files come before and after one another in a multi-part born-digital video.
48
48
 
49
+ ## Testing
50
+
51
+ To run all the rspec tests, use:
52
+
53
+ rspec spec
54
+
55
+ Sample xml documents are copied to tmp so you can see what the xml looks like that hydra-pbcore is generating.
56
+ These xml samples are compared to examples in spec/fixtures.
57
+
49
58
  ## Contributing
50
59
 
51
60
  1. Fork it
data/hydra-pbcore.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require 'hydra-pbcore/version'
3
+ require 'hydra_pbcore/version'
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.authors = ["Adam Wead"]
data/lib/hydra-pbcore.rb CHANGED
@@ -5,6 +5,7 @@ require "om"
5
5
  require "active-fedora"
6
6
 
7
7
  module HydraPbcore
8
+ extend ActiveSupport::Autoload
8
9
 
9
10
  DocumentNodes = [
10
11
  "pbcoreAssetType",
@@ -64,15 +65,11 @@ module HydraPbcore
64
65
  xml = '<?xml version="1.0"?><pbcoreDescriptionDocument xmlns="http://www.pbcore.org/PBCore/PBCoreNamespace.html" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.pbcore.org/PBCore/PBCoreNamespace.html" xsi:schemaLocation="http://www.pbcore.org/PBCore/PBCoreNamespace.html"></pbcoreDescriptionDocument>'
65
66
  Nokogiri::XML(xml)
66
67
  end
67
- end
68
68
 
69
- require "hydra-pbcore/methods"
70
- require "hydra-pbcore/conversions"
71
- require "hydra-pbcore/behaviors"
72
- require "hydra-pbcore/templates"
73
- require "hydra-pbcore/mapper"
74
- require "hydra-pbcore/datastream/document"
75
- require "hydra-pbcore/datastream/instantiation"
76
- require "hydra-pbcore/datastream/deprecated/document"
77
- require "hydra-pbcore/datastream/deprecated/digital_document"
78
- require "hydra-pbcore/datastream/deprecated/instantiation"
69
+ autoload :Mapper
70
+ autoload :Methods
71
+ autoload :Conversions
72
+ autoload :Behaviors
73
+ autoload :Templates
74
+ autoload :Datastream
75
+ end
@@ -1,11 +1,12 @@
1
1
  module HydraPbcore
2
2
  class Behaviors
3
3
 
4
- # This module is deprecated and will be removed in release 2.0.0
4
+ # This module is a leftover from version 1 of the hydra-pbcore gem and is no longer actively
5
+ # developed. It will be removed in a future release.
5
6
 
6
7
  # Nokogiri's add_namespace doesn't seem to work, so we have to insert it "manually"
7
8
  def self.insert_pbcore_namespace(doc)
8
- puts "WARNING: HydraPbcore::Behaviors is deprecated and will be removed in release 2.0"
9
+ puts "WARNING: HydraPbcore::Behaviors is deprecated and will be removed in a future release"
9
10
  index = doc.to_s.index("xmlns:xsi")
10
11
  new_s = doc.to_s.insert(index.to_i, 'xmlns="http://www.pbcore.org/PBCore/PBCoreNamespace.html" ')
11
12
  new_doc = Nokogiri::XML(new_s)
@@ -15,7 +16,7 @@ class Behaviors
15
16
  # Validates a PBCore document against an xsd
16
17
  # Returns an array of errors -- an empty array means it's valid
17
18
  def self.validate(doc)
18
- puts "WARNING: HydraPbcore::Behaviors is deprecated and will be removed in release 2.0"
19
+ puts "WARNING: HydraPbcore::Behaviors is deprecated and will be removed in a future release"
19
20
  xsd = Nokogiri::XML::Schema(open("http://pbcore.org/xsd/pbcore-2.0.xsd"))
20
21
  xsd.validate(doc)
21
22
  end
@@ -23,7 +24,7 @@ class Behaviors
23
24
 
24
25
  # Reorders the nodes of pbcoreDescriptionDocument to conform with the correct order
25
26
  def self.reorder_document(doc)
26
- puts "WARNING: HydraPbcore::Behaviors is deprecated and will be removed in release 2.0"
27
+ puts "WARNING: HydraPbcore::Behaviors is deprecated and will be removed in a future release"
27
28
  nodes = [
28
29
  "pbcoreAssetType",
29
30
  "pbcoreAssetDate",
File without changes
@@ -0,0 +1,6 @@
1
+ module HydraPbcore::Datastream
2
+ extend ActiveSupport::Autoload
3
+ autoload :Document
4
+ autoload :Instantiation
5
+ autoload :Deprecated
6
+ end
@@ -0,0 +1,6 @@
1
+ module HydraPbcore::Datastream::Deprecated
2
+ extend ActiveSupport::Autoload
3
+ autoload :Document
4
+ autoload :DigitalDocument
5
+ autoload :Instantiation
6
+ end
@@ -1,5 +1,5 @@
1
1
  module HydraPbcore::Datastream
2
- class Document < ActiveFedora::NokogiriDatastream
2
+ class Document < ActiveFedora::OmDatastream
3
3
 
4
4
  include HydraPbcore::Methods
5
5
  include HydraPbcore::Templates
@@ -116,6 +116,17 @@ class Document < ActiveFedora::NokogiriDatastream
116
116
  :index_as => [:not_searchable, :converted_date, :displayable]
117
117
  )
118
118
 
119
+ # Creator names and roles
120
+ t.creator(:path=>"pbcoreCreator") do
121
+ t.name_(:path=>"creator", :index_as => [:searchable, :facetable])
122
+ t.role_(:path=>"creatorRole",
123
+ :attributes=>{ :source=>"PBCore creatorRole" },
124
+ :index_as => [:searchable, :displayable]
125
+ )
126
+ end
127
+ t.creator_name(:proxy=>[:creator, :name])
128
+ t.creator_role(:proxy=>[:creator, :role])
129
+
119
130
  # Contributor names and roles
120
131
  t.contributor(:path=>"pbcoreContributor") do
121
132
  t.name_(:path=>"contributor", :index_as => [:searchable, :facetable])
@@ -162,36 +173,6 @@ class Document < ActiveFedora::NokogiriDatastream
162
173
  :descriptionTypeRef=>"http://pbcore.org/vocabularies/pbcoreDescription/descriptionType#table-of-contents",
163
174
  :annotation=>"Parts List"
164
175
  )
165
- xml.pbcoreRelation {
166
- xml.pbcoreRelationType(:source=>"PBCore relationType", :ref=>"http://pbcore.org/vocabularies/relationType#is-part-of") {
167
- xml.text "Is Part Of"
168
- }
169
- xml.pbcoreRelationIdentifier(:annotation=>"Event Series")
170
- }
171
- xml.pbcoreRelation {
172
- xml.pbcoreRelationType(:source=>"PBCore relationType", :ref=>"http://pbcore.org/vocabularies/relationType#is-part-of") {
173
- xml.text "Is Part Of"
174
- }
175
- xml.pbcoreRelationIdentifier(:annotation=>"Archival Collection")
176
- }
177
- xml.pbcoreRelation {
178
- xml.pbcoreRelationType(:source=>"PBCore relationType", :ref=>"http://pbcore.org/vocabularies/relationType#is-part-of") {
179
- xml.text "Is Part Of"
180
- }
181
- xml.pbcoreRelationIdentifier(:annotation=>"Archival Series")
182
- }
183
- xml.pbcoreRelation {
184
- xml.pbcoreRelationType(:source=>"PBCore relationType", :ref=>"http://pbcore.org/vocabularies/relationType#is-part-of") {
185
- xml.text "Is Part Of"
186
- }
187
- xml.pbcoreRelationIdentifier(:annotation=>"Collection Number")
188
- }
189
- xml.pbcoreRelation {
190
- xml.pbcoreRelationType(:source=>"PBCore relationType", :ref=>"http://pbcore.org/vocabularies/relationType#is-part-of") {
191
- xml.text "Is Part Of"
192
- }
193
- xml.pbcoreRelationIdentifier(:annotation=>"Accession Number")
194
- }
195
176
  xml.pbcoreRightsSummary {
196
177
  xml.rightsSummary
197
178
  }
@@ -204,4 +185,4 @@ class Document < ActiveFedora::NokogiriDatastream
204
185
  end
205
186
 
206
187
  end
207
- end
188
+ end
@@ -1,5 +1,5 @@
1
1
  module HydraPbcore::Datastream
2
- class Instantiation < ActiveFedora::NokogiriDatastream
2
+ class Instantiation < ActiveFedora::OmDatastream
3
3
 
4
4
  include HydraPbcore::Methods
5
5
  include HydraPbcore::Templates
File without changes
File without changes
@@ -4,6 +4,13 @@ module HydraPbcore::Templates
4
4
  included do
5
5
  class_eval do
6
6
 
7
+ define_template :creator do |xml, author, role|
8
+ xml.pbcoreCreator {
9
+ xml.creator(author)
10
+ xml.creatorRole(role, :source=>"PBCore creatorRole")
11
+ }
12
+ end
13
+
7
14
  define_template :publisher do |xml, publisher, role|
8
15
  xml.pbcorePublisher {
9
16
  xml.publisher(publisher)
@@ -54,9 +61,20 @@ module HydraPbcore::Templates
54
61
  }
55
62
  end
56
63
 
64
+ define_template :relation do |xml, value, annotation|
65
+ xml.pbcoreRelation {
66
+ xml.pbcoreRelationType("Is Part Of", :source=>"PBCore relationType", :ref=>"http://pbcore.org/vocabularies/relationType#is-part-of")
67
+ xml.pbcoreRelationIdentifier(value, :annotation=>annotation)
68
+ }
69
+ end
70
+
57
71
  end
58
72
  end
59
73
 
74
+ def insert_creator(author=nil, role=nil)
75
+ add_child_node(ng_xml.root, :creator, author, role)
76
+ end
77
+
60
78
  def insert_contributor(author=nil, role=nil)
61
79
  add_child_node(ng_xml.root, :contributor, author, role)
62
80
  end
@@ -81,6 +99,10 @@ module HydraPbcore::Templates
81
99
  add_child_node(ng_xml.root, :event_date, date)
82
100
  end
83
101
 
102
+ def insert_relation(value, annotation)
103
+ add_child_node(ng_xml.root, :relation, value, annotation)
104
+ end
105
+
84
106
  def digital_instantiation
85
107
  builder = Nokogiri::XML::Builder.new do |xml|
86
108
 
@@ -171,4 +193,4 @@ module HydraPbcore::Templates
171
193
  end
172
194
 
173
195
 
174
- end
196
+ end
@@ -0,0 +1,3 @@
1
+ module HydraPbcore
2
+ VERSION = "2.0.0"
3
+ end
@@ -9,7 +9,7 @@ describe HydraPbcore::Datastream::Document do
9
9
  describe "::xml_template" do
10
10
  it "should match an exmplar" do
11
11
  save_template @object_ds.to_xml, "document_template.xml"
12
- equivalent_xml_files("document_template.xml").should be_true
12
+ tmp_file_should_match_exemplar("document_template.xml")
13
13
  end
14
14
  end
15
15
 
@@ -35,6 +35,8 @@ describe HydraPbcore::Datastream::Document do
35
35
  [:lc_genre],
36
36
  [:lc_subject_genre],
37
37
  [:event_series],
38
+ [:creator_name],
39
+ [:creator_role],
38
40
  [:contributor_name],
39
41
  [:contributor_role],
40
42
  [:publisher_name],
@@ -54,9 +56,12 @@ describe HydraPbcore::Datastream::Document do
54
56
  end
55
57
 
56
58
  it "should update fields requiring inserted nodes" do
59
+ @object_ds.insert_creator
57
60
  @object_ds.insert_publisher
58
61
  @object_ds.insert_contributor
59
62
  [
63
+ [:creator_name],
64
+ [:creator_role],
60
65
  [:publisher_name],
61
66
  [:publisher_role],
62
67
  [:contributor_name],
@@ -69,6 +74,22 @@ describe HydraPbcore::Datastream::Document do
69
74
  end
70
75
  end
71
76
 
77
+ it "should have insert_relation" do
78
+ @object_ds = HydraPbcore::Datastream::Document.new(nil, nil)
79
+ @object_ds.insert_relation("My Collection", 'Archival Collection')
80
+ @object_ds.archival_collection.should == ['My Collection']
81
+
82
+ @object_ds.insert_relation("My event", 'Event Series')
83
+ @object_ds.event_series.should == ['My event']
84
+
85
+ @object_ds.insert_relation("My series", 'Archival Series')
86
+ @object_ds.archival_series.should == ['My series']
87
+
88
+ @object_ds.insert_relation("My Acces Num", 'Accession Number')
89
+ @object_ds.accession_number.should == ['My Acces Num']
90
+ end
91
+
92
+
72
93
  it "should differentiate between multiple added nodes" do
73
94
  @object_ds.insert_contributor
74
95
  @object_ds.insert_contributor
@@ -110,6 +131,12 @@ describe HydraPbcore::Datastream::Document do
110
131
  @object_ds.insert_place("inserted")
111
132
  @object_ds.insert_date("2012-11-11")
112
133
 
134
+ @object_ds.insert_relation("inserted", 'Archival Collection')
135
+ @object_ds.insert_relation("inserted", 'Event Series')
136
+ @object_ds.insert_relation("inserted", 'Archival Series')
137
+ @object_ds.insert_relation("inserted", 'Accession Number')
138
+ @object_ds.insert_relation("inserted", 'Collection Number')
139
+
113
140
  @object_ds.pbc_id = "inserted"
114
141
  @object_ds.main_title = "inserted"
115
142
  @object_ds.alternative_title = "inserted"
@@ -135,15 +162,11 @@ describe HydraPbcore::Datastream::Document do
135
162
  @object_ds.publisher_role = "inserted"
136
163
  @object_ds.note = "inserted"
137
164
  @object_ds.rights_summary = "inserted"
138
- @object_ds.archival_collection = "inserted"
139
- @object_ds.archival_series = "inserted"
140
- @object_ds.collection_number = "inserted"
141
- @object_ds.accession_number = "inserted"
142
165
  end
143
166
 
144
- it "solr document should match an exmplar" do
167
+ it "solr document should match an exemplar" do
145
168
  save_template @object_ds.to_solr.to_xml, "document_solr.xml"
146
- equivalent_xml_files("document_solr.xml").should be_true
169
+ tmp_file_should_match_exemplar("document_solr.xml")
147
170
  end
148
171
 
149
172
  describe "solr dates" do
@@ -162,7 +185,7 @@ describe HydraPbcore::Datastream::Document do
162
185
 
163
186
  it "xml document should match an exmplar" do
164
187
  save_template @object_ds.to_xml, "document.xml"
165
- equivalent_xml_files("document.xml").should be_true
188
+ tmp_file_should_match_exemplar("document.xml")
166
189
  end
167
190
 
168
191
  it "xml document should validate against the PBCore schema" do
@@ -3,28 +3,8 @@
3
3
  <pbcoreTitle titleType="Main"/>
4
4
  <pbcoreDescription descriptionType="Description" descriptionTypeSource="pbcoreDescription/descriptionType" descriptionTypeRef="http://pbcore.org/vocabularies/pbcoreDescription/descriptionType#description" annotation="Summary"/>
5
5
  <pbcoreDescription descriptionType="Table of Contents" descriptionTypeSource="pbcoreDescription/descriptionType" descriptionTypeRef="http://pbcore.org/vocabularies/pbcoreDescription/descriptionType#table-of-contents" annotation="Parts List"/>
6
- <pbcoreRelation>
7
- <pbcoreRelationType source="PBCore relationType" ref="http://pbcore.org/vocabularies/relationType#is-part-of">Is Part Of</pbcoreRelationType>
8
- <pbcoreRelationIdentifier annotation="Event Series"/>
9
- </pbcoreRelation>
10
- <pbcoreRelation>
11
- <pbcoreRelationType source="PBCore relationType" ref="http://pbcore.org/vocabularies/relationType#is-part-of">Is Part Of</pbcoreRelationType>
12
- <pbcoreRelationIdentifier annotation="Archival Collection"/>
13
- </pbcoreRelation>
14
- <pbcoreRelation>
15
- <pbcoreRelationType source="PBCore relationType" ref="http://pbcore.org/vocabularies/relationType#is-part-of">Is Part Of</pbcoreRelationType>
16
- <pbcoreRelationIdentifier annotation="Archival Series"/>
17
- </pbcoreRelation>
18
- <pbcoreRelation>
19
- <pbcoreRelationType source="PBCore relationType" ref="http://pbcore.org/vocabularies/relationType#is-part-of">Is Part Of</pbcoreRelationType>
20
- <pbcoreRelationIdentifier annotation="Collection Number"/>
21
- </pbcoreRelation>
22
- <pbcoreRelation>
23
- <pbcoreRelationType source="PBCore relationType" ref="http://pbcore.org/vocabularies/relationType#is-part-of">Is Part Of</pbcoreRelationType>
24
- <pbcoreRelationIdentifier annotation="Accession Number"/>
25
- </pbcoreRelation>
26
6
  <pbcoreRightsSummary>
27
7
  <rightsSummary/>
28
8
  </pbcoreRightsSummary>
29
9
  <pbcoreAnnotation annotationType="Notes"/>
30
- </pbcoreDescriptionDocument>
10
+ </pbcoreDescriptionDocument>
@@ -98,7 +98,7 @@ describe HydraPbcore::Datastream::Instantiation do
98
98
  @digital.insert_previous("inserted")
99
99
 
100
100
  save_template @digital.to_xml, "digital_instantiation.xml"
101
- equivalent_xml_files("digital_instantiation.xml").should be_true
101
+ tmp_file_should_match_exemplar("digital_instantiation.xml")
102
102
  end
103
103
 
104
104
  it "should have different essenceTrackStandard nodes" do
@@ -159,7 +159,7 @@ describe HydraPbcore::Datastream::Instantiation do
159
159
 
160
160
  it "should match an exmplar" do
161
161
  save_template @digital.to_solr.to_xml, "digital_instantiation_solr.xml"
162
- equivalent_xml_files("digital_instantiation_solr.xml").should be_true
162
+ tmp_file_should_match_exemplar("digital_instantiation_solr.xml")
163
163
  end
164
164
 
165
165
  it "should display dates as they were entered" do
@@ -214,7 +214,7 @@ describe HydraPbcore::Datastream::Instantiation do
214
214
  @physical.cleaning_note = "inserted"
215
215
  @physical.condition_note = "inserted"
216
216
  save_template @physical.to_xml, "physical_instantiation.xml"
217
- equivalent_xml_files("physical_instantiation.xml").should be_true
217
+ tmp_file_should_match_exemplar("physical_instantiation.xml")
218
218
  end
219
219
 
220
220
  describe "solr documents" do
@@ -241,7 +241,7 @@ describe HydraPbcore::Datastream::Instantiation do
241
241
 
242
242
  it "should match an exmplar" do
243
243
  save_template @physical.to_solr.to_xml, "physical_instantiation_solr.xml"
244
- equivalent_xml_files("physical_instantiation_solr.xml").should be_true
244
+ tmp_file_should_match_exemplar("physical_instantiation_solr.xml")
245
245
  end
246
246
 
247
247
  it "should display dates as they were entered" do
@@ -259,4 +259,4 @@ describe HydraPbcore::Datastream::Instantiation do
259
259
 
260
260
  end
261
261
 
262
- end
262
+ end
@@ -14,7 +14,7 @@ describe "Converting" do
14
14
  doc = HydraPbcore::Datastream::Deprecated::Document.from_xml(integration_fixture "document_rrhof_524.xml")
15
15
  doc.to_document
16
16
  save_template doc.to_xml, "converted_rrhof_524.xml"
17
- equivalent_xml_files("converted_rrhof_524.xml").should be_true
17
+ tmp_file_should_match_exemplar("converted_rrhof_524.xml")
18
18
  end
19
19
  it "should raise an error with the wrong class" do
20
20
  lambda { @fake.to_document }.should raise_error
@@ -27,7 +27,7 @@ describe "Converting" do
27
27
  inst = doc.to_physical_instantiation
28
28
  inst.should be_kind_of HydraPbcore::Datastream::Instantiation
29
29
  save_template inst.to_xml, "converted_rrhof_524_instantiation.xml"
30
- equivalent_xml_files("converted_rrhof_524_instantiation.xml").should be_true
30
+ tmp_file_should_match_exemplar("converted_rrhof_524_instantiation.xml")
31
31
  end
32
32
  it "should raise an error with the wrong class" do
33
33
  lambda { @fake.to_document }.should raise_error
@@ -39,7 +39,7 @@ describe "Converting" do
39
39
  inst = HydraPbcore::Datastream::Deprecated::Instantiation.from_xml(integration_fixture "instantiation_rrhof_1184.xml")
40
40
  inst.to_instantiation
41
41
  save_template inst.to_xml, "converted_instantiation_rrhof_1184.xml"
42
- equivalent_xml_files("converted_instantiation_rrhof_1184.xml").should be_true
42
+ tmp_file_should_match_exemplar("converted_instantiation_rrhof_1184.xml")
43
43
  end
44
44
  it "should raise an error with the wrong class" do
45
45
  lambda { @fake.to_document }.should raise_error
@@ -52,7 +52,7 @@ describe "Converting" do
52
52
  doc = HydraPbcore::Datastream::Deprecated::DigitalDocument.from_xml(integration_fixture file)
53
53
  doc.clean_document
54
54
  save_template doc.to_xml, ("converted_"+file)
55
- equivalent_xml_files(("converted_"+file)).should be_true
55
+ tmp_file_should_match_exemplar(("converted_"+file))
56
56
  save_template doc.to_pbcore_xml, "valid_pbcore.xml"
57
57
  doc.valid?.should == []
58
58
  end
@@ -63,11 +63,11 @@ describe "Converting" do
63
63
  doc.to_document
64
64
  doc.clean_document
65
65
  save_template doc.to_xml, ("converted_"+file)
66
- equivalent_xml_files(("converted_"+file)).should be_true
66
+ tmp_file_should_match_exemplar(("converted_"+file))
67
67
  save_template doc.to_pbcore_xml, "valid_pbcore.xml"
68
68
  doc.valid?.should == []
69
69
  end
70
70
  end
71
71
  end
72
72
 
73
- end
73
+ end
data/spec/spec_helper.rb CHANGED
@@ -35,15 +35,12 @@ def save_template input, filename
35
35
  end
36
36
 
37
37
  # Tests if a file in spec/fixtures is the same as the file in tmp
38
- def equivalent_xml_files(file)
39
- f = Nokogiri::XML(fixture file)
40
- s = Nokogiri::XML(sample file)
41
- EquivalentXml.equivalent?(
42
- f, s,
43
- opts = { :element_order => false, :normalize_whitespace => true }
44
- )
38
+ def tmp_file_should_match_exemplar(file)
39
+ f = Nokogiri::XML(fixture(file))
40
+ s = Nokogiri::XML(sample(file))
41
+ f.should be_equivalent_to s
45
42
  end
46
43
 
47
44
  def random_string
48
45
  (0...50).map{ ('a'..'z').to_a[rand(26)] }.join
49
- end
46
+ end
@@ -16,16 +16,16 @@ describe HydraPbcore::Templates do
16
16
  describe "#digital_instantiation" do
17
17
  it "should return a template for a digital instantiaion" do
18
18
  save_template @test.digital_instantiation, "digital_instantiation_template.xml"
19
- equivalent_xml_files("digital_instantiation_template.xml").should be_true
19
+ tmp_file_should_match_exemplar("digital_instantiation_template.xml")
20
20
  end
21
21
  end
22
22
 
23
23
  describe "#physical_instantiation" do
24
24
  it "should create a template for physical instantiaions such as tapes" do
25
25
  save_template @test.physical_instantiation, "physical_instantiation_template.xml"
26
- equivalent_xml_files("physical_instantiation_template.xml").should be_true
26
+ tmp_file_should_match_exemplar("physical_instantiation_template.xml")
27
27
  end
28
28
  end
29
29
 
30
30
 
31
- end
31
+ end
data/tmp/.gitkeep ADDED
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-pbcore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 2.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-23 00:00:00.000000000 Z
12
+ date: 2013-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -179,24 +179,25 @@ extensions: []
179
179
  extra_rdoc_files: []
180
180
  files:
181
181
  - .gitignore
182
- - .rvmrc
183
182
  - Gemfile
184
183
  - LICENSE
185
184
  - README.md
186
185
  - Rakefile
187
186
  - hydra-pbcore.gemspec
188
187
  - lib/hydra-pbcore.rb
189
- - lib/hydra-pbcore/behaviors.rb
190
- - lib/hydra-pbcore/conversions.rb
191
- - lib/hydra-pbcore/datastream/deprecated/digital_document.rb
192
- - lib/hydra-pbcore/datastream/deprecated/document.rb
193
- - lib/hydra-pbcore/datastream/deprecated/instantiation.rb
194
- - lib/hydra-pbcore/datastream/document.rb
195
- - lib/hydra-pbcore/datastream/instantiation.rb
196
- - lib/hydra-pbcore/mapper.rb
197
- - lib/hydra-pbcore/methods.rb
198
- - lib/hydra-pbcore/templates.rb
199
- - lib/hydra-pbcore/version.rb
188
+ - lib/hydra_pbcore/behaviors.rb
189
+ - lib/hydra_pbcore/conversions.rb
190
+ - lib/hydra_pbcore/datastream.rb
191
+ - lib/hydra_pbcore/datastream/deprecated.rb
192
+ - lib/hydra_pbcore/datastream/deprecated/digital_document.rb
193
+ - lib/hydra_pbcore/datastream/deprecated/document.rb
194
+ - lib/hydra_pbcore/datastream/deprecated/instantiation.rb
195
+ - lib/hydra_pbcore/datastream/document.rb
196
+ - lib/hydra_pbcore/datastream/instantiation.rb
197
+ - lib/hydra_pbcore/mapper.rb
198
+ - lib/hydra_pbcore/methods.rb
199
+ - lib/hydra_pbcore/templates.rb
200
+ - lib/hydra_pbcore/version.rb
200
201
  - spec/deprecated/digital_document_spec.rb
201
202
  - spec/deprecated/document_spec.rb
202
203
  - spec/deprecated/instantiation_spec.rb
@@ -233,6 +234,7 @@ files:
233
234
  - spec/mapper_spec.rb
234
235
  - spec/spec_helper.rb
235
236
  - spec/templates_spec.rb
237
+ - tmp/.gitkeep
236
238
  homepage: ''
237
239
  licenses: []
238
240
  post_install_message:
@@ -294,4 +296,3 @@ test_files:
294
296
  - spec/mapper_spec.rb
295
297
  - spec/spec_helper.rb
296
298
  - spec/templates_spec.rb
297
- has_rdoc:
data/.rvmrc DELETED
@@ -1,48 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
- # development environment upon cd'ing into the directory
5
-
6
- # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
7
- # Only full ruby name is supported here, for short names use:
8
- # echo "rvm use 1.9.3" > .rvmrc
9
- environment_id="ruby-1.9.3-p286@hydra-pbcore"
10
-
11
- # Uncomment the following lines if you want to verify rvm version per project
12
- # rvmrc_rvm_version="1.14.3 (version)" # 1.10.1 seams as a safe start
13
- # eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
14
- # echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
15
- # return 1
16
- # }
17
-
18
- # First we attempt to load the desired environment directly from the environment
19
- # file. This is very fast and efficient compared to running through the entire
20
- # CLI and selector. If you want feedback on which environment was used then
21
- # insert the word 'use' after --create as this triggers verbose mode.
22
- if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
23
- && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
24
- then
25
- \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
26
- [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
27
- \. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
28
- else
29
- # If the environment file has not yet been created, use the RVM CLI to select.
30
- rvm --create "$environment_id" || {
31
- echo "Failed to create RVM environment '${environment_id}'."
32
- return 1
33
- }
34
- fi
35
-
36
- # If you use bundler, this might be useful to you:
37
- # if [[ -s Gemfile ]] && {
38
- # ! builtin command -v bundle >/dev/null ||
39
- # builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
40
- # }
41
- # then
42
- # printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
43
- # gem install bundler
44
- # fi
45
- # if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
46
- # then
47
- # bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
48
- # fi
@@ -1,3 +0,0 @@
1
- module HydraPbcore
2
- VERSION = "1.1.3"
3
- end