active-fedora 7.1.2 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -13
- data/Gemfile +2 -0
- data/active-fedora.gemspec +2 -2
- data/lib/active_fedora/associations/belongs_to_association.rb +17 -8
- data/lib/active_fedora/version.rb +1 -1
- data/lib/tasks/active_fedora_dev.rake +1 -1
- data/spec/integration/om_datastream_spec.rb +2 -2
- data/spec/support/an_active_model.rb +4 -0
- data/spec/unit/active_fedora_spec.rb +1 -1
- metadata +13 -11
- data/gemfiles/rails3.gemfile +0 -5
- data/gemfiles/rails4.1.gemfile +0 -5
- data/gemfiles/rails4.gemfile +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e049566d6809c6928e2d4ea760f815d963c72a6b
|
4
|
+
data.tar.gz: 4f254fc331fc5ea3bdee7318e26eaab5b4a7b234
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 381da47c98e120c5ac1cc0901eeb00e4dbb1d2f8086ee190bd144d161385b0ef037f169a823776804cdcfc5b596231f2b77d896ad889507172b8299553f8a406
|
7
|
+
data.tar.gz: 85f7a9a3e29b002df812600a9049dbc663001f014089c5ef2e1fed5e257c9c9b1fb2113274282854264ebb99303eeac347e810ea5639b37696e2d5b4a4d9b783
|
data/.travis.yml
CHANGED
@@ -1,22 +1,14 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.
|
3
|
+
- 2.3.1
|
4
4
|
|
5
|
-
gemfile:
|
6
|
-
- gemfiles/rails3.gemfile
|
7
|
-
- gemfiles/rails4.gemfile
|
8
|
-
- gemfiles/rails4.1.gemfile
|
9
5
|
|
10
|
-
|
11
6
|
matrix:
|
12
7
|
include:
|
13
|
-
- rvm: 2.
|
14
|
-
|
15
|
-
- rvm: 2.
|
16
|
-
|
17
|
-
- rvm: 1.9.3
|
18
|
-
gemfile: gemfiles/rails4.gemfile
|
19
|
-
|
8
|
+
- rvm: 2.2.5
|
9
|
+
env: RAILS_VERSION=4.2.7.1
|
10
|
+
- rvm: 2.1.10
|
11
|
+
env: RAILS_VERSION=4.2.7.1
|
20
12
|
|
21
13
|
notifications:
|
22
14
|
irc: "irc.freenode.org#projecthydra"
|
@@ -24,3 +16,5 @@ notifications:
|
|
24
16
|
env:
|
25
17
|
global:
|
26
18
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
19
|
+
|
20
|
+
jdk: oraclejdk8
|
data/Gemfile
CHANGED
data/active-fedora.gemspec
CHANGED
@@ -14,13 +14,13 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.license = "APACHE2"
|
15
15
|
s.required_ruby_version = '>= 1.9.3'
|
16
16
|
|
17
|
-
s.add_dependency 'rsolr', "
|
17
|
+
s.add_dependency 'rsolr', ">= 1.0.10", '< 3'
|
18
18
|
s.add_dependency 'om', '~> 3.1'
|
19
19
|
s.add_dependency 'nom-xml', '>= 0.5.1'
|
20
20
|
s.add_dependency "activesupport", '>= 3.0.0'
|
21
21
|
s.add_dependency "rubydora", '~> 1.8'
|
22
22
|
s.add_dependency "active-triples", '~> 0.2.2'
|
23
|
-
s.add_dependency "rdf-rdfxml", '~> 1.1
|
23
|
+
s.add_dependency "rdf-rdfxml", '~> 1.1'
|
24
24
|
s.add_dependency "deprecation"
|
25
25
|
s.add_development_dependency "rdoc"
|
26
26
|
s.add_development_dependency "yard"
|
@@ -10,22 +10,25 @@ module ActiveFedora
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def id_reader
|
13
|
-
|
13
|
+
begin
|
14
14
|
# need to find the id with the correct class
|
15
15
|
ids = @owner.ids_for_outbound(@reflection.options[:property])
|
16
16
|
|
17
|
-
return if ids.empty?
|
17
|
+
return if ids.empty?
|
18
|
+
|
18
19
|
# This incurs a lot of overhead, but it's necessary if the users use one property for more than one association.
|
19
20
|
# e.g.
|
20
21
|
# belongs_to :author, property: :has_member, class_name: 'Person'
|
21
22
|
# belongs_to :publisher, property: :has_member
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
|
24
|
+
if @owner.reflections.one? { |k, v| v.options[:property] == @reflection.options[:property] }
|
25
|
+
@full_results = nil
|
26
|
+
ids.first
|
27
|
+
else
|
28
|
+
@full_results = SolrService.query(construct_query(ids))
|
29
|
+
@full_results.first['id'] if @full_results.present?
|
26
30
|
end
|
27
31
|
end
|
28
|
-
@full_result['id'] if @full_result
|
29
32
|
end
|
30
33
|
|
31
34
|
def replace(record)
|
@@ -55,7 +58,13 @@ module ActiveFedora
|
|
55
58
|
|
56
59
|
private
|
57
60
|
def find_target
|
58
|
-
|
61
|
+
return unless id_reader
|
62
|
+
|
63
|
+
if @full_result # side-effect from #id_reader
|
64
|
+
ActiveFedora::SolrService.reify_solr_results([@full_result]).first
|
65
|
+
else
|
66
|
+
ActiveFedora::Base.find(id_reader, cast: true)
|
67
|
+
end
|
59
68
|
end
|
60
69
|
|
61
70
|
# Constructs a query that checks solr for the correct id & class_name combination
|
@@ -1,7 +1,7 @@
|
|
1
1
|
APP_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../")
|
2
2
|
|
3
3
|
require 'jettywrapper'
|
4
|
-
JETTY_ZIP_BASENAME = '
|
4
|
+
JETTY_ZIP_BASENAME = 'v7.3.0'
|
5
5
|
Jettywrapper.url = "https://github.com/projecthydra/hydra-jetty/archive/#{JETTY_ZIP_BASENAME}.zip"
|
6
6
|
|
7
7
|
namespace :active_fedora do
|
@@ -30,11 +30,11 @@ describe ActiveFedora::OmDatastream do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should not be changed when no fields have been set" do
|
33
|
-
@obj.descMetadata.should_not
|
33
|
+
@obj.descMetadata.should_not be_changed
|
34
34
|
end
|
35
35
|
it "should be changed when a field has been set" do
|
36
36
|
@obj.descMetadata.title = 'Foobar'
|
37
|
-
@obj.descMetadata.should
|
37
|
+
@obj.descMetadata.should be_changed
|
38
38
|
end
|
39
39
|
describe "#changed?" do
|
40
40
|
it "should not be changed if the new xml matches the old xml" do
|
@@ -123,7 +123,7 @@ describe ActiveFedora do
|
|
123
123
|
it "should raise a NameError if the class isn't found" do
|
124
124
|
expect {
|
125
125
|
ActiveFedora.class_from_string("FooClass", ParentClass::OtherSiblingClass)
|
126
|
-
}.to raise_error NameError,
|
126
|
+
}.to raise_error NameError, /uninitialized constant FooClass/
|
127
127
|
end
|
128
128
|
end
|
129
129
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active-fedora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt
|
@@ -10,22 +10,28 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2016-10-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- - "
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: 1.0.10
|
22
|
+
- - "<"
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: '3'
|
22
25
|
type: :runtime
|
23
26
|
prerelease: false
|
24
27
|
version_requirements: !ruby/object:Gem::Requirement
|
25
28
|
requirements:
|
26
|
-
- - "
|
29
|
+
- - ">="
|
27
30
|
- !ruby/object:Gem::Version
|
28
31
|
version: 1.0.10
|
32
|
+
- - "<"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '3'
|
29
35
|
- !ruby/object:Gem::Dependency
|
30
36
|
name: om
|
31
37
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,14 +108,14 @@ dependencies:
|
|
102
108
|
requirements:
|
103
109
|
- - "~>"
|
104
110
|
- !ruby/object:Gem::Version
|
105
|
-
version: 1.1
|
111
|
+
version: '1.1'
|
106
112
|
type: :runtime
|
107
113
|
prerelease: false
|
108
114
|
version_requirements: !ruby/object:Gem::Requirement
|
109
115
|
requirements:
|
110
116
|
- - "~>"
|
111
117
|
- !ruby/object:Gem::Version
|
112
|
-
version: 1.1
|
118
|
+
version: '1.1'
|
113
119
|
- !ruby/object:Gem::Dependency
|
114
120
|
name: deprecation
|
115
121
|
requirement: !ruby/object:Gem::Requirement
|
@@ -294,9 +300,6 @@ files:
|
|
294
300
|
- config/solr.yml
|
295
301
|
- config/solr_mappings_af_0.1.yml
|
296
302
|
- config/solr_mappings_bl_2.4.yml
|
297
|
-
- gemfiles/rails3.gemfile
|
298
|
-
- gemfiles/rails4.1.gemfile
|
299
|
-
- gemfiles/rails4.gemfile
|
300
303
|
- lib/active-fedora.rb
|
301
304
|
- lib/active_fedora.rb
|
302
305
|
- lib/active_fedora/association_relation.rb
|
@@ -551,9 +554,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
551
554
|
version: '0'
|
552
555
|
requirements: []
|
553
556
|
rubyforge_project:
|
554
|
-
rubygems_version: 2.
|
557
|
+
rubygems_version: 2.5.1
|
555
558
|
signing_key:
|
556
559
|
specification_version: 4
|
557
560
|
summary: A convenience libary for manipulating documents in the Fedora Repository.
|
558
561
|
test_files: []
|
559
|
-
has_rdoc:
|
data/gemfiles/rails3.gemfile
DELETED
data/gemfiles/rails4.1.gemfile
DELETED