active-fedora 9.6.1 → 9.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +6 -1
- data/lib/active_fedora/caching_connection.rb +4 -2
- data/lib/active_fedora/core/fedora_id_translator.rb +1 -0
- data/lib/active_fedora/query_result_builder.rb +1 -1
- data/lib/active_fedora/version.rb +1 -1
- data/spec/unit/core/fedora_id_translator_spec.rb +10 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4563e9a6719b7d7ba4b3c1c13a94062707acfd24
|
4
|
+
data.tar.gz: 67c92763ade10866c4682153e6df9d69d761d0a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: add632d1ed1e804dc8624a91925be4d43347acb4d15d0119b293dc99b0c40de8168ea62fb42a6e1d21b9df7592ba4def6b2f8c3fc7d7178a30239cc9ed01218e
|
7
|
+
data.tar.gz: c8b1040b21118e8438691f07228765f1aaa1ed9f6645966c79c64e14c3d46463a1bc64e8159f9dd02e752533be40d33c198440fc86af1f04dc805f2b31b67b80
|
data/History.txt
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
v9.6.2
|
2
|
+
2015-11-07: Fixes for new version of rubocop [Justin Coyne]
|
3
|
+
|
4
|
+
2015-11-07: Escape square brackets in URIs. Fixes #941 [Justin Coyne]
|
5
|
+
|
1
6
|
v9.6.1
|
2
7
|
2015-11-02: Don't try to parse nil dates. Fixes #937 [Justin Coyne]
|
3
8
|
|
4
|
-
v9.6.0 (yanked)
|
9
|
+
v9.6.0 (yanked due to error parsing nil dates)
|
5
10
|
2015-11-02: Loosen dependency on rdf-rdfxml [Justin Coyne]
|
6
11
|
|
7
12
|
2015-10-29: Allow developers to override resource_class. [Trey Terrell]
|
@@ -31,7 +31,8 @@ module ActiveFedora
|
|
31
31
|
|
32
32
|
# Enable the cache within the block.
|
33
33
|
def cache
|
34
|
-
old
|
34
|
+
old = @cache_enabled
|
35
|
+
@cache_enabled = true
|
35
36
|
yield
|
36
37
|
ensure
|
37
38
|
@cache_enabled = old
|
@@ -48,7 +49,8 @@ module ActiveFedora
|
|
48
49
|
|
49
50
|
# Disable the query cache within the block.
|
50
51
|
def uncached
|
51
|
-
old
|
52
|
+
old = @cache_enabled
|
53
|
+
@cache_enabled = false
|
52
54
|
yield
|
53
55
|
ensure
|
54
56
|
@cache_enabled = old
|
@@ -2,6 +2,7 @@ module ActiveFedora::Core
|
|
2
2
|
class FedoraIdTranslator
|
3
3
|
SLASH = '/'.freeze
|
4
4
|
def self.call(id)
|
5
|
+
id = URI.escape(id, '[]'.freeze)
|
5
6
|
id = "/#{id}" unless id.start_with? SLASH
|
6
7
|
unless ActiveFedora.fedora.base_path == SLASH || id.start_with?("#{ActiveFedora.fedora.base_path}/")
|
7
8
|
id = ActiveFedora.fedora.base_path + id
|
@@ -41,7 +41,7 @@ module ActiveFedora
|
|
41
41
|
best_model_match = model_value if best_model_match > model_value
|
42
42
|
end
|
43
43
|
|
44
|
-
ActiveFedora::Base.logger.warn "Could not find a model for #{hit['id']}, defaulting to ActiveFedora::Base"
|
44
|
+
ActiveFedora::Base.logger.warn "Could not find a model for #{hit['id']}, defaulting to ActiveFedora::Base" if ActiveFedora::Base.logger && !best_model_match
|
45
45
|
best_model_match || ActiveFedora::Base
|
46
46
|
end
|
47
47
|
|
@@ -9,12 +9,21 @@ RSpec.describe ActiveFedora::Core::FedoraIdTranslator do
|
|
9
9
|
it "returns a fedora URI" do
|
10
10
|
expect(result).to eq good_uri
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
|
+
context "with a leading slash" do
|
13
14
|
let(:id) { "/banana" }
|
14
15
|
it "returns a good fedora URI" do
|
15
16
|
expect(result).to eq good_uri
|
16
17
|
end
|
17
18
|
end
|
19
|
+
|
20
|
+
context "with characters that need escaping" do
|
21
|
+
let(:good_uri) { ActiveFedora.fedora.host + ActiveFedora.fedora.base_path + "/%5Bfrob%5D" }
|
22
|
+
let(:id) { "[frob]" }
|
23
|
+
it "returns a good fedora URI" do
|
24
|
+
expect(result).to eq good_uri
|
25
|
+
end
|
26
|
+
end
|
18
27
|
end
|
19
28
|
end
|
20
29
|
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: 9.6.
|
4
|
+
version: 9.6.2
|
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: 2015-11-
|
13
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rsolr
|