active_fedora-noid 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -9
- data/lib/active_fedora/noid.rb +1 -0
- data/lib/active_fedora/noid/version.rb +1 -1
- data/spec/unit/noid_spec.rb +12 -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: cb21b73450d652c999b6957aec06a64a6b93a424
|
4
|
+
data.tar.gz: 92a908f1457731a303eaa3bede38fd139ba0a820
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a41ca01378cfab9bfeb598ebfbba2b685759058281897c6bc730b8d92cd7dc5e047676de949d05d802141cc46c448eaf052cef625154ed2a0695601e6cc88ea
|
7
|
+
data.tar.gz: b844067ca1dd94891953605151997e594b0c57f4194148ed47a6ddcd9f1481b678e8bf672b73282e99a4ee4cec4e4f3dc559c9bf6f5faba7dae6daf57a39c7a8
|
data/.travis.yml
CHANGED
@@ -1,20 +1,15 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
|
-
script:
|
4
|
-
- bundle exec rake spec environment=test
|
5
3
|
sudo: false
|
6
4
|
rvm:
|
7
|
-
- 2.
|
8
|
-
- 2.1
|
5
|
+
- 2.3.1
|
9
6
|
env:
|
10
7
|
global:
|
11
8
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
9
|
+
matrix:
|
10
|
+
- "RAILS_VERSION=4.2.7.1"
|
11
|
+
- "RAILS_VERSION=5.0.0.1"
|
12
12
|
notifications:
|
13
|
-
email:
|
14
|
-
recipients:
|
15
|
-
- "ul-dlt-hydra@lists.psu.edu"
|
16
|
-
on_success: "change"
|
17
|
-
on_failure: "always"
|
18
13
|
irc:
|
19
14
|
channels:
|
20
15
|
- "irc.freenode.org#projecthydra"
|
data/lib/active_fedora/noid.rb
CHANGED
@@ -15,6 +15,7 @@ module ActiveFedora
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def treeify(identifier)
|
18
|
+
raise ArgumentError, 'Identifier must be a string of size > 0 in order to be treeified' if identifier.blank?
|
18
19
|
head = identifier.split('/').first
|
19
20
|
head.gsub!(/#.*/, '')
|
20
21
|
(head.scan(/..?/).first(4) + [identifier]).join('/')
|
data/spec/unit/noid_spec.rb
CHANGED
@@ -19,5 +19,17 @@ describe ActiveFedora::Noid do
|
|
19
19
|
let(:id) { 'abc123z' }
|
20
20
|
it { is_expected.to eq 'ab/c1/23/z/abc123z' }
|
21
21
|
end
|
22
|
+
context 'with an empty string' do
|
23
|
+
let(:id) { '' }
|
24
|
+
it 'raises ArgumentError' do
|
25
|
+
expect { subject }.to raise_error(ArgumentError)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
context 'with a nil' do
|
29
|
+
let(:id) { nil }
|
30
|
+
it 'raises ArgumentError' do
|
31
|
+
expect { subject }.to raise_error(ArgumentError)
|
32
|
+
end
|
33
|
+
end
|
22
34
|
end
|
23
35
|
end
|
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.3
|
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-10-
|
11
|
+
date: 2016-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active-fedora
|