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 +4 -4
- data/.gitignore +1 -0
- data/CHANGES.md +4 -0
- data/lib/stash/sword/http_helper.rb +5 -4
- data/lib/stash/sword/log_utils.rb +5 -5
- data/lib/stash/sword/module_info.rb +1 -1
- data/stash-sword.gemspec +1 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b3e44c8bb4871f84260615f8bead45b3f6488d6
|
4
|
+
data.tar.gz: f04601814a457eef4f365001749d90c03d118704
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01b28156a2f091609153ee3caab668f5ff3282fcf5716fe20cdfd78d12c00985b106438cbbbb9fc7a19649d255aa8bfc731dc070729a927854c041c5b26ac650
|
7
|
+
data.tar.gz: f6b6d29c0e73c99a87efa9ecc2074ef86f30c8bbf071c0337fbd94763086dd638189ab5a2ef200ad80246ce67b7b2a2b04aaa6d0013799576ad6ea0863130814
|
data/.gitignore
CHANGED
data/CHANGES.md
CHANGED
@@ -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
|
-
|
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
|
-
|
73
|
-
|
74
|
-
|
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)
|
data/stash-sword.gemspec
CHANGED
@@ -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
|
+
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-
|
11
|
+
date: 2016-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|