active-fedora 3.3.1 → 3.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +11 -11
- data/History.txt +10 -0
- data/active-fedora.gemspec +1 -1
- data/lib/active_fedora/content_model.rb +1 -1
- data/lib/active_fedora/datastreams.rb +12 -3
- data/lib/active_fedora/model.rb +3 -12
- data/lib/active_fedora/relationship_graph.rb +1 -1
- data/lib/active_fedora/version.rb +1 -1
- data/lib/tasks/active_fedora_dev.rake +1 -0
- data/spec/integration/base_spec.rb +1 -1
- data/spec/integration/model_spec.rb +3 -2
- data/spec/unit/content_model_spec.rb +4 -1
- data/spec/unit/datastreams_spec.rb +66 -30
- data/spec/unit/model_spec.rb +23 -17
- data/spec/unit/relationship_graph_spec.rb +12 -1
- data/spec/unit/solr_config_options_spec.rb +0 -10
- metadata +50 -50
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
active-fedora (3.3.
|
4
|
+
active-fedora (3.3.2)
|
5
5
|
activeresource (>= 3.0.0)
|
6
6
|
activesupport (>= 3.0.0)
|
7
7
|
equivalent-xml
|
@@ -12,7 +12,7 @@ PATH
|
|
12
12
|
om (>= 1.5.1)
|
13
13
|
rdf
|
14
14
|
rdf-rdfxml
|
15
|
-
rubydora (~> 0.5.
|
15
|
+
rubydora (~> 0.5.3)
|
16
16
|
solr-ruby (>= 0.0.6)
|
17
17
|
solrizer (~> 1.2.0)
|
18
18
|
xml-simple (>= 1.0.12)
|
@@ -30,7 +30,7 @@ GEM
|
|
30
30
|
activesupport (3.2.1)
|
31
31
|
i18n (~> 0.6)
|
32
32
|
multi_json (~> 1.0)
|
33
|
-
addressable (2.2.
|
33
|
+
addressable (2.2.7)
|
34
34
|
akami (1.0.0)
|
35
35
|
gyoku (>= 0.4.0)
|
36
36
|
builder (3.0.0)
|
@@ -44,7 +44,7 @@ GEM
|
|
44
44
|
ffi (1.0.11)
|
45
45
|
gyoku (0.4.4)
|
46
46
|
builder (>= 2.1.2)
|
47
|
-
httpi (0.9.
|
47
|
+
httpi (0.9.6)
|
48
48
|
rack
|
49
49
|
i18n (0.6.0)
|
50
50
|
jettywrapper (1.2.1)
|
@@ -62,13 +62,13 @@ GEM
|
|
62
62
|
multi_json (1.0.4)
|
63
63
|
multipart-post (1.1.2)
|
64
64
|
nokogiri (1.5.0)
|
65
|
-
nori (1.0
|
65
|
+
nori (1.1.0)
|
66
66
|
om (1.5.1)
|
67
67
|
mediashelf-loggable
|
68
68
|
nokogiri (>= 1.4.2)
|
69
69
|
rack (1.4.1)
|
70
70
|
rake (0.9.2.2)
|
71
|
-
rdf (0.3.
|
71
|
+
rdf (0.3.5)
|
72
72
|
addressable (>= 2.2.6)
|
73
73
|
rdf-rdfxml (0.3.5)
|
74
74
|
nokogiri (>= 1.4.4)
|
@@ -85,7 +85,7 @@ GEM
|
|
85
85
|
rspec-expectations (2.8.0)
|
86
86
|
diff-lcs (~> 1.1.2)
|
87
87
|
rspec-mocks (2.8.0)
|
88
|
-
rubydora (0.5.
|
88
|
+
rubydora (0.5.3)
|
89
89
|
activemodel
|
90
90
|
activesupport
|
91
91
|
fastercsv
|
@@ -93,14 +93,14 @@ GEM
|
|
93
93
|
nokogiri
|
94
94
|
rest-client
|
95
95
|
savon
|
96
|
-
savon (0.9.
|
96
|
+
savon (0.9.9)
|
97
97
|
akami (~> 1.0)
|
98
98
|
builder (>= 2.1.2)
|
99
99
|
gyoku (>= 0.4.0)
|
100
100
|
httpi (~> 0.9)
|
101
101
|
nokogiri (>= 1.4.0)
|
102
|
-
nori (~> 1.
|
103
|
-
wasabi (~> 2.
|
102
|
+
nori (~> 1.1)
|
103
|
+
wasabi (~> 2.1)
|
104
104
|
solr-ruby (0.0.8)
|
105
105
|
solrizer (1.2.0)
|
106
106
|
daemons
|
@@ -118,7 +118,7 @@ GEM
|
|
118
118
|
solr-ruby (>= 0.0.6)
|
119
119
|
solrizer (>= 1.0.0)
|
120
120
|
stomp (1.2.0)
|
121
|
-
wasabi (2.
|
121
|
+
wasabi (2.1.0)
|
122
122
|
nokogiri (>= 1.4.0)
|
123
123
|
xml-simple (1.1.1)
|
124
124
|
yard (0.7.4)
|
data/History.txt
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
3.3.2
|
2
|
+
HYDRA-745 No need to require :url be present on external datastreams
|
3
|
+
Initialize relationships graph to empty array
|
4
|
+
HYDRA-668 ActiveFedora models do not need to be immediate descendants of ActiveFedora::Base
|
5
|
+
Fix for camel cased classes in classname from uri
|
6
|
+
HYDRA-746 Speed up find() by not hitting solr first
|
7
|
+
Added description for active_fedora:load_fixtures task
|
8
|
+
HYDRA-748 Allow setting versionable via has_metadata
|
9
|
+
|
10
|
+
|
1
11
|
3.3.1
|
2
12
|
Allow explicit setting of predicate config.
|
3
13
|
Check for appropriate content before saving a datastream
|
data/active-fedora.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
|
|
26
26
|
s.add_dependency("activesupport", '>= 3.0.0')
|
27
27
|
s.add_dependency("mediashelf-loggable")
|
28
28
|
s.add_dependency("equivalent-xml")
|
29
|
-
s.add_dependency("rubydora", '~>0.5.
|
29
|
+
s.add_dependency("rubydora", '~>0.5.3')
|
30
30
|
s.add_dependency("rdf")
|
31
31
|
s.add_dependency("rdf-rdfxml")
|
32
32
|
s.add_development_dependency("yard")
|
@@ -53,7 +53,7 @@ module ActiveFedora
|
|
53
53
|
# Returns false if no corresponding model can be found.
|
54
54
|
def self.uri_to_model_class( uri )
|
55
55
|
rc = Model.from_class_uri(uri)
|
56
|
-
if rc && rc.superclass == ActiveFedora::Base
|
56
|
+
if rc && (rc.superclass == ActiveFedora::Base || rc.ancestors.include?(ActiveFedora::Base))
|
57
57
|
rc
|
58
58
|
else
|
59
59
|
false
|
@@ -78,6 +78,7 @@ module ActiveFedora
|
|
78
78
|
ds = ds_spec[:type].new(inner_object, name)
|
79
79
|
ds.dsLabel = ds_spec[:label] if ds_spec[:label].present?
|
80
80
|
ds.controlGroup = ds_spec[:control_group]
|
81
|
+
ds.versionable = ds_spec[:versionable]
|
81
82
|
additional_attributes_for_external_and_redirect_control_groups(ds, ds_spec)
|
82
83
|
ds
|
83
84
|
end
|
@@ -226,12 +227,10 @@ module ActiveFedora
|
|
226
227
|
# @param [Object] ds_config hash of options which may contain :disseminator and :url
|
227
228
|
def additional_attributes_for_external_and_redirect_control_groups(ds,ds_config)
|
228
229
|
if ds.controlGroup=='E'
|
229
|
-
|
230
|
-
if !ds_config[:disseminator] && ds_config[:url].present?
|
230
|
+
if !ds_config[:disseminator].present? && ds_config[:url].present?
|
231
231
|
ds.dsLocation= ds_config[:url]
|
232
232
|
end
|
233
233
|
elsif ds.controlGroup=='R'
|
234
|
-
raise "Must supply a :url if you specify :control_group => 'R'" if (ds_config[:url].empty?)
|
235
234
|
ds.dsLocation= ds_config[:url]
|
236
235
|
end
|
237
236
|
end
|
@@ -242,6 +241,16 @@ module ActiveFedora
|
|
242
241
|
#args must include :name. Note that this method doesn't actually
|
243
242
|
#execute the block, but stores it at the class level, to be executed
|
244
243
|
#by any future instantiations.
|
244
|
+
#
|
245
|
+
# @param [Hash] args
|
246
|
+
# @option args [Class] :type The class that will represent this datastream, should extend ``Datastream''
|
247
|
+
# @option args [String] :name the handle to refer to this datastream as
|
248
|
+
# @option args [String] :label sets the fedora label
|
249
|
+
# @option args [String] :control_group ('X') must be one of 'E', 'X', 'M', 'R'
|
250
|
+
# @option args [String] :disseminator Sets the disseminator location see {#add_disseminator_location_to_datastreams}
|
251
|
+
# @option args [String] :url
|
252
|
+
# @option args [Boolean] :versionable (true) Should versioned datastreams be stored
|
253
|
+
# @yield block executed by some kinds of datastreams
|
245
254
|
def has_metadata(args, &block)
|
246
255
|
ds_specs[args[:name]]= {:type => args[:type], :label => args.fetch(:label,""), :control_group => args.fetch(:control_group,"X"), :disseminator => args.fetch(:disseminator,""), :url => args.fetch(:url,""),:block => block}
|
247
256
|
end
|
data/lib/active_fedora/model.rb
CHANGED
@@ -15,7 +15,7 @@ module ActiveFedora
|
|
15
15
|
def self.classname_from_uri(uri)
|
16
16
|
local_path = uri.split('/')[1]
|
17
17
|
parts = local_path.split(':')
|
18
|
-
return parts[-1].
|
18
|
+
return parts[-1].split(/_/).map(&:classify).join('::'), parts[0]
|
19
19
|
end
|
20
20
|
|
21
21
|
# Takes a Fedora URI for a cModel, and returns a
|
@@ -108,21 +108,12 @@ module ActiveFedora
|
|
108
108
|
return_multiple = true
|
109
109
|
escaped_class_uri = SolrService.escape_uri_for_query(self.to_class_uri)
|
110
110
|
q = "#{ActiveFedora::SolrService.solr_name(:has_model, :symbol)}:#{escaped_class_uri}"
|
111
|
-
elsif args.class == String
|
112
|
-
escaped_id = args.gsub(/(:)/, '\\:')
|
113
|
-
q = "#{SOLR_DOCUMENT_ID}:#{escaped_id}"
|
114
|
-
end
|
115
|
-
if return_multiple == true
|
116
111
|
hits = SolrService.instance.conn.query(q, :rows=>opts[:rows]).hits
|
117
|
-
else
|
118
|
-
hits = SolrService.instance.conn.query(q).hits
|
119
|
-
end
|
120
|
-
if return_multiple
|
121
112
|
return hits.map do |hit|
|
122
113
|
RubydoraConnection.instance.find_model(hit[SOLR_DOCUMENT_ID], self)
|
123
114
|
end
|
124
|
-
|
125
|
-
return RubydoraConnection.instance.find_model(
|
115
|
+
elsif args.class == String
|
116
|
+
return RubydoraConnection.instance.find_model(args, self)
|
126
117
|
end
|
127
118
|
end
|
128
119
|
|
@@ -384,7 +384,7 @@ describe ActiveFedora::Base do
|
|
384
384
|
@test_object.remove_relationship(:has_part,@test_object2)
|
385
385
|
@test_object.save
|
386
386
|
@test_object = ActiveFedora::Base.load_instance(@pid)
|
387
|
-
@test_object.object_relations[:has_part].should
|
387
|
+
@test_object.object_relations[:has_part].should be_empty
|
388
388
|
end
|
389
389
|
end
|
390
390
|
|
@@ -14,13 +14,14 @@ describe ActiveFedora::Model do
|
|
14
14
|
before(:each) do
|
15
15
|
module ModelIntegrationSpec
|
16
16
|
|
17
|
-
class
|
17
|
+
class Base < ActiveFedora::Base
|
18
18
|
include ActiveFedora::Model
|
19
19
|
def self.pid_namespace
|
20
20
|
"foo"
|
21
21
|
end
|
22
22
|
end
|
23
|
-
|
23
|
+
class Basic < Base
|
24
|
+
end
|
24
25
|
end
|
25
26
|
|
26
27
|
@test_instance = ModelIntegrationSpec::Basic.new
|
@@ -9,6 +9,16 @@ describe ActiveFedora::Datastreams do
|
|
9
9
|
ActiveFedora::Base.respond_to?(:has_metadata).should be_true
|
10
10
|
end
|
11
11
|
|
12
|
+
describe "datastream_from_spec" do
|
13
|
+
it "should accept versionable" do
|
14
|
+
ds = @test_object.datastream_from_spec({:type=>ActiveFedora::Datastream, :versionable=>false}, 'test')
|
15
|
+
ds.versionable.should be_false
|
16
|
+
ds = @test_object.datastream_from_spec({:type=>ActiveFedora::Datastream, :versionable=>true}, 'test')
|
17
|
+
ds.versionable.should be_true
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
12
22
|
describe "has_metadata" do
|
13
23
|
@@last_pid = 0
|
14
24
|
def increment_pid
|
@@ -98,19 +108,11 @@ describe ActiveFedora::Datastreams do
|
|
98
108
|
stub_get(@this_pid)
|
99
109
|
stub_add_ds(@this_pid, ['RELS-EXT', 'externalDisseminator', 'externalUrl'])
|
100
110
|
end
|
101
|
-
before :all do
|
102
|
-
class MoreFooHistory < ActiveFedora::Base
|
103
|
-
has_metadata :type=>ActiveFedora::NokogiriDatastream, :name=>"externalDisseminator", :control_group => "E"
|
104
|
-
end
|
105
|
-
end
|
106
111
|
|
107
|
-
after
|
112
|
+
after :each do
|
108
113
|
# clean up test class
|
109
114
|
Object.send(:remove_const, :MoreFooHistory)
|
110
115
|
end
|
111
|
-
it "should raise an error without :disseminator or :url option" do
|
112
|
-
lambda { @n = MoreFooHistory.new }.should raise_exception
|
113
|
-
end
|
114
116
|
|
115
117
|
it "should allow :control_group => 'E' with a :url option" do
|
116
118
|
class MoreFooHistory < ActiveFedora::Base
|
@@ -119,17 +121,38 @@ describe ActiveFedora::Datastreams do
|
|
119
121
|
stub_ingest(@this_pid)
|
120
122
|
@n = MoreFooHistory.new
|
121
123
|
@n.save
|
124
|
+
@n.datastreams['externalDisseminator'].dsLocation.should == "http://exampl.com/mypic.jpg"
|
122
125
|
end
|
123
|
-
|
126
|
+
|
127
|
+
it "should allow :control_group => 'E' without a :url option" do
|
124
128
|
class MoreFooHistory < ActiveFedora::Base
|
125
|
-
has_metadata :type
|
129
|
+
has_metadata :type=>ActiveFedora::MetadataDatastream, :name=>"externalDisseminator",:control_group => "E"
|
126
130
|
end
|
127
|
-
|
128
|
-
|
131
|
+
stub_ingest(@this_pid)
|
132
|
+
@n = MoreFooHistory.new
|
133
|
+
@n.datastreams['externalDisseminator'].dsLocation.present?.should == false
|
134
|
+
@n.save
|
135
|
+
end
|
136
|
+
|
137
|
+
it "should fail validation if a :url is not added before save" do
|
138
|
+
class MoreFooHistory < ActiveFedora::Base
|
139
|
+
has_metadata :type=>ActiveFedora::MetadataDatastream, :name=>"externalDisseminator",:control_group => "E"
|
129
140
|
end
|
130
|
-
|
141
|
+
stub_ingest(@this_pid)
|
131
142
|
@n = MoreFooHistory.new
|
132
|
-
|
143
|
+
@n.datastreams['externalDisseminator'].validate_content_present.should == false
|
144
|
+
@n.save
|
145
|
+
end
|
146
|
+
|
147
|
+
it "should pass validation if a :url is added before save" do
|
148
|
+
class MoreFooHistory < ActiveFedora::Base
|
149
|
+
has_metadata :type=>ActiveFedora::MetadataDatastream, :name=>"externalDisseminator",:control_group => "E"
|
150
|
+
end
|
151
|
+
stub_ingest(@this_pid)
|
152
|
+
@n = MoreFooHistory.new
|
153
|
+
@n.datastreams['externalDisseminator'].dsLocation = "http://exampl.com/mypic.jpg"
|
154
|
+
@n.datastreams['externalDisseminator'].validate_content_present.should == true
|
155
|
+
@n.save
|
133
156
|
end
|
134
157
|
end
|
135
158
|
|
@@ -138,14 +161,12 @@ describe ActiveFedora::Datastreams do
|
|
138
161
|
stub_get(@this_pid)
|
139
162
|
stub_add_ds(@this_pid, ['RELS-EXT', 'externalDisseminator' ])
|
140
163
|
end
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
end
|
145
|
-
lambda { @n = MoreFooHistory.new }.should raise_exception
|
164
|
+
|
165
|
+
after :each do
|
166
|
+
Object.send(:remove_const, :MoreFooHistory)
|
146
167
|
end
|
147
168
|
|
148
|
-
it "should
|
169
|
+
it "should allow :control_group => 'R' with a :url option" do
|
149
170
|
stub_ingest(@this_pid)
|
150
171
|
class MoreFooHistory < ActiveFedora::Base
|
151
172
|
has_metadata :type=>ActiveFedora::MetadataDatastream, :name=>"externalDisseminator",:control_group => "R", :url => "http://exampl.com/mypic.jpg"
|
@@ -153,21 +174,36 @@ describe ActiveFedora::Datastreams do
|
|
153
174
|
@n = MoreFooHistory.new
|
154
175
|
@n.save
|
155
176
|
end
|
156
|
-
|
177
|
+
|
178
|
+
it "should allow :control_group => 'R' without a :url option" do
|
157
179
|
class MoreFooHistory < ActiveFedora::Base
|
158
|
-
has_metadata :type=>ActiveFedora::
|
180
|
+
has_metadata :type=>ActiveFedora::MetadataDatastream, :name=>"externalDisseminator",:control_group => "R"
|
159
181
|
end
|
160
|
-
|
182
|
+
stub_ingest(@this_pid)
|
183
|
+
@n = MoreFooHistory.new
|
184
|
+
@n.datastreams['externalDisseminator'].dsLocation.present?.should == false
|
185
|
+
@n.save
|
161
186
|
end
|
162
|
-
|
187
|
+
|
188
|
+
it "should fail validation if a :url is not added before save" do
|
163
189
|
class MoreFooHistory < ActiveFedora::Base
|
164
|
-
has_metadata :type
|
190
|
+
has_metadata :type=>ActiveFedora::MetadataDatastream, :name=>"externalDisseminator",:control_group => "R"
|
165
191
|
end
|
166
|
-
|
167
|
-
|
192
|
+
stub_ingest(@this_pid)
|
193
|
+
@n = MoreFooHistory.new
|
194
|
+
@n.datastreams['externalDisseminator'].validate_content_present.should == false
|
195
|
+
@n.save
|
196
|
+
end
|
197
|
+
|
198
|
+
it "should pass validation if a :url is added before save" do
|
199
|
+
class MoreFooHistory < ActiveFedora::Base
|
200
|
+
has_metadata :type=>ActiveFedora::MetadataDatastream, :name=>"externalDisseminator",:control_group => "R"
|
168
201
|
end
|
169
|
-
|
170
|
-
|
202
|
+
stub_ingest(@this_pid)
|
203
|
+
@n = MoreFooHistory.new
|
204
|
+
@n.datastreams['externalDisseminator'].dsLocation = "http://exampl.com/mypic.jpg"
|
205
|
+
@n.datastreams['externalDisseminator'].validate_content_present.should == true
|
206
|
+
@n.save
|
171
207
|
end
|
172
208
|
end
|
173
209
|
end
|
data/spec/unit/model_spec.rb
CHANGED
@@ -110,28 +110,11 @@ describe ActiveFedora::Model do
|
|
110
110
|
end
|
111
111
|
|
112
112
|
it "(String) should query solr for an object with the given id and return that object" do
|
113
|
-
mock_solr = mock("SolrConnection")
|
114
|
-
mock_result = mock("MockResult")
|
115
|
-
mock_result.expects(:hits).returns([{"id" => "changeme:30"}])
|
116
|
-
mock_solr.expects(:query).with('id:changeme\:30').returns(mock_result)
|
117
|
-
ActiveFedora::SolrService.expects(:instance).returns(mock("SolrService", :conn => mock_solr))
|
118
113
|
ActiveFedora::RubydoraConnection.instance.expects(:find_model).with("changeme:30", SpecModel::Basic).returns("Fake Object")
|
119
114
|
|
120
115
|
SpecModel::Basic.find("changeme:30").should == "Fake Object"
|
121
116
|
end
|
122
117
|
|
123
|
-
it 'should not call #new' do
|
124
|
-
mock_solr = mock("SolrConnection")
|
125
|
-
mock_result = mock("MockResult")
|
126
|
-
mock_result.expects(:hits).returns([{"id" => "changeme:30"}])
|
127
|
-
mock_solr.expects(:query).with('id:changeme\:30').returns(mock_result)
|
128
|
-
ActiveFedora::RubydoraConnection.instance.expects(:find_model).with("changeme:30", SpecModel::Basic).returns("fake object")
|
129
|
-
|
130
|
-
ActiveFedora::SolrService.expects(:instance).returns(mock("SolrService", :conn => mock_solr))
|
131
|
-
|
132
|
-
res = SpecModel::Basic.find("changeme:30")
|
133
|
-
end
|
134
|
-
|
135
118
|
describe"(:pid => xxx)" do
|
136
119
|
it "should pull the inner object from fedora if it already exists in fedora" do
|
137
120
|
pending
|
@@ -202,4 +185,27 @@ describe ActiveFedora::Model do
|
|
202
185
|
SpecModel::Basic.load_instance("_PID_")
|
203
186
|
end
|
204
187
|
end
|
188
|
+
|
189
|
+
describe "URI translation" do
|
190
|
+
before :all do
|
191
|
+
module SpecModel
|
192
|
+
class CamelCased
|
193
|
+
include ActiveFedora::Model
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
|
198
|
+
after :all do
|
199
|
+
SpecModel.send(:remove_const, :CamelCased)
|
200
|
+
end
|
201
|
+
|
202
|
+
it "should turn a Model class name into an afmodel URI" do
|
203
|
+
SpecModel::CamelCased.to_class_uri.should == 'info:fedora/afmodel:SpecModel_CamelCased'
|
204
|
+
end
|
205
|
+
|
206
|
+
it "should turn an afmodel URI into a Model class name" do
|
207
|
+
ActiveFedora::Model.classname_from_uri('info:fedora/afmodel:SpecModel_CamelCased').should == ['SpecModel::CamelCased', 'afmodel']
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
205
211
|
end
|
@@ -7,7 +7,18 @@ describe ActiveFedora::RelationshipGraph do
|
|
7
7
|
@n1.stubs(:pid => 'foo:777')
|
8
8
|
end
|
9
9
|
|
10
|
-
|
10
|
+
describe "#relationships" do
|
11
|
+
it "should have hash accessors" do
|
12
|
+
@graph.should respond_to(:[])
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should initialize new relation keys" do
|
16
|
+
@graph[:fictional_key].should be_empty
|
17
|
+
@graph[:fictional_key].should respond_to(:<<)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
11
22
|
it "should add relationships" do
|
12
23
|
@n2 = ActiveFedora::Base.new
|
13
24
|
@graph.add(:has_part, @n1)
|
@@ -48,17 +48,7 @@ describe ActiveFedora do
|
|
48
48
|
@test_object.to_solr[SOLR_DOCUMENT_ID.to_sym].should_not be_nil
|
49
49
|
@test_object.to_solr[:id].should be_nil
|
50
50
|
end
|
51
|
-
it "should be used by ActiveFedora::Base#find" do
|
52
|
-
mock_solr = mock("SolrConnection")
|
53
|
-
mock_result = mock("MockResult")
|
54
|
-
mock_result.expects(:hits).returns([{SOLR_DOCUMENT_ID => "changeme:30"}])
|
55
|
-
mock_solr.expects(:query).with(SOLR_DOCUMENT_ID + ':changeme\:30').returns(mock_result)
|
56
|
-
#Fedora::Repository.instance.expects(:find_model).with("changeme:30", SolrSpecModel::Basic).returns("fake object")
|
57
51
|
|
58
|
-
ActiveFedora::SolrService.expects(:instance).returns(mock("SolrService", :conn => mock_solr))
|
59
|
-
|
60
|
-
res = SolrSpecModel::Basic.find("changeme:30")
|
61
|
-
end
|
62
52
|
it "should be used by ActiveFedora::Base#find_by_solr" do
|
63
53
|
mock_solr = mock("SolrConnection")
|
64
54
|
mock_response = mock("SolrResponse")
|
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: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 3.3.
|
9
|
+
- 2
|
10
|
+
version: 3.3.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matt Zumwalt
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2012-02-
|
20
|
+
date: 2012-02-27 00:00:00 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
@@ -31,10 +31,10 @@ dependencies:
|
|
31
31
|
- 0
|
32
32
|
- 6
|
33
33
|
version: 0.0.6
|
34
|
-
prerelease: false
|
35
34
|
requirement: *id001
|
36
|
-
type: :runtime
|
37
35
|
name: solr-ruby
|
36
|
+
type: :runtime
|
37
|
+
prerelease: false
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
@@ -47,10 +47,10 @@ dependencies:
|
|
47
47
|
- 0
|
48
48
|
- 12
|
49
49
|
version: 1.0.12
|
50
|
-
prerelease: false
|
51
50
|
requirement: *id002
|
52
|
-
type: :runtime
|
53
51
|
name: xml-simple
|
52
|
+
type: :runtime
|
53
|
+
prerelease: false
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
55
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
56
|
none: false
|
@@ -62,10 +62,10 @@ dependencies:
|
|
62
62
|
- 1
|
63
63
|
- 16
|
64
64
|
version: "1.16"
|
65
|
-
prerelease: false
|
66
65
|
requirement: *id003
|
67
|
-
type: :runtime
|
68
66
|
name: mime-types
|
67
|
+
type: :runtime
|
68
|
+
prerelease: false
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
version_requirements: &id004 !ruby/object:Gem::Requirement
|
71
71
|
none: false
|
@@ -78,10 +78,10 @@ dependencies:
|
|
78
78
|
- 1
|
79
79
|
- 2
|
80
80
|
version: 1.1.2
|
81
|
-
prerelease: false
|
82
81
|
requirement: *id004
|
83
|
-
type: :runtime
|
84
82
|
name: multipart-post
|
83
|
+
type: :runtime
|
84
|
+
prerelease: false
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
version_requirements: &id005 !ruby/object:Gem::Requirement
|
87
87
|
none: false
|
@@ -92,10 +92,10 @@ dependencies:
|
|
92
92
|
segments:
|
93
93
|
- 0
|
94
94
|
version: "0"
|
95
|
-
prerelease: false
|
96
95
|
requirement: *id005
|
97
|
-
type: :runtime
|
98
96
|
name: nokogiri
|
97
|
+
type: :runtime
|
98
|
+
prerelease: false
|
99
99
|
- !ruby/object:Gem::Dependency
|
100
100
|
version_requirements: &id006 !ruby/object:Gem::Requirement
|
101
101
|
none: false
|
@@ -108,10 +108,10 @@ dependencies:
|
|
108
108
|
- 5
|
109
109
|
- 1
|
110
110
|
version: 1.5.1
|
111
|
-
prerelease: false
|
112
111
|
requirement: *id006
|
113
|
-
type: :runtime
|
114
112
|
name: om
|
113
|
+
type: :runtime
|
114
|
+
prerelease: false
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
version_requirements: &id007 !ruby/object:Gem::Requirement
|
117
117
|
none: false
|
@@ -124,10 +124,10 @@ dependencies:
|
|
124
124
|
- 2
|
125
125
|
- 0
|
126
126
|
version: 1.2.0
|
127
|
-
prerelease: false
|
128
127
|
requirement: *id007
|
129
|
-
type: :runtime
|
130
128
|
name: solrizer
|
129
|
+
type: :runtime
|
130
|
+
prerelease: false
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
132
|
version_requirements: &id008 !ruby/object:Gem::Requirement
|
133
133
|
none: false
|
@@ -140,10 +140,10 @@ dependencies:
|
|
140
140
|
- 0
|
141
141
|
- 0
|
142
142
|
version: 3.0.0
|
143
|
-
prerelease: false
|
144
143
|
requirement: *id008
|
145
|
-
type: :runtime
|
146
144
|
name: activeresource
|
145
|
+
type: :runtime
|
146
|
+
prerelease: false
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
148
|
version_requirements: &id009 !ruby/object:Gem::Requirement
|
149
149
|
none: false
|
@@ -156,10 +156,10 @@ dependencies:
|
|
156
156
|
- 0
|
157
157
|
- 0
|
158
158
|
version: 3.0.0
|
159
|
-
prerelease: false
|
160
159
|
requirement: *id009
|
161
|
-
type: :runtime
|
162
160
|
name: activesupport
|
161
|
+
type: :runtime
|
162
|
+
prerelease: false
|
163
163
|
- !ruby/object:Gem::Dependency
|
164
164
|
version_requirements: &id010 !ruby/object:Gem::Requirement
|
165
165
|
none: false
|
@@ -170,10 +170,10 @@ dependencies:
|
|
170
170
|
segments:
|
171
171
|
- 0
|
172
172
|
version: "0"
|
173
|
-
prerelease: false
|
174
173
|
requirement: *id010
|
175
|
-
type: :runtime
|
176
174
|
name: mediashelf-loggable
|
175
|
+
type: :runtime
|
176
|
+
prerelease: false
|
177
177
|
- !ruby/object:Gem::Dependency
|
178
178
|
version_requirements: &id011 !ruby/object:Gem::Requirement
|
179
179
|
none: false
|
@@ -184,26 +184,26 @@ dependencies:
|
|
184
184
|
segments:
|
185
185
|
- 0
|
186
186
|
version: "0"
|
187
|
-
prerelease: false
|
188
187
|
requirement: *id011
|
189
|
-
type: :runtime
|
190
188
|
name: equivalent-xml
|
189
|
+
type: :runtime
|
190
|
+
prerelease: false
|
191
191
|
- !ruby/object:Gem::Dependency
|
192
192
|
version_requirements: &id012 !ruby/object:Gem::Requirement
|
193
193
|
none: false
|
194
194
|
requirements:
|
195
195
|
- - ~>
|
196
196
|
- !ruby/object:Gem::Version
|
197
|
-
hash:
|
197
|
+
hash: 13
|
198
198
|
segments:
|
199
199
|
- 0
|
200
200
|
- 5
|
201
|
-
-
|
202
|
-
version: 0.5.
|
203
|
-
prerelease: false
|
201
|
+
- 3
|
202
|
+
version: 0.5.3
|
204
203
|
requirement: *id012
|
205
|
-
type: :runtime
|
206
204
|
name: rubydora
|
205
|
+
type: :runtime
|
206
|
+
prerelease: false
|
207
207
|
- !ruby/object:Gem::Dependency
|
208
208
|
version_requirements: &id013 !ruby/object:Gem::Requirement
|
209
209
|
none: false
|
@@ -214,10 +214,10 @@ dependencies:
|
|
214
214
|
segments:
|
215
215
|
- 0
|
216
216
|
version: "0"
|
217
|
-
prerelease: false
|
218
217
|
requirement: *id013
|
219
|
-
type: :runtime
|
220
218
|
name: rdf
|
219
|
+
type: :runtime
|
220
|
+
prerelease: false
|
221
221
|
- !ruby/object:Gem::Dependency
|
222
222
|
version_requirements: &id014 !ruby/object:Gem::Requirement
|
223
223
|
none: false
|
@@ -228,10 +228,10 @@ dependencies:
|
|
228
228
|
segments:
|
229
229
|
- 0
|
230
230
|
version: "0"
|
231
|
-
prerelease: false
|
232
231
|
requirement: *id014
|
233
|
-
type: :runtime
|
234
232
|
name: rdf-rdfxml
|
233
|
+
type: :runtime
|
234
|
+
prerelease: false
|
235
235
|
- !ruby/object:Gem::Dependency
|
236
236
|
version_requirements: &id015 !ruby/object:Gem::Requirement
|
237
237
|
none: false
|
@@ -242,10 +242,10 @@ dependencies:
|
|
242
242
|
segments:
|
243
243
|
- 0
|
244
244
|
version: "0"
|
245
|
-
prerelease: false
|
246
245
|
requirement: *id015
|
247
|
-
type: :development
|
248
246
|
name: yard
|
247
|
+
type: :development
|
248
|
+
prerelease: false
|
249
249
|
- !ruby/object:Gem::Dependency
|
250
250
|
version_requirements: &id016 !ruby/object:Gem::Requirement
|
251
251
|
none: false
|
@@ -256,10 +256,10 @@ dependencies:
|
|
256
256
|
segments:
|
257
257
|
- 0
|
258
258
|
version: "0"
|
259
|
-
prerelease: false
|
260
259
|
requirement: *id016
|
261
|
-
type: :development
|
262
260
|
name: RedCloth
|
261
|
+
type: :development
|
262
|
+
prerelease: false
|
263
263
|
- !ruby/object:Gem::Dependency
|
264
264
|
version_requirements: &id017 !ruby/object:Gem::Requirement
|
265
265
|
none: false
|
@@ -270,10 +270,10 @@ dependencies:
|
|
270
270
|
segments:
|
271
271
|
- 0
|
272
272
|
version: "0"
|
273
|
-
prerelease: false
|
274
273
|
requirement: *id017
|
275
|
-
type: :development
|
276
274
|
name: rake
|
275
|
+
type: :development
|
276
|
+
prerelease: false
|
277
277
|
- !ruby/object:Gem::Dependency
|
278
278
|
version_requirements: &id018 !ruby/object:Gem::Requirement
|
279
279
|
none: false
|
@@ -286,10 +286,10 @@ dependencies:
|
|
286
286
|
- 2
|
287
287
|
- 3
|
288
288
|
version: 1.2.3
|
289
|
-
prerelease: false
|
290
289
|
requirement: *id018
|
291
|
-
type: :development
|
292
290
|
name: solrizer-fedora
|
291
|
+
type: :development
|
292
|
+
prerelease: false
|
293
293
|
- !ruby/object:Gem::Dependency
|
294
294
|
version_requirements: &id019 !ruby/object:Gem::Requirement
|
295
295
|
none: false
|
@@ -302,10 +302,10 @@ dependencies:
|
|
302
302
|
- 2
|
303
303
|
- 0
|
304
304
|
version: 1.2.0
|
305
|
-
prerelease: false
|
306
305
|
requirement: *id019
|
307
|
-
type: :development
|
308
306
|
name: jettywrapper
|
307
|
+
type: :development
|
308
|
+
prerelease: false
|
309
309
|
- !ruby/object:Gem::Dependency
|
310
310
|
version_requirements: &id020 !ruby/object:Gem::Requirement
|
311
311
|
none: false
|
@@ -317,10 +317,10 @@ dependencies:
|
|
317
317
|
- 2
|
318
318
|
- 0
|
319
319
|
version: "2.0"
|
320
|
-
prerelease: false
|
321
320
|
requirement: *id020
|
322
|
-
type: :development
|
323
321
|
name: rspec
|
322
|
+
type: :development
|
323
|
+
prerelease: false
|
324
324
|
- !ruby/object:Gem::Dependency
|
325
325
|
version_requirements: &id021 !ruby/object:Gem::Requirement
|
326
326
|
none: false
|
@@ -333,10 +333,10 @@ dependencies:
|
|
333
333
|
- 9
|
334
334
|
- 8
|
335
335
|
version: 0.9.8
|
336
|
-
prerelease: false
|
337
336
|
requirement: *id021
|
338
|
-
type: :development
|
339
337
|
name: mocha
|
338
|
+
type: :development
|
339
|
+
prerelease: false
|
340
340
|
description: ActiveFedora provides for creating and managing objects in the Fedora Repository Architecture.
|
341
341
|
email:
|
342
342
|
- matt.zumwalt@yourmediashelf.com
|
@@ -581,7 +581,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
581
581
|
requirements: []
|
582
582
|
|
583
583
|
rubyforge_project: rubyfedora
|
584
|
-
rubygems_version: 1.8.
|
584
|
+
rubygems_version: 1.8.17
|
585
585
|
signing_key:
|
586
586
|
specification_version: 3
|
587
587
|
summary: A convenience libary for manipulating MODS (Metadata Object Description Schema) documents.
|