ezid-client 1.6.0 → 1.7.0
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/.travis.yml +0 -1
- data/README.md +51 -8
- data/VERSION +1 -1
- data/ezid-client.gemspec +2 -2
- data/lib/ezid/{batch_enumerator.rb → batch.rb} +2 -2
- data/lib/ezid/batch_download.rb +4 -0
- data/lib/ezid/identifier.rb +56 -19
- data/spec/integration/batch_download_spec.rb +4 -4
- data/spec/spec_helper.rb +1 -1
- data/spec/unit/{batch_enumerator_spec.rb → batch_spec.rb} +2 -2
- data/spec/unit/identifier_spec.rb +54 -15
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29be4a8ee7e9324b32396aa18c4dbc2fc684f16b
|
4
|
+
data.tar.gz: 5746bcf0dd21f7e1aa7863a314a327771a78656f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 189e565149ec7b6fc473c337e9c53ee66472fc3028794de24e5270ae6723dd85026386f3c2ded8bee78e40166c0306fb017549d9adbfdc41c8ec12de660db04d
|
7
|
+
data.tar.gz: 34b09f0de6db4815d1cffbb9d2bd3655393c2d066a526b8af7cfd3f969fbac58be0602e28dcedaa040f3f57d3e651fc90193441987d429ccf0f90f5ce3967ecc
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -33,9 +33,11 @@ Or install it yourself as:
|
|
33
33
|
>> identifier = Ezid::Identifier.mint("ark:/99999/fk4")
|
34
34
|
I, [2016-03-01T22:20:08.505323 #35148] INFO -- : EZID MintIdentifier -- success: ark:/99999/fk4tq65d6k
|
35
35
|
=> #<Ezid::Identifier id=ark:/99999/fk4tq65d6k>
|
36
|
+
|
36
37
|
>> identifier.status
|
37
38
|
I, [2016-03-01T22:20:22.323650 #35148] INFO -- : EZID GetIdentifierMetadata -- success: ark:/99999/fk4tq65d6k
|
38
39
|
=> "public"
|
40
|
+
|
39
41
|
>> identifier.target
|
40
42
|
=> "http://ezid.cdlib.org/id/ark:/99999/fk4tq65d6k"
|
41
43
|
```
|
@@ -87,11 +89,14 @@ I, [2014-12-04T15:07:00.648676 #86655] INFO -- : EZID GetIdentifierMetadata --
|
|
87
89
|
```
|
88
90
|
>> identifier.target
|
89
91
|
=> "http://ezid.cdlib.org/id/ark:/99999/fk43f4wd4v"
|
92
|
+
|
90
93
|
>> identifier.target = "http://example.com"
|
91
94
|
=> "http://example.com"
|
95
|
+
|
92
96
|
>> identifier.save
|
93
97
|
I, [2014-12-09T11:24:26.321801 #32279] INFO -- : EZID ModifyIdentifier -- success: ark:/99999/fk43f4wd4v
|
94
98
|
=> #<Ezid::Identifier id="ark:/99999/fk43f4wd4v">
|
99
|
+
|
95
100
|
>> identifier.target
|
96
101
|
I, [2014-12-09T11:24:27.039288 #32279] INFO -- : EZID GetIdentifierMetadata -- success: ark:/99999/fk43f4wd4v
|
97
102
|
=> "http://example.com"
|
@@ -107,6 +112,7 @@ I, [2014-12-09T11:24:27.039288 #32279] INFO -- : EZID GetIdentifierMetadata --
|
|
107
112
|
>> identifier = Ezid::Identifier.mint("ark:/99999/fk4", status: "reserved")
|
108
113
|
I, [2016-03-01T22:26:08.645858 #36701] INFO -- : EZID MintIdentifier -- success: ark:/99999/fk4pz5fm1b
|
109
114
|
=> #<Ezid::Identifier id=ark:/99999/fk4pz5fm1b>
|
115
|
+
|
110
116
|
>> identifier.delete
|
111
117
|
I, [2016-03-01T22:26:14.829731 #36701] INFO -- : EZID GetIdentifierMetadata -- success: ark:/99999/fk4pz5fm1b
|
112
118
|
I, [2016-03-01T22:26:15.711390 #36701] INFO -- : EZID DeleteIdentifier -- success: ark:/99999/fk4pz5fm1b
|
@@ -120,22 +126,57 @@ See http://ezid.cdlib.org/doc/apidoc.html#parameters. Repeated values should be
|
|
120
126
|
*Added in v1.3.0:* `Ezid::BatchDownload` class.
|
121
127
|
|
122
128
|
```
|
123
|
-
>>
|
129
|
+
>> batch_download = Ezid::BatchDownload.new(:csv)
|
124
130
|
=> #<Ezid::BatchDownload format=:csv>
|
125
|
-
|
131
|
+
|
132
|
+
>> batch_download.column = ["_id", "_target"]
|
126
133
|
=> ["_id", "_target"]
|
127
|
-
|
134
|
+
|
135
|
+
>> batch_download.createdAfter = Date.today.to_time
|
128
136
|
=> 2016-02-24 00:00:00 -0500
|
129
|
-
|
137
|
+
|
138
|
+
>> batch_download
|
130
139
|
=> #<Ezid::BatchDownload column=["_id", "_target"] createdAfter=1456290000 format=:csv>
|
131
|
-
|
140
|
+
|
141
|
+
>> batch_download.url
|
132
142
|
I, [2016-02-24T18:03:40.828005 #1084] INFO -- : EZID BatchDownload -- success: http://ezid.cdlib.org/download/4a63401e17.csv.gz
|
133
143
|
=> "http://ezid.cdlib.org/download/4a63401e17.csv.gz"
|
134
|
-
|
135
|
-
|
136
|
-
=>
|
144
|
+
|
145
|
+
>> batch_download.file
|
146
|
+
=> /current/working/directory/4a63401e17.csv.gz
|
137
147
|
```
|
138
148
|
|
149
|
+
## Batch
|
150
|
+
|
151
|
+
*Added in v1.6.0.* `Ezid::Batch` class.
|
152
|
+
|
153
|
+
**Version 1.7.0 upgrade note:** This class was originally named `Ezid::BatchEnumerator`, but it is not a Ruby enumerator. `Ezid::Batch` is the new name with the same API.
|
154
|
+
|
155
|
+
```
|
156
|
+
>> require 'ezid/batch'
|
157
|
+
=> true
|
158
|
+
|
159
|
+
>> batch = Ezid::Batch.new(:anvl, "spec/fixtures/anvl_batch.txt")
|
160
|
+
=> #<Ezid::Batch:0x007f87a8900308 @format=:anvl, @batch_file="spec/fixtures/anvl_batch.txt">
|
161
|
+
|
162
|
+
>> id = batch.first
|
163
|
+
=> #<Ezid::Identifier id=ark:/99999/fk4086hs23>
|
164
|
+
|
165
|
+
>> id.target
|
166
|
+
=> "http://example.com"
|
167
|
+
|
168
|
+
>> puts id.metadata
|
169
|
+
_updated: 1488227717
|
170
|
+
_target: http://example.com
|
171
|
+
_profile: erc
|
172
|
+
_ownergroup: apitest
|
173
|
+
_owner: apitest
|
174
|
+
_export: yes
|
175
|
+
_created: 1488227717
|
176
|
+
_status: public
|
177
|
+
=> nil
|
178
|
+
```
|
179
|
+
|
139
180
|
## Metadata handling
|
140
181
|
|
141
182
|
Accessors are provided to ease the use of EZID [reserved metadata elements](http://ezid.cdlib.org/doc/apidoc.html#internal-metadata) and [metadata profiles](http://ezid.cdlib.org/doc/apidoc.html#metadata-profiles):
|
@@ -145,6 +186,7 @@ Accessors are provided to ease the use of EZID [reserved metadata elements](http
|
|
145
186
|
```
|
146
187
|
>> identifier.status # reads "_status" element
|
147
188
|
=> "public"
|
189
|
+
|
148
190
|
>> identifier.status = "unavailable" # writes "_status" element
|
149
191
|
=> "unavailable"
|
150
192
|
```
|
@@ -159,6 +201,7 @@ Notes:
|
|
159
201
|
```
|
160
202
|
>> identifier.dc_type # reads "dc.type" element
|
161
203
|
=> "Collection"
|
204
|
+
|
162
205
|
>> identifier.dc_type = "Image" # writes "dc.type" element
|
163
206
|
=> "Image"
|
164
207
|
```
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.7.0
|
data/ezid-client.gemspec
CHANGED
@@ -17,12 +17,12 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
18
|
spec.require_paths = ["lib"]
|
19
19
|
|
20
|
-
spec.required_ruby_version = "~> 2.
|
20
|
+
spec.required_ruby_version = "~> 2.1"
|
21
21
|
|
22
22
|
spec.add_dependency "hashie", "~> 3.4", ">= 3.4.3"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.7"
|
25
|
-
spec.add_development_dependency "rake"
|
25
|
+
spec.add_development_dependency "rake"
|
26
26
|
spec.add_development_dependency "rspec", "~> 3.4"
|
27
27
|
spec.add_development_dependency "rspec-its", "~> 1.2"
|
28
28
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module Ezid
|
2
|
-
class
|
2
|
+
class Batch
|
3
3
|
include Enumerable
|
4
4
|
|
5
5
|
attr_reader :format, :batch_file
|
@@ -25,7 +25,7 @@ module Ezid
|
|
25
25
|
while record = f.gets("")
|
26
26
|
head, metadata = record.split(/\n/, 2)
|
27
27
|
id = head.sub(/\A::/, "").strip
|
28
|
-
yield
|
28
|
+
yield Identifier.load(id, metadata)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/lib/ezid/batch_download.rb
CHANGED
@@ -84,6 +84,8 @@ module Ezid
|
|
84
84
|
get_response.download_url
|
85
85
|
end
|
86
86
|
|
87
|
+
alias_method :url, :download_url
|
88
|
+
|
87
89
|
def download_file(path: nil)
|
88
90
|
path ||= Dir.getwd
|
89
91
|
fullpath = File.directory?(path) ? File.join(path, download_filename) : path
|
@@ -123,6 +125,8 @@ module Ezid
|
|
123
125
|
fullpath
|
124
126
|
end
|
125
127
|
|
128
|
+
alias_method :file, :download_file
|
129
|
+
|
126
130
|
private
|
127
131
|
|
128
132
|
def download_uri
|
data/lib/ezid/identifier.rb
CHANGED
@@ -65,10 +65,25 @@ module Ezid
|
|
65
65
|
# @return [Ezid::Identifier] the identifier
|
66
66
|
# @raise [Ezid::IdentifierNotFoundError]
|
67
67
|
def modify(id, metadata)
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
68
|
+
allocate.tap do |i|
|
69
|
+
i.id = id
|
70
|
+
i.update_metadata(metadata)
|
71
|
+
i.modify!
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# Loads an identifier with provided remote metadata
|
76
|
+
# The main purpose is to provide an API in a batch processing
|
77
|
+
# context to instantiate Identifiers from a BatchDownload.
|
78
|
+
# @see #load_metadata!
|
79
|
+
# @param id [String] the EZID identifier
|
80
|
+
# @param metadata [String, Hash, Ezid::Metadata] the provided metadata
|
81
|
+
# @return [Ezid::Identifier] the identifier
|
82
|
+
def load(id, metadata = nil)
|
83
|
+
allocate.tap do |i|
|
84
|
+
i.id = id
|
85
|
+
i.load_metadata!(metadata)
|
86
|
+
end
|
72
87
|
end
|
73
88
|
|
74
89
|
# Retrieves an identifier
|
@@ -76,9 +91,10 @@ module Ezid
|
|
76
91
|
# @return [Ezid::Identifier] the identifier
|
77
92
|
# @raise [Ezid::IdentifierNotFoundError] if the identifier does not exist in EZID
|
78
93
|
def find(id)
|
79
|
-
|
80
|
-
|
81
|
-
|
94
|
+
allocate.tap do |i|
|
95
|
+
i.id = id
|
96
|
+
i.load_metadata
|
97
|
+
end
|
82
98
|
end
|
83
99
|
end
|
84
100
|
|
@@ -132,9 +148,14 @@ module Ezid
|
|
132
148
|
# @return [Ezid::Metadata] the metadata
|
133
149
|
def metadata(_=nil)
|
134
150
|
if !_.nil?
|
135
|
-
warn "[DEPRECATION] The parameter of `metadata` is
|
151
|
+
warn "[DEPRECATION] The parameter of `metadata` is ignored and will be removed in 2.0. " \
|
152
|
+
"(called from #{caller.first})"
|
136
153
|
end
|
137
|
-
|
154
|
+
remote_metadata.merge(local_metadata).freeze
|
155
|
+
end
|
156
|
+
|
157
|
+
def local_metadata
|
158
|
+
@local_metadata ||= Metadata.new
|
138
159
|
end
|
139
160
|
|
140
161
|
def remote_metadata
|
@@ -172,7 +193,7 @@ module Ezid
|
|
172
193
|
# @param attrs [Hash] the metadata
|
173
194
|
# @return [Ezid::Identifier] the identifier
|
174
195
|
def update_metadata(attrs={})
|
175
|
-
|
196
|
+
local_metadata.update(attrs)
|
176
197
|
self
|
177
198
|
end
|
178
199
|
|
@@ -203,13 +224,25 @@ module Ezid
|
|
203
224
|
load_metadata
|
204
225
|
end
|
205
226
|
|
206
|
-
# Loads the metadata from EZID
|
227
|
+
# Loads the metadata from EZID and marks the identifier as persisted.
|
207
228
|
# @return [Ezid::Identifier] the identifier
|
208
|
-
# @raise [Ezid::Error]
|
229
|
+
# @raise [Ezid::Error] the identifier is not found or other error.
|
209
230
|
def load_metadata
|
210
231
|
response = client.get_identifier_metadata(id)
|
211
|
-
|
212
|
-
|
232
|
+
load_remote_metadata(response.metadata)
|
233
|
+
persists!
|
234
|
+
self
|
235
|
+
end
|
236
|
+
|
237
|
+
# Loads provided metadata and marks the identifier as persisted.
|
238
|
+
# The main purpose is to provide an API in a batch processing
|
239
|
+
# context to instantiate Identifiers from a BatchDownload.
|
240
|
+
# @see Ezid::BatchEnumerator
|
241
|
+
# @see .load
|
242
|
+
# @param metadata [String, Hash, Ezid::Metadata] the provided metadata
|
243
|
+
# @return [Ezid::Identifier] the identifier
|
244
|
+
def load_metadata!(metadata)
|
245
|
+
load_remote_metadata(metadata)
|
213
246
|
persists!
|
214
247
|
self
|
215
248
|
end
|
@@ -287,7 +320,7 @@ module Ezid
|
|
287
320
|
end
|
288
321
|
|
289
322
|
def reset_metadata
|
290
|
-
|
323
|
+
local_metadata.clear unless local_metadata.empty?
|
291
324
|
remote_metadata.clear unless remote_metadata.empty?
|
292
325
|
end
|
293
326
|
|
@@ -302,7 +335,7 @@ module Ezid
|
|
302
335
|
private
|
303
336
|
|
304
337
|
def local_or_remote_metadata(*args)
|
305
|
-
value =
|
338
|
+
value = local_metadata.send(*args)
|
306
339
|
if value.nil? && persisted?
|
307
340
|
load_metadata if remote_metadata.empty?
|
308
341
|
value = remote_metadata.send(*args)
|
@@ -311,7 +344,7 @@ module Ezid
|
|
311
344
|
end
|
312
345
|
|
313
346
|
def modify
|
314
|
-
client.modify_identifier(id,
|
347
|
+
client.modify_identifier(id, local_metadata)
|
315
348
|
end
|
316
349
|
|
317
350
|
def create_or_mint
|
@@ -319,12 +352,12 @@ module Ezid
|
|
319
352
|
end
|
320
353
|
|
321
354
|
def mint
|
322
|
-
response = client.mint_identifier(shoulder,
|
355
|
+
response = client.mint_identifier(shoulder, local_metadata)
|
323
356
|
self.id = response.id
|
324
357
|
end
|
325
358
|
|
326
359
|
def create
|
327
|
-
client.create_identifier(id,
|
360
|
+
client.create_identifier(id, local_metadata)
|
328
361
|
end
|
329
362
|
|
330
363
|
def persist
|
@@ -340,5 +373,9 @@ module Ezid
|
|
340
373
|
update_metadata(self.class.defaults)
|
341
374
|
end
|
342
375
|
|
376
|
+
def load_remote_metadata(metadata)
|
377
|
+
remote_metadata.replace(metadata)
|
378
|
+
end
|
379
|
+
|
343
380
|
end
|
344
381
|
end
|
@@ -1,18 +1,18 @@
|
|
1
1
|
require 'tempfile'
|
2
2
|
|
3
3
|
module Ezid
|
4
|
-
RSpec.describe BatchDownload do
|
4
|
+
RSpec.describe BatchDownload, integration: true do
|
5
5
|
|
6
6
|
subject do
|
7
7
|
a_week_ago = (Time.now - (7*24*60*60)).to_i
|
8
8
|
described_class.new(:anvl, compression: "zip", permanence: "test", status: "public", createdAfter: a_week_ago)
|
9
9
|
end
|
10
10
|
|
11
|
-
its(:download_url) { is_expected.to match(/\Ahttp:\/\/ezid\.cdlib\.org\/download\/\w+\.zip\z/) }
|
12
|
-
|
13
11
|
specify {
|
12
|
+
expect(subject.download_url).to match(/\Ahttp:\/\/ezid\.cdlib\.org\/download\/\w+\.zip\z/)
|
13
|
+
expect(subject.url).to match(/\Ahttp:\/\/ezid\.cdlib\.org\/download\/\w+\.zip\z/)
|
14
14
|
Dir.mktmpdir do |tmpdir|
|
15
|
-
expect(subject.
|
15
|
+
expect(subject.file(path: tmpdir))
|
16
16
|
.to match(/\A#{tmpdir}\/\w+\.zip\z/)
|
17
17
|
end
|
18
18
|
}
|
data/spec/spec_helper.rb
CHANGED
@@ -76,7 +76,7 @@ RSpec.configure do |config|
|
|
76
76
|
# Print the 10 slowest examples and example groups at the
|
77
77
|
# end of the spec run, to help surface which specs are running
|
78
78
|
# particularly slow.
|
79
|
-
config.profile_examples = 5
|
79
|
+
#config.profile_examples = 5
|
80
80
|
|
81
81
|
# Run specs in random order to surface order dependencies. If you find an
|
82
82
|
# order dependency and want to debug it, you can fix the order by providing
|
@@ -1,6 +1,39 @@
|
|
1
1
|
module Ezid
|
2
2
|
RSpec.describe Identifier do
|
3
|
+
|
3
4
|
describe "class methods" do
|
5
|
+
|
6
|
+
describe ".load" do
|
7
|
+
subject { described_class.load("ark:/99999/fk4086hs23", metadata) }
|
8
|
+
describe "with ANVL metadata" do
|
9
|
+
let(:metadata) do
|
10
|
+
<<-EOS
|
11
|
+
_updated: 1488227717
|
12
|
+
_target: http://example.com
|
13
|
+
_profile: erc
|
14
|
+
_ownergroup: apitest
|
15
|
+
_owner: apitest
|
16
|
+
_export: yes
|
17
|
+
_created: 1488227717
|
18
|
+
_status: public
|
19
|
+
EOS
|
20
|
+
end
|
21
|
+
its(:remote_metadata) {
|
22
|
+
is_expected.to eq({"_updated"=>"1488227717",
|
23
|
+
"_target"=>"http://example.com",
|
24
|
+
"_profile"=>"erc",
|
25
|
+
"_ownergroup"=>"apitest",
|
26
|
+
"_owner"=>"apitest",
|
27
|
+
"_export"=>"yes",
|
28
|
+
"_created"=>"1488227717",
|
29
|
+
"_status"=>"public"})
|
30
|
+
}
|
31
|
+
end
|
32
|
+
describe "with nil" do
|
33
|
+
let(:metadata) { nil }
|
34
|
+
its(:remote_metadata) { is_expected.to be_empty }
|
35
|
+
end
|
36
|
+
end
|
4
37
|
describe ".create" do
|
5
38
|
describe "with id and metadata args" do
|
6
39
|
it "instantiates a new Identifier and saves it" do
|
@@ -63,6 +96,7 @@ module Ezid
|
|
63
96
|
end
|
64
97
|
|
65
98
|
describe "instance methods" do
|
99
|
+
|
66
100
|
describe "#initialize" do
|
67
101
|
before {
|
68
102
|
allow(described_class).to receive(:defaults) { defaults }
|
@@ -129,7 +163,7 @@ module Ezid
|
|
129
163
|
its(:client) { is_expected.to_not eq(client) }
|
130
164
|
end
|
131
165
|
end
|
132
|
-
end
|
166
|
+
end # initialize
|
133
167
|
|
134
168
|
describe "#update" do
|
135
169
|
let(:metadata) { {"status" => "unavailable"} }
|
@@ -172,12 +206,23 @@ module Ezid
|
|
172
206
|
end
|
173
207
|
|
174
208
|
describe "#load_metadata" do
|
209
|
+
subject { described_class.new("id") }
|
175
210
|
let(:metadata) { "_profile: erc" }
|
176
|
-
before { allow(subject).to receive(:id) { "id" } }
|
177
211
|
it "replaces the remote metadata with metadata from EZID" do
|
178
212
|
expect(subject.client).to receive(:get_identifier_metadata).with("id") { double(id: "id", metadata: metadata) }
|
179
|
-
expect(subject.remote_metadata).to receive(:replace).with(metadata)
|
180
213
|
subject.load_metadata
|
214
|
+
expect(subject.remote_metadata).to eq({"_profile"=>"erc"})
|
215
|
+
expect(subject).to be_persisted
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
describe "#load_metadata!" do
|
220
|
+
subject { described_class.new("id") }
|
221
|
+
let(:metadata) { "_profile: erc" }
|
222
|
+
it "replaces the remote metadata with the provided metadata" do
|
223
|
+
subject.load_metadata!(metadata)
|
224
|
+
expect(subject.remote_metadata).to eq({"_profile"=>"erc"})
|
225
|
+
expect(subject).to be_persisted
|
181
226
|
end
|
182
227
|
end
|
183
228
|
|
@@ -323,23 +368,11 @@ module Ezid
|
|
323
368
|
context "when the status is \"unavailable\"" do
|
324
369
|
let(:status) { "#{Status::UNAVAILABLE} | whatever" }
|
325
370
|
context "and no reason is given" do
|
326
|
-
it "logs a warning" do
|
327
|
-
pending "https://github.com/duke-libraries/ezid-client/issues/46"
|
328
|
-
allow_message_expectations_on_nil
|
329
|
-
expect(subject.logger).to receive(:warn)
|
330
|
-
subject.unavailable!
|
331
|
-
end
|
332
371
|
it "does not change the status" do
|
333
372
|
expect { subject.unavailable! }.not_to change(subject, :status)
|
334
373
|
end
|
335
374
|
end
|
336
375
|
context "and a reason is given" do
|
337
|
-
it "logs a warning" do
|
338
|
-
pending "https://github.com/duke-libraries/ezid-client/issues/46"
|
339
|
-
allow_message_expectations_on_nil
|
340
|
-
expect(subject.logger).to receive(:warn)
|
341
|
-
subject.unavailable!("because")
|
342
|
-
end
|
343
376
|
it "should change the status" do
|
344
377
|
expect { subject.unavailable!("because") }.to change(subject, :status).from(status).to("#{Status::UNAVAILABLE} | because")
|
345
378
|
end
|
@@ -382,5 +415,11 @@ module Ezid
|
|
382
415
|
end
|
383
416
|
end
|
384
417
|
end
|
418
|
+
|
419
|
+
describe "#metadata" do
|
420
|
+
it "is frozen" do
|
421
|
+
expect { subject.metadata["foo"] = "bar" }.to raise_error(RuntimeError)
|
422
|
+
end
|
423
|
+
end
|
385
424
|
end
|
386
425
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ezid-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Chandek-Stark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashie
|
@@ -48,16 +48,16 @@ dependencies:
|
|
48
48
|
name: rake
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
|
-
- - "
|
51
|
+
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '0'
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
|
-
- - "
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: rspec
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,8 +103,8 @@ files:
|
|
103
103
|
- VERSION
|
104
104
|
- ezid-client.gemspec
|
105
105
|
- lib/ezid-client.rb
|
106
|
+
- lib/ezid/batch.rb
|
106
107
|
- lib/ezid/batch_download.rb
|
107
|
-
- lib/ezid/batch_enumerator.rb
|
108
108
|
- lib/ezid/client.rb
|
109
109
|
- lib/ezid/configuration.rb
|
110
110
|
- lib/ezid/error.rb
|
@@ -144,7 +144,7 @@ files:
|
|
144
144
|
- spec/integration/identifier_spec.rb
|
145
145
|
- spec/spec_helper.rb
|
146
146
|
- spec/unit/batch_download_request_spec.rb
|
147
|
-
- spec/unit/
|
147
|
+
- spec/unit/batch_spec.rb
|
148
148
|
- spec/unit/client_spec.rb
|
149
149
|
- spec/unit/identifier_spec.rb
|
150
150
|
- spec/unit/metadata_spec.rb
|
@@ -161,7 +161,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
161
161
|
requirements:
|
162
162
|
- - "~>"
|
163
163
|
- !ruby/object:Gem::Version
|
164
|
-
version: '2.
|
164
|
+
version: '2.1'
|
165
165
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
166
|
requirements:
|
167
167
|
- - ">="
|
@@ -180,7 +180,7 @@ test_files:
|
|
180
180
|
- spec/integration/identifier_spec.rb
|
181
181
|
- spec/spec_helper.rb
|
182
182
|
- spec/unit/batch_download_request_spec.rb
|
183
|
-
- spec/unit/
|
183
|
+
- spec/unit/batch_spec.rb
|
184
184
|
- spec/unit/client_spec.rb
|
185
185
|
- spec/unit/identifier_spec.rb
|
186
186
|
- spec/unit/metadata_spec.rb
|