active-fedora 9.6.1 → 9.6.2

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: ed9af0497efe12a99da6783dc8fb7aaaf2a1c130
4
- data.tar.gz: cea4cf641038e3edcb68a53a8c174ddba6035c49
3
+ metadata.gz: 4563e9a6719b7d7ba4b3c1c13a94062707acfd24
4
+ data.tar.gz: 67c92763ade10866c4682153e6df9d69d761d0a1
5
5
  SHA512:
6
- metadata.gz: 957e5864be7ef7001eed269400e65e7ae95c5a421078ca56d0243638a51e8442df00e76037097603d894193fdef20edc965ce52d10781fef7ba97de9cf916d15
7
- data.tar.gz: df5e24a7c95c5e06958e21fb246b0b66210b7523c576ed56356d646973c13bef029000e7f153f7ad60b2e1679f59e7724232e1001c57d4f58104ade1532b26b0
6
+ metadata.gz: add632d1ed1e804dc8624a91925be4d43347acb4d15d0119b293dc99b0c40de8168ea62fb42a6e1d21b9df7592ba4def6b2f8c3fc7d7178a30239cc9ed01218e
7
+ data.tar.gz: c8b1040b21118e8438691f07228765f1aaa1ed9f6645966c79c64e14c3d46463a1bc64e8159f9dd02e752533be40d33c198440fc86af1f04dc805f2b31b67b80
@@ -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, @cache_enabled = @cache_enabled, true
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, @cache_enabled = @cache_enabled, false
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" unless best_model_match if ActiveFedora::Base.logger
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
 
@@ -1,3 +1,3 @@
1
1
  module ActiveFedora
2
- VERSION = "9.6.1"
2
+ VERSION = "9.6.2"
3
3
  end
@@ -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
- context "when given an id with a leading slash" do
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.1
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-03 00:00:00.000000000 Z
13
+ date: 2015-11-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsolr