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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f135092fa34c604d6cb3d8f32550fa05ad6c9cf0
4
- data.tar.gz: 410e8527aff25c3cbd0af821feddb16e2e80b577
2
+ SHA256:
3
+ metadata.gz: 283e07c7b8a3559fce167acad996756d217405f3463579795f6c8a6c6f535add
4
+ data.tar.gz: 5d61c1d7484ceb91828f5fa913dca3d727b0070f9679a2dc8ac3a500d8e9d407
5
5
  SHA512:
6
- metadata.gz: 161d6e64dcf7ce12b490c215eb6d5c33609e526596a91dd0777f7d4c681c2a49435f2b4f04b307ff5701cfa47c0d3ee4fd385b58ef94fa12d93a302a76bc5097
7
- data.tar.gz: b872044de36daf6c140e4b10caaa884a2408b06c2b10f9318fa0afb6ab05e8c83324268076401cac4cd012ef61ef4d8b3864eceb506a4061cc7411f3de86fd51
6
+ metadata.gz: 1691f6d6d653812b34d8fe683b5aa527e9f56f3d12b3acd14325ced70f3b386856d2678f48ae2cb5a3f3f158d53870a915f28beba5bfc111eebec96a547d20cf
7
+ data.tar.gz: 8b4f090c7b293a38ed49841af0532a4d87ab839f492ab659e2607f96ac3c36ffc77999984fb8d3d4d30b33e50bf4f7fb78bf753e22465dcf452a3a33da53a5c9
@@ -1,11 +1,19 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.1.10
5
- - 2.2.5
6
- - 2.3.1
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
- gem 'activesupport', '< 5' if RUBY_VERSION < '2.2.2'
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.0.0
1
+ 2.1.0
@@ -387,7 +387,7 @@ module Rubydora
387
387
  @profile = nil
388
388
  @datastream_content = nil
389
389
  @content = nil
390
- @changed_attributes = {}
390
+ clear_attribute_changes(DS_ATTRIBUTES.keys)
391
391
  end
392
392
 
393
393
  # repository reference from the digital object
@@ -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
- changed_attributes.clear
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
- changed_attributes.delete 'lastModifiedDate'
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
@@ -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
- it "datastream_dissemination" do
220
- RestClient::Request.should_receive(:execute).with(hash_including(:url => base_url + "/" + datastream_content_url('mypid', 'aaa')))
221
- @mock_repository.datastream_dissemination :pid => 'mypid', :dsid => 'aaa'
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.0.0
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: 2017-02-02 00:00:00.000000000 Z
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: '0'
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: '0'
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.6.8
291
+ rubygems_version: 2.7.1
292
292
  signing_key:
293
293
  specification_version: 4
294
294
  summary: Fedora Commons REST API ruby library