active-fedora 2.3.3 → 2.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -187,6 +187,11 @@ describe ActiveFedora::Base do
187
187
  @test_object.add_relationship(:has_part,@test_object3)
188
188
  @test_object.relationships.should == {:self=>{:has_part=>[r.object]}}
189
189
  end
190
+
191
+ it 'should add literal relationships if requested' do
192
+ @test_object.add_relationship(:conforms_to,"AnInterface",true)
193
+ @test_object.relationships[:self][:conforms_to].should == ["AnInterface"]
194
+ end
190
195
  end
191
196
 
192
197
  it 'should provide #remove_relationship' do
@@ -366,6 +366,13 @@ describe ActiveFedora::NokogiriDatastream do
366
366
  term_pointer = [:name,:role,:roleTerm]
367
367
  @mods_ds.update_values([{":person"=>"0"}, "role", "text"]=>{"0"=>"role1", "1"=>"role2", "2"=>"role3"})
368
368
  end
369
+
370
+ it "should set @dirty to true" do
371
+ mods_ds = Hydra::ModsArticleDatastream.new(:blob=>fixture(File.join("mods_articles","hydrangea_article1.xml")))
372
+ mods_ds.dirty?.should be_false
373
+ mods_ds.update_values([{":person"=>"0"}, "role", "text"]=>{"0"=>"role1", "1"=>"role2", "2"=>"role3"})
374
+ mods_ds.dirty?.should be_true
375
+ end
369
376
  end
370
377
 
371
378
  describe '.term_values' do
@@ -3,6 +3,7 @@ require File.join( File.dirname(__FILE__), "../spec_helper" )
3
3
  require 'active_fedora'
4
4
  require "rexml/document"
5
5
  require 'mocha'
6
+ require 'uri'
6
7
 
7
8
  include Mocha::API
8
9
 
@@ -24,6 +25,7 @@ describe ActiveFedora::Relationship do
24
25
  /%
25
26
  before(:each) do
26
27
  @test_relationship = ActiveFedora::Relationship.new
28
+ @test_literal = ActiveFedora::Relationship.new(:is_literal=>true)
27
29
  end
28
30
 
29
31
  it "should provide #new" do
@@ -36,6 +38,9 @@ describe ActiveFedora::Relationship do
36
38
  test_relationship.subject.should == "info:fedora/demo:5"
37
39
  test_relationship.predicate.should == "isMemberOf"
38
40
  test_relationship.object.should == "info:fedora/demo:10"
41
+ test_relationship.is_literal.should == false
42
+ test_literal = ActiveFedora::Relationship.new(:is_literal=>true)
43
+ test_literal.is_literal.should == true
39
44
  end
40
45
 
41
46
  describe "#subject=" do
@@ -61,7 +66,16 @@ describe ActiveFedora::Relationship do
61
66
  mock_fedora_object = stub("mock_fedora_object", :pid => "demo:stub_pid")
62
67
  @test_relationship.object = mock_fedora_object
63
68
  @test_relationship.object.should == "info:fedora/#{mock_fedora_object.pid}"
64
- end end
69
+ end
70
+ it "should let URI objects stringify themselves" do
71
+ @test_relationship.object = URI.parse("http://projecthydra.org")
72
+ @test_relationship.object.should == "http://projecthydra.org"
73
+ end
74
+ it "should not turn literal property objects into Fedora URIs" do
75
+ @test_literal.object = "foo"
76
+ @test_literal.object.should == "foo"
77
+ end
78
+ end
65
79
 
66
80
  describe "#predicate=" do
67
81
  it "should default to setting the argument itself as the new subject" do
@@ -12,6 +12,7 @@ describe ActiveFedora::RelsExtDatastream do
12
12
  @test_relationship1 = ActiveFedora::Relationship.new(:subject => :self, :predicate => :is_member_of, :object => "demo:10")
13
13
  @test_relationship2 = ActiveFedora::Relationship.new(:subject => :self, :predicate => :is_part_of, :object => "demo:11")
14
14
  @test_relationship3 = ActiveFedora::Relationship.new(:subject => @pid, :predicate => :has_part, :object => "demo:12")
15
+ @test_relationship4 = ActiveFedora::Relationship.new(:subject => @pid, :predicate => :conforms_to, :object => "AnInterface", :is_literal=>true)
15
16
 
16
17
  @sample_xml = Nokogiri::XML::Document.parse(@sample_xml_string)
17
18
  end
@@ -25,7 +26,7 @@ describe ActiveFedora::RelsExtDatastream do
25
26
  end
26
27
 
27
28
  describe "#new" do
