active_fedora-noid 1.1.0 → 1.1.1
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 +4 -4
- data/Gemfile +1 -0
- data/lib/active_fedora/noid/config.rb +4 -3
- data/lib/active_fedora/noid/version.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/config_spec.rb +5 -0
- 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: 4dfe7eb78a1ea93066a65a212cee6470d330c313
|
|
4
|
+
data.tar.gz: 45975a62c716cabe2e686e03cb4d444fb226d1eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 18546143cd33f6e2cc59af5080afb96510bed1e32ffbda3115317081b21a927ca1a9a7a699aebb0bc0077d2ca3e820fd4859e072c046d82c4576ea24f059d271
|
|
7
|
+
data.tar.gz: 5d6acecefb830f970673e5a451cba0e94989f8e636bb9eb6f8f834f8eab9c489552be7eb8f6d5f56909692b307ed8cc1126566f9137756213f0de36516b1263b
|
data/Gemfile
CHANGED
|
@@ -12,7 +12,9 @@ module ActiveFedora
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def translate_uri_to_id
|
|
15
|
-
lambda
|
|
15
|
+
lambda do |uri|
|
|
16
|
+
uri.to_s.sub(baseurl, '').split('/', baseparts).last
|
|
17
|
+
end
|
|
16
18
|
end
|
|
17
19
|
|
|
18
20
|
def translate_id_to_uri
|
|
@@ -28,8 +30,7 @@ module ActiveFedora
|
|
|
28
30
|
end
|
|
29
31
|
|
|
30
32
|
def baseparts
|
|
31
|
-
|
|
32
|
-
baseurl.count('/') + treeparts
|
|
33
|
+
2 + [(template.gsub(/\.[rsz]/,'').length.to_f/2).ceil, 4].min
|
|
33
34
|
end
|
|
34
35
|
end
|
|
35
36
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/unit/config_spec.rb
CHANGED
|
@@ -37,6 +37,11 @@ describe ActiveFedora::Noid::Config do
|
|
|
37
37
|
|
|
38
38
|
it { is_expected.to eq 'hh63vz22q/members' }
|
|
39
39
|
|
|
40
|
+
context "with a hash code uri" do
|
|
41
|
+
let(:uri) { "http://localhost:8983/fedora/rest/test/hh/63/vz/22/hh63vz22q#g123" }
|
|
42
|
+
it { is_expected.to eq 'hh63vz22q#g123' }
|
|
43
|
+
end
|
|
44
|
+
|
|
40
45
|
describe 'with a short custom template' do
|
|
41
46
|
let(:uri) { "http://localhost:8983/fedora/rest/test/ab/cd/abcd/members" }
|
|
42
47
|
let(:custom_template) { '.reeee' }
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_fedora-noid
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael J. Giarlo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-06-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: active-fedora
|