active-fedora 10.3.0.rc2 → 10.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_fedora/fedora.rb +6 -2
- data/lib/active_fedora/indexing.rb +1 -1
- data/lib/active_fedora/version.rb +1 -1
- data/spec/unit/base_spec.rb +1 -1
- data/spec/unit/core/fedora_id_translator_spec.rb +2 -2
- data/spec/unit/core/fedora_uri_translator_spec.rb +2 -2
- data/spec/unit/core_spec.rb +5 -5
- data/spec/unit/file_spec.rb +2 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f4e8471f5df940e6d52c76f150fd1532aff2e7d
|
4
|
+
data.tar.gz: 79be63a9635f81dfe7a0017fe8890900e4ff598c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2ff90b7a1a95255a21f55d72c55a488087087147629b29615380a041ba8da465a61274e850b52299955951f7a85bf398e4d0709db552cfb418d4ad2693b524f
|
7
|
+
data.tar.gz: 193eac22abf48bb8b3817d92d36fb25f977155648ee8f7c2493d271be6d01c4b2f0d4b587c501b2fe668a0f82d0e7cd0a4eba16af506d84da7136c5664ca0ff6
|
data/lib/active_fedora/fedora.rb
CHANGED
@@ -23,11 +23,15 @@ module ActiveFedora
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def host
|
26
|
-
@config[:url]
|
26
|
+
@config[:url].sub(/\/$/, BLANK)
|
27
27
|
end
|
28
28
|
|
29
29
|
def base_path
|
30
|
-
@config[:base_path] ||
|
30
|
+
@config[:base_path] || SLASH
|
31
|
+
end
|
32
|
+
|
33
|
+
def base_uri
|
34
|
+
host + base_path.sub(/\/$/, BLANK)
|
31
35
|
end
|
32
36
|
|
33
37
|
def user
|
@@ -84,7 +84,7 @@ module ActiveFedora
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def reindex_everything
|
87
|
-
descendants = descendant_uris(ActiveFedora
|
87
|
+
descendants = descendant_uris(ActiveFedora.fedora.base_uri)
|
88
88
|
descendants.shift # Discard the root uri
|
89
89
|
descendants.each do |uri|
|
90
90
|
logger.debug "Re-index everything ... #{uri}"
|
data/spec/unit/base_spec.rb
CHANGED
@@ -260,7 +260,7 @@ describe ActiveFedora::Base do
|
|
260
260
|
end
|
261
261
|
|
262
262
|
it "updates the resource" do
|
263
|
-
expect(test_object.resource.rdf_subject).to eq ::RDF::URI.new("#{ActiveFedora.fedora.
|
263
|
+
expect(test_object.resource.rdf_subject).to eq ::RDF::URI.new("#{ActiveFedora.fedora.base_uri}/#{@this_id}")
|
264
264
|
expect(test_object.title).to eq ['foo']
|
265
265
|
end
|
266
266
|
end
|
@@ -4,7 +4,7 @@ RSpec.describe ActiveFedora::Core::FedoraIdTranslator do
|
|
4
4
|
describe ".call" do
|
5
5
|
let(:result) { described_class.call(id) }
|
6
6
|
context "when given an id" do
|
7
|
-
let(:good_uri) { ActiveFedora.fedora.
|
7
|
+
let(:good_uri) { ActiveFedora.fedora.base_uri + "/banana" }
|
8
8
|
let(:id) { "banana" }
|
9
9
|
it "returns a fedora URI" do
|
10
10
|
expect(result).to eq good_uri
|
@@ -18,7 +18,7 @@ RSpec.describe ActiveFedora::Core::FedoraIdTranslator do
|
|
18
18
|
end
|
19
19
|
|
20
20
|
context "with characters that need escaping" do
|
21
|
-
let(:good_uri) { ActiveFedora.fedora.
|
21
|
+
let(:good_uri) { ActiveFedora.fedora.base_uri + "/%5Bfrob%5D" }
|
22
22
|
let(:id) { "[frob]" }
|
23
23
|
it "returns a good fedora URI" do
|
24
24
|
expect(result).to eq good_uri
|
@@ -4,13 +4,13 @@ RSpec.describe ActiveFedora::Core::FedoraUriTranslator do
|
|
4
4
|
describe ".call" do
|
5
5
|
let(:result) { described_class.call(uri) }
|
6
6
|
context "when given a Fedora URI" do
|
7
|
-
let(:uri) { ActiveFedora.fedora.
|
7
|
+
let(:uri) { ActiveFedora.fedora.base_uri + "/6" }
|
8
8
|
it "returns the id" do
|
9
9
|
expect(result).to eq '6'
|
10
10
|
end
|
11
11
|
end
|
12
12
|
context "when given a URI missing a slash" do
|
13
|
-
let(:uri) { ActiveFedora.fedora.
|
13
|
+
let(:uri) { ActiveFedora.fedora.base_uri + "602-a" }
|
14
14
|
it "returns the id" do
|
15
15
|
expect(result).to eq "602-a"
|
16
16
|
end
|
data/spec/unit/core_spec.rb
CHANGED
@@ -109,7 +109,7 @@ describe ActiveFedora::Base do
|
|
109
109
|
subject { described_class.id_to_uri(id) }
|
110
110
|
|
111
111
|
context "with no custom proc is set" do
|
112
|
-
it {
|
112
|
+
it { is_expected.to eq "#{ActiveFedora.fedora.base_uri}/123456w" }
|
113
113
|
it "justs call #translate_id_to_uri" do
|
114
114
|
allow(described_class).to receive(:translate_id_to_uri).and_call_original
|
115
115
|
allow(ActiveFedora::Core::FedoraIdTranslator).to receive(:call).and_call_original
|
@@ -122,11 +122,11 @@ describe ActiveFedora::Base do
|
|
122
122
|
|
123
123
|
context "when custom proc is set" do
|
124
124
|
before do
|
125
|
-
described_class.translate_id_to_uri = lambda { |id| "#{ActiveFedora.fedora.
|
125
|
+
described_class.translate_id_to_uri = lambda { |id| "#{ActiveFedora.fedora.base_uri}/foo/#{id}" }
|
126
126
|
end
|
127
127
|
after { described_class.translate_id_to_uri = nil }
|
128
128
|
|
129
|
-
it {
|
129
|
+
it { is_expected.to eq "#{ActiveFedora.fedora.base_uri}/foo/123456w" }
|
130
130
|
end
|
131
131
|
|
132
132
|
context "with an empty base path" do
|
@@ -145,8 +145,8 @@ describe ActiveFedora::Base do
|
|
145
145
|
end
|
146
146
|
|
147
147
|
describe "uri_to_id" do
|
148
|
-
let(:uri) { "#{ActiveFedora.fedora.
|
149
|
-
subject { described_class.uri_to_id(uri) }
|
148
|
+
let(:uri) { "#{ActiveFedora.fedora.base_uri}/foo/123456w" }
|
149
|
+
subject(:uri_id) { described_class.uri_to_id(uri) }
|
150
150
|
|
151
151
|
context "with no custom proc is set" do
|
152
152
|
it { should eq 'foo/123456w' }
|
data/spec/unit/file_spec.rb
CHANGED
@@ -51,14 +51,14 @@ describe ActiveFedora::File do
|
|
51
51
|
context "and it's initialized with the URI" do
|
52
52
|
let(:file) { described_class.new(parent.uri + "/FOO1") }
|
53
53
|
it "works" do
|
54
|
-
expect(subject.to_s).to eq "#{ActiveFedora.fedora.
|
54
|
+
expect(subject.to_s).to eq "#{ActiveFedora.fedora.base_uri}/1234/FOO1"
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
58
|
context "and it's initialized with an ID" do
|
59
59
|
let(:file) { described_class.new(parent.id + "/FOO1") }
|
60
60
|
it "works" do
|
61
|
-
expect(subject.to_s).to eq "#{ActiveFedora.fedora.
|
61
|
+
expect(subject.to_s).to eq "#{ActiveFedora.fedora.base_uri}/1234/FOO1"
|
62
62
|
end
|
63
63
|
end
|
64
64
|
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: 10.3.0
|
4
|
+
version: 10.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Zumwalt
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-11-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|
@@ -743,12 +743,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
743
743
|
version: '2.0'
|
744
744
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
745
745
|
requirements:
|
746
|
-
- - "
|
746
|
+
- - ">="
|
747
747
|
- !ruby/object:Gem::Version
|
748
|
-
version:
|
748
|
+
version: '0'
|
749
749
|
requirements: []
|
750
750
|
rubyforge_project:
|
751
|
-
rubygems_version: 2.5.1
|
751
|
+
rubygems_version: 2.4.5.1
|
752
752
|
signing_key:
|
753
753
|
specification_version: 4
|
754
754
|
summary: A convenience libary for manipulating documents in the Fedora Repository.
|