28
- it "should create a datsatream with DSID of RELS-EXT" do
29
+ it "should create a datastream with DSID of RELS-EXT" do
29
30
  test_datastream = ActiveFedora::RelsExtDatastream.new
30
31
  test_datastream.dsid.should eql("RELS-EXT")
31
32
  end
@@ -59,13 +60,14 @@ describe ActiveFedora::RelsExtDatastream do
59
60
  @test_obj = ActiveFedora::Base.new
60
61
  @test_obj.add_relationship(:is_member_of, "demo:10")
61
62
  @test_obj.add_relationship(:is_part_of, "demo:11")
63
+ @test_obj.add_relationship(:conforms_to, "AnInterface", true)
62
64
  @test_obj.save
63
65
  end
64
66
  after(:all) do
65
67
  @test_obj.delete
66
68
  end
67
69
  it "should load RELS-EXT relationships into relationships hash" do
68
- @test_obj.relationships.should == {:self=>{:is_member_of=>["info:fedora/demo:10"], :is_part_of=>["info:fedora/demo:11"], :has_model=>["info:fedora/afmodel:ActiveFedora_Base"]}}
70
+ @test_obj.relationships.should == {:self=>{:is_member_of=>["info:fedora/demo:10"], :is_part_of=>["info:fedora/demo:11"], :has_model=>["info:fedora/afmodel:ActiveFedora_Base"], :conforms_to=>["AnInterface"]}}
69
71
  doc = Nokogiri::XML::Document.parse(@test_obj.inner_object.object_xml)
70
72
  el = doc.xpath("/foxml:digitalObject//foxml:datastream[@ID='RELS-EXT']").first
71
73
  new_ds = ActiveFedora::RelsExtDatastream.new
@@ -74,10 +76,10 @@ describe ActiveFedora::RelsExtDatastream do
74
76
  new_ds.relationships.should == @test_obj.relationships
75
77
  end
76
78
  it "should handle un-mapped predicates gracefully" do
77
- @test_obj.relationships.should == {:self=>{:is_member_of=>["info:fedora/demo:10"], :is_part_of=>["info:fedora/demo:11"], :has_model=>["info:fedora/afmodel:ActiveFedora_Base"]}}
79
+ @test_obj.relationships.should == {:self=>{:is_member_of=>["info:fedora/demo:10"], :is_part_of=>["info:fedora/demo:11"], :has_model=>["info:fedora/afmodel:ActiveFedora_Base"], :conforms_to=>["AnInterface"]}}
78
80
  @test_obj.add_relationship("foo", "foo:bar")
79
81
  @test_obj.save
80
- @test_obj.relationships.should == {:self=>{:is_part_of=>["info:fedora/demo:11"], "foo"=>["info:fedora/foo:bar"], :has_model=>["info:fedora/afmodel:ActiveFedora_Base"], :is_member_of=>["info:fedora/demo:10"]}}
82
+ @test_obj.relationships.should == {:self=>{:is_part_of=>["info:fedora/demo:11"], "foo"=>["info:fedora/foo:bar"], :has_model=>["info:fedora/afmodel:ActiveFedora_Base"], :is_member_of=>["info:fedora/demo:10"], :conforms_to=>["AnInterface"]}}
81
83
  end
82
84
  end
83
85
 
@@ -93,10 +95,12 @@ describe ActiveFedora::RelsExtDatastream do
93
95
  @test_ds.add_relationship(@test_relationship1)
94
96
  @test_ds.add_relationship(@test_relationship2)
95
97
  @test_ds.add_relationship(@test_relationship3)
98
+ @test_ds.add_relationship(@test_relationship4)
96
99
  solr_doc = @test_ds.to_solr
97
100
  solr_doc["is_member_of_s"].should == ["info:fedora/demo:10"]
98
101
  solr_doc["is_part_of_s"].should == ["info:fedora/demo:11"]
99
102
  solr_doc["has_part_s"].should == ["info:fedora/demo:12"]
103
+ solr_doc["conforms_to_s"].should == ["AnInterface"]
100
104
  end
101
105
  end
102
106
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active-fedora
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 3
9
- - 3
10
- version: 2.3.3
9
+ - 4
10
+ version: 2.3.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matt Zumwalt
@@ -16,13 +16,11 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-07-19 00:00:00 -04:00
19
+ date: 2011-08-29 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
- name: solr-ruby
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
23
+ version_requirements: &id001 !ruby/object:Gem::Requirement
26
24
  none: false
27
25
  requirements:
28
26
  - - ">="
@@ -33,12 +31,12 @@ dependencies:
33
31
  - 0
34
32
  - 6
35
33
  version: 0.0.6
