stash-sword 0.1.4 → 0.1.5

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: b73e085f5409cc5c2b3a74c703aacb670bffdc46
4
- data.tar.gz: d393a54966e95e40d97d6019022781547fecdad2
3
+ metadata.gz: 1b3e44c8bb4871f84260615f8bead45b3f6488d6
4
+ data.tar.gz: f04601814a457eef4f365001749d90c03d118704
5
5
  SHA512:
6
- metadata.gz: 49f4a2eddae1eac20a7b8ee10c707287ca10f2e7390bab19fb7ac17a9e809a049a5f680112aa5059c76f2af6d38336ac297783d42786bb03b35230433e7f9787
7
- data.tar.gz: 397fcf71c55dad279545b735274293c108989c0e604baa8ad488679cdc88b5beca0a97dfe15fdbfaf85cbd4f8e64167a44d7bacd954ac7dafd4b5af1fcca6664
6
+ metadata.gz: 01b28156a2f091609153ee3caab668f5ff3282fcf5716fe20cdfd78d12c00985b106438cbbbb9fc7a19649d255aa8bfc731dc070729a927854c041c5b26ac650
7
+ data.tar.gz: f6b6d29c0e73c99a87efa9ecc2074ef86f30c8bbf071c0337fbd94763086dd638189ab5a2ef200ad80246ce67b7b2a2b04aaa6d0013799576ad6ea0863130814
data/.gitignore CHANGED
@@ -32,6 +32,7 @@ db/*.sqlite3
32
32
  *.iws
33
33
  *.ids
34
34
  .rakeTasks
35
+ .idea
35
36
 
36
37
  # Emacs
37
38
 
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.5 (21 November 2016)
2
+
3
+ - Pass `read_timeout` and `open_timeout` explicitly for clarity.
4
+
1
5
  ## 0.1.4 (14 November 2016)
2
6
 
3
7
  - Update to Ruby 2.2.5
@@ -37,7 +37,7 @@ module Stash
37
37
  # @param redirect_limit [Integer] the number of redirects to follow before erroring out
38
38
  # (defaults to {DEFAULT_MAX_REDIRECTS})
39
39
  # @param logger [Logger, nil] the logger to use, or nil to use a default logger
40
- def initialize(user_agent:, username: nil, password: nil, redirect_limit: DEFAULT_MAX_REDIRECTS, timeout: DEFAULT_TIMEOUT, logger: nil)
40
+ def initialize(user_agent:, username: nil, password: nil, redirect_limit: DEFAULT_MAX_REDIRECTS, timeout: DEFAULT_TIMEOUT, logger: nil) # rubocop:disable Metrics/ParameterLists
41
41
  @user_agent = user_agent
42
42
  @redirect_limit = redirect_limit
43
43
  @timeout = timeout
@@ -77,20 +77,21 @@ module Stash
77
77
  }.freeze
78
78
  end
79
79
 
80
- def do_post_or_put(method:, uri:, payload:, headers:, limit:, timeout:)
80
+ def do_post_or_put(method:, uri:, payload:, headers:, limit:, timeout:) # rubocop:disable Metrics/ParameterLists
81
81
  options = request_options(headers, limit, method, payload, uri, timeout)
82
82
  log_hash(options)
83
83
  RestClient::Request.execute(**options)
84
84
  end
85
85
 
86
- def request_options(headers, limit, method, payload, uri, timeout)
86
+ def request_options(headers, limit, method, payload, uri, timeout) # rubocop:disable Metrics/MethodLength, Metrics/ParameterLists
87
87
  options = {
88
88
  method: method,
89
89
  url: uri.to_s,
90
90
  payload: payload,
91
91
  headers: headers.merge(default_headers),
92
92
  max_redirects: limit,
93
- timeout: timeout
93
+ open_timeout: timeout,
94
+ read_timeout: timeout
94
95
  }
95
96
  options[:user] = username if username
96
97
  options[:password] = password if password
@@ -68,11 +68,11 @@ module Stash
68
68
  def append_response(msg_lines, e)
69
69
  return unless e.respond_to?(:response) && e.response
70
70
  response = e.response
71
- msg_lines.unshift(*[
72
- "code: #{response.code}",
73
- 'headers:', hash_to_log_msg(response.headers),
74
- "body:\n#{response.body}"
75
- ])
71
+ msg_lines.unshift(
72
+ "code: #{response.code}",
73
+ 'headers:', hash_to_log_msg(response.headers),
74
+ "body:\n#{response.body}"
75
+ )
76
76
  end
77
77
 
78
78
  def append_backtrace(msg_lines, e)
@@ -4,7 +4,7 @@ module Stash
4
4
  NAME = 'stash-sword'.freeze
5
5
 
6
6
  # The version of this gem
7
- VERSION = '0.1.4'.freeze
7
+ VERSION = '0.1.5'.freeze
8
8
 
9
9
  # The copyright notice for this gem
10
10
  COPYRIGHT = 'Copyright (c) 2016 The Regents of the University of California'.freeze
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require 'uri'
6
6
  require 'stash/sword/module_info'
7
7
 
8
- Gem::Specification.new do |spec|
8
+ Gem::Specification.new do |spec| # rubocop:disable Metrics/BlockLength
9
9
  spec.name = Stash::Sword::NAME
10
10
  spec.version = Stash::Sword::VERSION
11
11
  spec.authors = ['David Moles']
@@ -28,12 +28,6 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency 'typesafe_enum', '~> 0.1', '>= 0.1.7'
29
29
  spec.add_dependency 'xml-mapping_extensions', '~> 0.4', '>= 0.4.1'
30
30
 
31
- # spec.add_dependency 'swordruby', '~> 1.0'
32
- # spec.add_dependency 'multipart-post', '~> 2.0'
33
- #
34
- # spec.add_dependency 'stash-wrapper', '~> 0.1', '>= 0.1.2'
35
- # spec.add_dependency 'datacite-mapping', '~> 0.1', '>= 0.1.8'
36
-
37
31
  spec.add_development_dependency 'equivalent-xml', '~> 0.6.0'
38
32
 
39
33
  spec.add_development_dependency 'bundler', '~> 1.7'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stash-sword
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Moles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-14 00:00:00.000000000 Z
11
+ date: 2016-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client