rubydora 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +11 -3
- data/Gemfile +6 -1
- data/VERSION +1 -1
- data/lib/rubydora/datastream.rb +1 -1
- data/lib/rubydora/digital_object.rb +2 -2
- data/lib/rubydora/rest_api_client.rb +2 -1
- data/rubydora.gemspec +1 -1
- data/spec/lib/rest_api_client_spec.rb +9 -3
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 283e07c7b8a3559fce167acad996756d217405f3463579795f6c8a6c6f535add
|
4
|
+
data.tar.gz: 5d61c1d7484ceb91828f5fa913dca3d727b0070f9679a2dc8ac3a500d8e9d407
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1691f6d6d653812b34d8fe683b5aa527e9f56f3d12b3acd14325ced70f3b386856d2678f48ae2cb5a3f3f158d53870a915f28beba5bfc111eebec96a547d20cf
|
7
|
+
data.tar.gz: 8b4f090c7b293a38ed49841af0532a4d87ab839f492ab659e2607f96ac3c36ffc77999984fb8d3d4d30b33e50bf4f7fb78bf753e22465dcf452a3a33da53a5c9
|
data/.travis.yml
CHANGED
@@ -1,11 +1,19 @@
|
|
1
1
|
sudo: false
|
2
2
|
language: ruby
|
3
3
|
rvm:
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
- 2.
|
4
|
+
- 2.3.7
|
5
|
+
- 2.4.4
|
6
|
+
- 2.5.1
|
7
|
+
|
7
8
|
jdk:
|
8
9
|
- oraclejdk8
|
10
|
+
|
11
|
+
matrix:
|
12
|
+
include:
|
13
|
+
- rvm: 2.5.1
|
14
|
+
env: ACTIVEMODEL_VERSION=5.1.6
|
15
|
+
- rvm: 2.2.10
|
16
|
+
env: ACTIVEMODEL_VERSION=4.2.10
|
9
17
|
env:
|
10
18
|
global:
|
11
19
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
data/Gemfile
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
+
if ENV['ACTIVEMODEL_VERSION']
|
4
|
+
gem 'activemodel', ENV['ACTIVEMODEL_VERSION']
|
5
|
+
end
|
3
6
|
gemspec
|
4
7
|
|
5
8
|
gem 'jruby-openssl', :platform => :jruby
|
6
|
-
|
9
|
+
|
10
|
+
# We can remove this when we upgrade rspec.
|
11
|
+
# See https://github.com/ruby/rake/issues/116
|
7
12
|
gem 'rake', '< 12'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.1.0
|
data/lib/rubydora/datastream.rb
CHANGED
@@ -198,7 +198,7 @@ module Rubydora
|
|
198
198
|
p = to_api_params
|
199
199
|
unless p.empty?
|
200
200
|
mod_time = repository.modify_object p.merge(:pid => pid)
|
201
|
-
|
201
|
+
clear_changes_information
|
202
202
|
end
|
203
203
|
end
|
204
204
|
end
|
@@ -206,7 +206,7 @@ module Rubydora
|
|
206
206
|
# mod_time will be nil on new objects with no ds changes
|
207
207
|
unless mod_time.nil?
|
208
208
|
self.lastModifiedDate = mod_time
|
209
|
-
|
209
|
+
clear_attribute_changes(['lastModifiedDate'])
|
210
210
|
end
|
211
211
|
self
|
212
212
|
end
|
@@ -309,6 +309,7 @@ module Rubydora
|
|
309
309
|
dsid = query_options.delete(:dsid)
|
310
310
|
method = query_options.delete(:method)
|
311
311
|
method ||= :get
|
312
|
+
request_headers = query_options.delete(:headers) || {}
|
312
313
|
raise self.class.name + "#datastream_dissemination requires a DSID" unless dsid
|
313
314
|
if block_given?
|
314
315
|
resource = safe_subresource(datastream_content_url(pid, dsid, query_options), :block_response => block_response)
|
@@ -317,7 +318,7 @@ module Rubydora
|
|
317
318
|
end
|
318
319
|
val = nil
|
319
320
|
benchmark "Loaded datastream content #{pid}/#{dsid}", :level=>:debug do
|
320
|
-
val = resource.send(method)
|
321
|
+
val = resource.send(method, request_headers)
|
321
322
|
end
|
322
323
|
val
|
323
324
|
rescue Exception => exception
|
data/rubydora.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_dependency 'equivalent-xml'
|
22
22
|
s.add_dependency 'mime-types'
|
23
23
|
s.add_dependency 'activesupport'
|
24
|
-
s.add_dependency 'activemodel'
|
24
|
+
s.add_dependency 'activemodel', '>= 4.2.10'
|
25
25
|
s.add_dependency 'hooks', '~> 0.3'
|
26
26
|
s.add_dependency 'deprecation'
|
27
27
|
|
@@ -216,9 +216,15 @@ describe Rubydora::RestApiClient do
|
|
216
216
|
end
|
217
217
|
end
|
218
218
|
|
219
|
-
|
220
|
-
|
221
|
-
|
219
|
+
describe "datastream_dissemination" do
|
220
|
+
it "works without request headers" do
|
221
|
+
RestClient::Request.should_receive(:execute).with(hash_including(:url => base_url + "/" + datastream_content_url('mypid', 'aaa')))
|
222
|
+
@mock_repository.datastream_dissemination :pid => 'mypid', :dsid => 'aaa'
|
223
|
+
end
|
224
|
+
it "works with request headers" do
|
225
|
+
RestClient::Request.should_receive(:execute).with(hash_including(:url => base_url + "/" + datastream_content_url('mypid', 'aaa'), :headers => {'Bat-Man' => 'Forever'}))
|
226
|
+
@mock_repository.datastream_dissemination :pid => 'mypid', :dsid => 'aaa', :headers => {'Bat-Man' => 'Forever'}
|
227
|
+
end
|
222
228
|
end
|
223
229
|
it "should allow http methods besides GET on datastream_dissemination" do
|
224
230
|
RestClient::Request.should_receive(:execute).with(hash_including(:method => :head))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubydora
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Beer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 4.2.10
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 4.2.10
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: hooks
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
version: '0'
|
289
289
|
requirements: []
|
290
290
|
rubyforge_project:
|
291
|
-
rubygems_version: 2.
|
291
|
+
rubygems_version: 2.7.1
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: Fedora Commons REST API ruby library
|