34
+ prerelease: false
35
+ name: solr-ruby
36
36
  type: :runtime
37
- version_requirements: *id001
37
+ requirement: *id001
38
38
  - !ruby/object:Gem::Dependency
39
- name: xml-simple
40
- prerelease: false
41
- requirement: &id002 !ruby/object:Gem::Requirement
39
+ version_requirements: &id002 !ruby/object:Gem::Requirement
42
40
  none: false
43
41
  requirements:
44
42
  - - ">="
@@ -49,12 +47,12 @@ dependencies:
49
47
  - 0
50
48
  - 12
51
49
  version: 1.0.12
50
+ prerelease: false
51
+ name: xml-simple
52
52
  type: :runtime
53
- version_requirements: *id002
53
+ requirement: *id002
54
54
  - !ruby/object:Gem::Dependency
55
- name: mime-types
56
- prerelease: false
57
- requirement: &id003 !ruby/object:Gem::Requirement
55
+ version_requirements: &id003 !ruby/object:Gem::Requirement
58
56
  none: false
59
57
  requirements:
60
58
  - - ">="
@@ -64,26 +62,28 @@ dependencies:
64
62
  - 1
65
63
  - 16
66
64
  version: "1.16"
65
+ prerelease: false
66
+ name: mime-types
67
67
  type: :runtime
68
- version_requirements: *id003
68
+ requirement: *id003
69
69
  - !ruby/object:Gem::Dependency
70
- name: multipart-post
71
- prerelease: false
72
- requirement: &id004 !ruby/object:Gem::Requirement
70
+ version_requirements: &id004 !ruby/object:Gem::Requirement
73
71
  none: false
74
72
  requirements:
75
- - - ">="
73
+ - - "="
76
74
  - !ruby/object:Gem::Version
77
- hash: 3
75
+ hash: 23
78
76
  segments:
79
- - 0
80
- version: "0"
77
+ - 1
78
+ - 1
79
+ - 2
80
+ version: 1.1.2
81
+ prerelease: false
82
+ name: multipart-post
81
83
  type: :runtime
82
- version_requirements: *id004
84
+ requirement: *id004
83
85
  - !ruby/object:Gem::Dependency
84
- name: nokogiri
85
- prerelease: false
86
- requirement: &id005 !ruby/object:Gem::Requirement
86
+ version_requirements: &id005 !ruby/object:Gem::Requirement
87
87
  none: false
88
88
  requirements:
89
89
  - - ">="
@@ -92,12 +92,12 @@ dependencies:
92
92
  segments:
93
93
  - 0
94
94
  version: "0"
95
+ prerelease: false
96
+ name: nokogiri
95
97
  type: :runtime
96
- version_requirements: *id005
98
+ requirement: *id005
97
99
  - !ruby/object:Gem::Dependency
98
- name: om
99
- prerelease: false
100
- requirement: &id006 !ruby/object:Gem::Requirement
100
+ version_requirements: &id006 !ruby/object:Gem::Requirement
101
101
  none: false
102
102
  requirements:
103
103
  - - ">="
@@ -107,12 +107,12 @@ dependencies:
107
107
  - 1
108
108
  - 0
109
109
  version: "1.0"
110
+ prerelease: false
111
+ name: om
110
112
  type: :runtime
111
- version_requirements: *id006
113
+ requirement: *id006
112
114
  - !ruby/object:Gem::Dependency
113
- name: solrizer
114
- prerelease: false
115
- requirement: &id007 !ruby/object:Gem::Requirement
115
+ version_requirements: &id007 !ruby/object:Gem::Requirement
116
116
  none: false
117
117
  requirements:
118
118
  - - ">"
@@ -123,12 +123,12 @@ dependencies:
123
123
  - 0
124
124
  - 0
125
125
  version: 1.0.0
126
+ prerelease: false
127
+ name: solrizer
126
128
  type: :runtime
127
- version_requirements: *id007
129
+ requirement: *id007
128
130
  - !ruby/object:Gem::Dependency
129
- name: activeresource
130
- prerelease: false
131
- requirement: &id008 !ruby/object:Gem::Requirement
131
+ version_requirements: &id008 !ruby/object:Gem::Requirement
132
132
  none: false
133
133
  requirements:
134
134
  - - ">="
@@ -137,12 +137,12 @@ dependencies:
137
137
  segments:
138
138
  - 0
139
139
  version: "0"
140
+ prerelease: false
141
+ name: activeresource
140
142
  type: :runtime
141
- version_requirements: *id008
143
+ requirement: *id008
142
144
  - !ruby/object:Gem::Dependency
