active-fedora 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/active-fedora.gemspec +4 -4
- data/lib/active_fedora/base.rb +2 -1
- data/spec/unit/base_extra_spec.rb +4 -1
- data/spec/unit/base_spec.rb +6 -3
- metadata +6 -6
data/History.txt
CHANGED
data/Rakefile
CHANGED
@@ -21,7 +21,7 @@ begin
|
|
21
21
|
gem.add_dependency('mime-types', '>= 1.16')
|
22
22
|
gem.add_dependency('multipart-post')
|
23
23
|
gem.add_dependency('nokogiri')
|
24
|
-
gem.add_dependency('om', '>= 0.1.
|
24
|
+
gem.add_dependency('om', '>= 0.1.5')
|
25
25
|
# gem.add_dependency('yaml')
|
26
26
|
|
27
27
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.8
|
data/active-fedora.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{active-fedora}
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matt Zumwalt", "McClain Looney"]
|
@@ -343,7 +343,7 @@ Gem::Specification.new do |s|
|
|
343
343
|
s.add_runtime_dependency(%q<mime-types>, [">= 1.16"])
|
344
344
|
s.add_runtime_dependency(%q<multipart-post>, [">= 0"])
|
345
345
|
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
346
|
-
s.add_runtime_dependency(%q<om>, [">= 0.1.
|
346
|
+
s.add_runtime_dependency(%q<om>, [">= 0.1.5"])
|
347
347
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
348
348
|
s.add_development_dependency(%q<mocha>, [">= 1.2.9"])
|
349
349
|
s.add_development_dependency(%q<ruby-debug>, [">= 0"])
|
@@ -353,7 +353,7 @@ Gem::Specification.new do |s|
|
|
353
353
|
s.add_dependency(%q<mime-types>, [">= 1.16"])
|
354
354
|
s.add_dependency(%q<multipart-post>, [">= 0"])
|
355
355
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
356
|
-
s.add_dependency(%q<om>, [">= 0.1.
|
356
|
+
s.add_dependency(%q<om>, [">= 0.1.5"])
|
357
357
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
358
358
|
s.add_dependency(%q<mocha>, [">= 1.2.9"])
|
359
359
|
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
@@ -364,7 +364,7 @@ Gem::Specification.new do |s|
|
|
364
364
|
s.add_dependency(%q<mime-types>, [">= 1.16"])
|
365
365
|
s.add_dependency(%q<multipart-post>, [">= 0"])
|
366
366
|
s.add_dependency(%q<nokogiri>, [">= 0"])
|
367
|
-
s.add_dependency(%q<om>, [">= 0.1.
|
367
|
+
s.add_dependency(%q<om>, [">= 0.1.5"])
|
368
368
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
369
369
|
s.add_dependency(%q<mocha>, [">= 1.2.9"])
|
370
370
|
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
data/lib/active_fedora/base.rb
CHANGED
@@ -410,7 +410,8 @@ module ActiveFedora
|
|
410
410
|
solr_doc << {SOLR_DOCUMENT_ID.to_sym => pid, solr_name(:system_create, :date) => self.create_date, solr_name(:system_modified, :date) => self.modified_date, solr_name(:active_fedora_model, :symbol) => self.class.inspect}
|
411
411
|
end
|
412
412
|
datastreams.each_value do |ds|
|
413
|
-
solr_doc = ds.to_solr(solr_doc) if ds.kind_of?(ActiveFedora::
|
413
|
+
# solr_doc = ds.to_solr(solr_doc) if ds.class.included_modules.include?(ActiveFedora::MetadataDatastreamHelper) ||( ds.kind_of?(ActiveFedora::RelsExtDatastream) || ( ds.kind_of?(ActiveFedora::QualifiedDublinCoreDatastream) && !opts[:model_only] )
|
414
|
+
solr_doc = ds.to_solr(solr_doc) if ds.kind_of?(ActiveFedora::MetadataDatastream) || ds.kind_of?(ActiveFedora::NokogiriDatastream) || ( ds.kind_of?(ActiveFedora::RelsExtDatastream) && !opts[:model_only] )
|
414
415
|
end
|
415
416
|
return solr_doc
|
416
417
|
end
|
@@ -66,12 +66,15 @@ describe ActiveFedora::Base do
|
|
66
66
|
mock1 = mock("ds1", :to_solr)
|
67
67
|
mock2 = mock("ds2", :to_solr)
|
68
68
|
mock3 = mock("RELS-EXT", :to_solr)
|
69
|
+
|
70
|
+
mock_datastreams = {:ds1 => mock1, :ds2 => mock2, :rels_ext => mock3}
|
71
|
+
mock_datastreams.values.each {|ds| ds.stubs(:kind_of?).with(ActiveFedora::NokogiriDatastream).returns(false)}
|
69
72
|
mock1.expects(:kind_of?).with(ActiveFedora::MetadataDatastream).returns(true)
|
70
73
|
mock2.expects(:kind_of?).with(ActiveFedora::MetadataDatastream).returns(true)
|
71
74
|
mock3.expects(:kind_of?).with(ActiveFedora::MetadataDatastream).returns(false)
|
72
75
|
mock3.expects(:kind_of?).with(ActiveFedora::RelsExtDatastream).returns(true)
|
73
76
|
|
74
|
-
@test_object.expects(:datastreams).returns(
|
77
|
+
@test_object.expects(:datastreams).returns(mock_datastreams)
|
75
78
|
@test_object.update_index
|
76
79
|
end
|
77
80
|
|
data/spec/unit/base_spec.rb
CHANGED
@@ -355,13 +355,16 @@ describe ActiveFedora::Base do
|
|
355
355
|
solr_doc[:active_fedora_model_field].should eql(@test_object.class.inspect)
|
356
356
|
end
|
357
357
|
|
358
|
-
it "should call .to_solr on all MetadataDatastreams and
|
358
|
+
it "should call .to_solr on all MetadataDatastreams and NokogiriDatastreams, passing the resulting document to solr" do
|
359
359
|
mock1 = mock("ds1", :to_solr)
|
360
360
|
mock2 = mock("ds2", :to_solr)
|
361
|
+
ngds = mock("ngds", :to_solr)
|
361
362
|
mock1.expects(:kind_of?).with(ActiveFedora::MetadataDatastream).returns(true)
|
362
363
|
mock2.expects(:kind_of?).with(ActiveFedora::MetadataDatastream).returns(true)
|
363
|
-
|
364
|
-
|
364
|
+
ngds.expects(:kind_of?).with(ActiveFedora::MetadataDatastream).returns(false)
|
365
|
+
ngds.expects(:kind_of?).with(ActiveFedora::NokogiriDatastream).returns(true)
|
366
|
+
|
367
|
+
@test_object.expects(:datastreams).returns({:ds1 => mock1, :ds2 => mock2, :ngds => ngds})
|
365
368
|
@test_object.to_solr
|
366
369
|
end
|
367
370
|
it "should call .to_solr on the RELS-EXT datastream if it is dirty" do
|
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:
|
4
|
+
hash: 3
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 1.1.
|
9
|
+
- 8
|
10
|
+
version: 1.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Zumwalt
|
@@ -102,12 +102,12 @@ dependencies:
|
|
102
102
|
requirements:
|
103
103
|
- - ">="
|
104
104
|
- !ruby/object:Gem::Version
|
105
|
-
hash:
|
105
|
+
hash: 17
|
106
106
|
segments:
|
107
107
|
- 0
|
108
108
|
- 1
|
109
|
-
-
|
110
|
-
version: 0.1.
|
109
|
+
- 5
|
110
|
+
version: 0.1.5
|
111
111
|
type: :runtime
|
112
112
|
version_requirements: *id006
|
113
113
|
- !ruby/object:Gem::Dependency
|