active-fedora 10.3.0.rc2 → 10.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfce14d5c623e569206f59c02700d667e34bde26
4
- data.tar.gz: ead2d01f58a36fc8afac60ddfc9825fd1e581d53
3
+ metadata.gz: 3f4e8471f5df940e6d52c76f150fd1532aff2e7d
4
+ data.tar.gz: 79be63a9635f81dfe7a0017fe8890900e4ff598c
5
5
  SHA512:
6
- metadata.gz: c61d8f7606b23f0cbff48e4280711cab4b1237d245590b775cead65ca4b65907ee6b000b8bcef23bafd41cc2bb8f84dd194edb220589f9e510e2712a47885cc8
7
- data.tar.gz: b5af3107ec86f44ab5e56926e678601430f855ea8c962e193dc90eff90b2db46fde9bc6de6ed68f36cc64a7173986d6d56b05848b0f79e02b5c7788101758656
6
+ metadata.gz: c2ff90b7a1a95255a21f55d72c55a488087087147629b29615380a041ba8da465a61274e850b52299955951f7a85bf398e4d0709db552cfb418d4ad2693b524f
7
+ data.tar.gz: 193eac22abf48bb8b3817d92d36fb25f977155648ee8f7c2493d271be6d01c4b2f0d4b587c501b2fe668a0f82d0e7cd0a4eba16af506d84da7136c5664ca0ff6
@@ -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::Base.id_to_uri(''))
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}"
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "10.3.0.rc2".freeze
2
+ VERSION = "10.3.0".freeze
3
3
  end
@@ -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.host}#{ActiveFedora.fedora.base_path}/#{@this_id}")
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.host + ActiveFedora.fedora.base_path + "/banana" }
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.host + ActiveFedora.fedora.base_path + "/%5Bfrob%5D" }
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.host + ActiveFedora.fedora.base_path + "/6" }
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.host + ActiveFedora.fedora.base_path + "602-a" }
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
@@ -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 { should eq "#{ActiveFedora.fedora.host}#{ActiveFedora.fedora.base_path}/123456w" }
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.host}#{ActiveFedora.fedora.base_path}/foo/#{id}" }
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 { should eq "#{ActiveFedora.fedora.host}#{ActiveFedora.fedora.base_path}/foo/123456w" }
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.host}#{ActiveFedora.fedora.base_path}/foo/123456w" }
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' }
@@ -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.host}#{ActiveFedora.fedora.base_path}/1234/FOO1"
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.host}#{ActiveFedora.fedora.base_path}/1234/FOO1"
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.rc2
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-08-18 00:00:00.000000000 Z
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: 1.3.1
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.