143
- name: mediashelf-loggable
144
- prerelease: false
145
- requirement: &id009 !ruby/object:Gem::Requirement
145
+ version_requirements: &id009 !ruby/object:Gem::Requirement
146
146
  none: false
147
147
  requirements:
148
148
  - - ">="
@@ -151,12 +151,12 @@ dependencies:
151
151
  segments:
152
152
  - 0
153
153
  version: "0"
154
+ prerelease: false
155
+ name: mediashelf-loggable
154
156
  type: :runtime
155
- version_requirements: *id009
157
+ requirement: *id009
156
158
  - !ruby/object:Gem::Dependency
157
- name: equivalent-xml
158
- prerelease: false
159
- requirement: &id010 !ruby/object:Gem::Requirement
159
+ version_requirements: &id010 !ruby/object:Gem::Requirement
160
160
  none: false
161
161
  requirements:
162
162
  - - ">="
@@ -165,12 +165,12 @@ dependencies:
165
165
  segments:
166
166
  - 0
167
167
  version: "0"
168
+ prerelease: false
169
+ name: equivalent-xml
168
170
  type: :runtime
169
- version_requirements: *id010
171
+ requirement: *id010
170
172
  - !ruby/object:Gem::Dependency
171
- name: facets
172
- prerelease: false
173
- requirement: &id011 !ruby/object:Gem::Requirement
173
+ version_requirements: &id011 !ruby/object:Gem::Requirement
174
174
  none: false
175
175
  requirements:
176
176
  - - ">="
@@ -179,12 +179,12 @@ dependencies:
179
179
  segments:
180
180
  - 0
181
181
  version: "0"
182
+ prerelease: false
183
+ name: facets
182
184
  type: :runtime
183
- version_requirements: *id011
185
+ requirement: *id011
184
186
  - !ruby/object:Gem::Dependency
185
- name: yard
186
- prerelease: false
187
- requirement: &id012 !ruby/object:Gem::Requirement
187
+ version_requirements: &id012 !ruby/object:Gem::Requirement
188
188
  none: false
189
189
  requirements:
190
190
  - - ">="
@@ -193,12 +193,12 @@ dependencies:
193
193
  segments:
194
194
  - 0
195
195
  version: "0"
196
+ prerelease: false
197
+ name: yard
196
198
  type: :development
197
- version_requirements: *id012
199
+ requirement: *id012
198
200
  - !ruby/object:Gem::Dependency
199
- name: RedCloth
200
- prerelease: false
201
- requirement: &id013 !ruby/object:Gem::Requirement
201
+ version_requirements: &id013 !ruby/object:Gem::Requirement
202
202
  none: false
203
203
  requirements:
204
204
  - - ">="
@@ -207,12 +207,12 @@ dependencies:
207
207
  segments:
208
208
  - 0
209
209
  version: "0"
210
+ prerelease: false
211
+ name: RedCloth
210
212
  type: :development
211
- version_requirements: *id013
213
+ requirement: *id013
212
214
  - !ruby/object:Gem::Dependency
213
- name: rcov
214
- prerelease: false
215
- requirement: &id014 !ruby/object:Gem::Requirement
215
+ version_requirements: &id014 !ruby/object:Gem::Requirement
216
216
  none: false
217
217
  requirements:
218
218
  - - ">="
@@ -221,12 +221,12 @@ dependencies:
221
221
  segments:
222
222
  - 0
223
223
  version: "0"
224
+ prerelease: false
225
+ name: rake
224
226
  type: :development
225
- version_requirements: *id014
227
+ requirement: *id014
226
228
  - !ruby/object:Gem::Dependency
227
- name: solrizer
228
- prerelease: false
229
- requirement: &id015 !ruby/object:Gem::Requirement
229
+ version_requirements: &id015 !ruby/object:Gem::Requirement
230
230
  none: false
231
231
  requirements:
232
232
  - - ">="
@@ -235,12 +235,12 @@ dependencies:
235
235
  segments:
236
236
  - 0
237
237
  version: "0"
238
+ prerelease: false
239
+ name: rcov
238
240
  type: :development
239
- version_requirements: *id015
241
+ requirement: *id015
240
242
  - !ruby/object:Gem::Dependency
241
- name: solrizer-fedora
242
- prerelease: false
243
- requirement: &id016 !ruby/object:Gem::Requirement
243
+ version_requirements: &id016 !ruby/object:Gem::Requirement
244
244
  none: false
245
245
  requirements:
246
246
  - - ">="
@@ -249,12 +249,58 @@ dependencies:
249
249
  segments:
250
250
  - 0
251
251
  version: "0"
