active_fedora-noid 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7bd89b0820e29801ab139ee09443af8923c1555c
4
- data.tar.gz: 471b61afe7180057c9ee56e10b6cf37a1c2ab601
3
+ metadata.gz: 6446754cabf2a22e8eae027802d7942426864850
4
+ data.tar.gz: 5d51111c27e8c1309a444aeddda08bea68dd3661
5
5
  SHA512:
6
- metadata.gz: 339cf5a5e562170ad083e43735479717bda1d549bf8ac4fc3f18dc3f6965064d6bb060e35dbb68e9ecef27755a872104fec65dcecd7d89f6f31a996cae28da64
7
- data.tar.gz: 0c0905dd30112fbf3cccbf4ff1547361ba3c8bf1d9dca360584108a859b10f44196ec0efe502c89ab766d5035060731dedf16c59bd67ad2495b598ba707593ff
6
+ metadata.gz: 48bef1383643f5db414d54d8f97ec82aa4b76c56cbeaed279e23f5414640eb29a28239f204f3bfb8bdb7f22a327435c509b86e2f1d350bb2f2279889cf698ce4
7
+ data.tar.gz: ea0eaa7f2b189a77f8f9addd1ba3a516e2f2009940943015df2e1deb1be498a9ab22e04dc077c733ad4d3740567325b65077692bb66d653e584a24b3514c5e81
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^spec/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency 'active-fedora', '~> 9.0'
20
+ spec.add_dependency 'active-fedora', '~> 9.7'
21
21
  spec.add_dependency 'noid', '~> 0.7'
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.7"
@@ -13,7 +13,7 @@ module ActiveFedora
13
13
  Mutex.new.synchronize do
14
14
  while true
15
15
  pid = next_id
16
- return pid unless ActiveFedora::Base.exists?(pid)
16
+ return pid unless ActiveFedora::Base.exists?(pid) || ActiveFedora::Base.gone?(pid)
17
17
  end
18
18
  end
19
19
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveFedora
2
2
  module Noid
3
- VERSION = '1.0.2'
3
+ VERSION = '1.0.3'
4
4
  end
5
5
  end
@@ -30,6 +30,7 @@ describe ActiveFedora::Noid::SynchronizedMinter do
30
30
  describe '#mint' do
31
31
  before do
32
32
  allow(ActiveFedora::Base).to receive(:exists?).and_return(false)
33
+ allow(ActiveFedora::Base).to receive(:gone?).and_return(false)
33
34
  end
34
35
 
35
36
  subject { ActiveFedora::Noid::Service.new.mint }
@@ -53,10 +54,27 @@ describe ActiveFedora::Noid::SynchronizedMinter do
53
54
  allow_any_instance_of(ActiveFedora::Noid::SynchronizedMinter).to receive(:next_id).and_return(existing_pid, unique_pid)
54
55
  allow(ActiveFedora::Base).to receive(:exists?).with(existing_pid).and_return(true)
55
56
  allow(ActiveFedora::Base).to receive(:exists?).with(unique_pid).and_return(false)
57
+ allow(ActiveFedora::Base).to receive(:gone?).and_return(false)
56
58
  end
57
59
 
58
60
  it 'skips the existing pid' do
59
61
  expect(subject.mint).to eq unique_pid
60
62
  end
61
63
  end
64
+
65
+ context "when the pid already existed in Fedora and now is gone" do
66
+ let(:gone_pid) { 'ef12ef12f' }
67
+ let(:unique_pid) { 'bb22bb22b' }
68
+
69
+ before do
70
+ allow_any_instance_of(ActiveFedora::Noid::SynchronizedMinter).to receive(:next_id).and_return(gone_pid, unique_pid)
71
+ allow(ActiveFedora::Base).to receive(:gone?).with(gone_pid).and_return(true)
72
+ allow(ActiveFedora::Base).to receive(:gone?).with(unique_pid).and_return(false)
73
+ allow(ActiveFedora::Base).to receive(:exists?).and_return(false)
74
+ end
75
+
76
+ it 'skips the deleted pid' do
77
+ expect(subject.mint).to eq unique_pid
78
+ end
79
+ end
62
80
  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.0.2
4
+ version: 1.0.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: 2015-08-11 00:00:00.000000000 Z
11
+ date: 2015-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active-fedora
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '9.0'
19
+ version: '9.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '9.0'
26
+ version: '9.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: noid
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.4.8
133
+ rubygems_version: 2.2.2
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Noid identifier services for ActiveFedora-based applications