252
+ prerelease: false
253
+ name: solrizer-fedora
252
254
  type: :development
253
- version_requirements: *id016
255
+ requirement: *id016
254
256
  - !ruby/object:Gem::Dependency
257
+ version_requirements: &id017 !ruby/object:Gem::Requirement
258
+ none: false
259
+ requirements:
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ hash: 3
263
+ segments:
264
+ - 0
265
+ version: "0"
266
+ prerelease: false
255
267
  name: jettywrapper
268
+ type: :development
269
+ requirement: *id017
270
+ - !ruby/object:Gem::Dependency
271
+ version_requirements: &id018 !ruby/object:Gem::Requirement
272
+ none: false
273
+ requirements:
274
+ - - <
275
+ - !ruby/object:Gem::Version
276
+ hash: 15
277
+ segments:
278
+ - 2
279
+ - 0
280
+ - 0
281
+ version: 2.0.0
256
282
  prerelease: false
257
- requirement: &id017 !ruby/object:Gem::Requirement
283
+ name: rspec
284
+ type: :development
285
+ requirement: *id018
286
+ - !ruby/object:Gem::Dependency
287
+ version_requirements: &id019 !ruby/object:Gem::Requirement
288
+ none: false
289
+ requirements:
290
+ - - ">="
291
+ - !ruby/object:Gem::Version
292
+ hash: 43
293
+ segments:
294
+ - 0
295
+ - 9
296
+ - 8
297
+ version: 0.9.8
298
+ prerelease: false
299
+ name: mocha
300
+ type: :development
301
+ requirement: *id019
302
+ - !ruby/object:Gem::Dependency
303
+ version_requirements: &id020 !ruby/object:Gem::Requirement
258
304
  none: false
259
305
  requirements:
260
306
  - - ">="
@@ -263,8 +309,10 @@ dependencies:
263
309
  segments:
264
310
  - 0
265
311
  version: "0"
312
+ prerelease: false
313
+ name: ruby-debug
266
314
  type: :development
267
- version_requirements: *id017
315
+ requirement: *id020
268
316
  description: ActiveFedora provides for creating and managing objects in the Fedora Repository Architecture.
269
317
  email:
270
318
  - matt.zumwalt@yourmediashelf.com
@@ -450,6 +498,7 @@ files:
450
498
  - config/solr_mappings_bl_2.4.yml
451
499
  - lib/active-fedora.rb
452
500
  - lib/active_fedora.rb
501
+ - lib/active_fedora/active_fedora_configuration_exception.rb
453
502
  - lib/active_fedora/base.rb
454
503
  - lib/active_fedora/content_model.rb
455
504
  - lib/active_fedora/datastream.rb
@@ -497,8 +546,10 @@ files:
497
546
  - spec/fixtures/minivan.jpg
498
547
  - spec/fixtures/mods_articles/hydrangea_article1.xml
499
548
  - spec/fixtures/oh_qdc.xml
549
+ - spec/fixtures/rails_root/config/fake_fedora.yml
500
550
  - spec/fixtures/rails_root/config/fedora.yml
501
551
  - spec/fixtures/rails_root/config/predicate_mappings.yml
552
+ - spec/fixtures/rails_root/config/solr.yml
502
553
  - spec/fixtures/rails_root/config/solr_mappings.yml
503
554
  - spec/fixtures/rails_root/config/solr_mappings_af_0.1.yml
504
555
  - spec/fixtures/rails_root/config/solr_mappings_bl_2.4.yml
@@ -618,7 +669,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
618
669
  requirements: []
619
670
 
620
671
  rubyforge_project: rubyfedora
621
- rubygems_version: 1.6.2
672
+ rubygems_version: 1.5.2
622
673
  signing_key:
623
674
  specification_version: 3
624
675
  summary: A convenience libary for manipulating MODS (Metadata Object Description Schema) documents.
@@ -630,8 +681,10 @@ test_files:
630
681
  - spec/fixtures/minivan.jpg
631
682
  - spec/fixtures/mods_articles/hydrangea_article1.xml
632
683
  - spec/fixtures/oh_qdc.xml
684
+ - spec/fixtures/rails_root/config/fake_fedora.yml
633
685
  - spec/fixtures/rails_root/config/fedora.yml
634
686
  - spec/fixtures/rails_root/config/predicate_mappings.yml
687
+ - spec/fixtures/rails_root/config/solr.yml
635
688
  - spec/fixtures/rails_root/config/solr_mappings.yml
636
689
  - spec/fixtures/rails_root/config/solr_mappings_af_0.1.yml
637
690
  - spec/fixtures/rails_root/config/solr_mappings_bl_2.4.yml