angus-remote 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmE1OGJhNmE2OTA2NDc5YjgwMWQ2ODhmNzExN2ZjYzhjMmI5YWRiOA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGVlNjc5Y2JhNThiYWQzNTkzYTA4Yjc0MGVkYzUxZDRmN2IyMzgxNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDQ3NzUyZGMxOTI3NGM4ZWQ3Y2YzYWNhYzM5NGIzYTA3ZTNhZDFjNzVlNTRi
|
10
|
+
MjY4MGM2N2NiNzkzMGU1YzRiNTdiM2ZkMzBjZTIwZjhiNjc2MmZhOWQ3ZDc1
|
11
|
+
MGMyMjljNzRmODA0NzViNDhmNjhhOWIzYjA3MDYwZWZkZjJmNGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGE2NjNlMjdhYTJkMzhhMWViMjU5ODkyNjk1NjIwYzMwMDIxYTk1NDFjM2Fm
|
14
|
+
YjlkOGQ1ZjNjZDI2M2Y5ODhlMjZjYjA5NDAxMDIyZTgzNjg0MDQyZTJkMzZi
|
15
|
+
NmZlOWJkMjdjN2ZhYWQ5YTk1ODJiMWJjYTkzNjE3YjU5Nzk4ZTc=
|
data/lib/angus/remote/client.rb
CHANGED
@@ -22,10 +22,8 @@ module Angus
|
|
22
22
|
:force_retry => false,
|
23
23
|
:url => api_url,
|
24
24
|
|
25
|
-
:keep_alive => timeout,
|
26
25
|
:read_timeout => timeout,
|
27
|
-
:open_timeout => timeout
|
28
|
-
:idle_timeout => timeout
|
26
|
+
:open_timeout => timeout
|
29
27
|
)
|
30
28
|
|
31
29
|
@api_base_path = @connection.default_path
|
@@ -72,8 +70,8 @@ module Angus
|
|
72
70
|
end
|
73
71
|
|
74
72
|
response
|
75
|
-
rescue Errno::ECONNREFUSED, PersistentHTTP::Error
|
76
|
-
raise RemoteConnectionError.new(
|
73
|
+
rescue Errno::ECONNREFUSED, PersistentHTTP::Error => e
|
74
|
+
raise RemoteConnectionError.new("#@api_base_path - #{e.class}: #{e.message}")
|
77
75
|
end
|
78
76
|
end
|
79
77
|
|
@@ -10,9 +10,7 @@ module Angus
|
|
10
10
|
# A client for service invocation when proxing requests.
|
11
11
|
class ProxyClient
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
def initialize(url, timeout = DEFAULT_TIMEOUT)
|
13
|
+
def initialize(url, timeout)
|
16
14
|
url = url[0..-2] if url[-1] == '/'
|
17
15
|
|
18
16
|
@connection = PersistentHTTP.new(
|
@@ -44,8 +42,8 @@ module Angus
|
|
44
42
|
)
|
45
43
|
|
46
44
|
[response.code.to_i, from_headers, [response.body]]
|
47
|
-
rescue Errno::ECONNREFUSED
|
48
|
-
raise RemoteConnectionError.new(self.class.base_uri)
|
45
|
+
rescue Errno::ECONNREFUSED => e
|
46
|
+
raise RemoteConnectionError.new("#{self.class.base_uri} - #{e.class}: #{e.message}")
|
49
47
|
end
|
50
48
|
end
|
51
49
|
|
@@ -38,8 +38,8 @@ module Angus
|
|
38
38
|
service_settings(code_name, version))
|
39
39
|
@clients_cache[[code_name, version]] = client
|
40
40
|
|
41
|
-
rescue Errno::ECONNREFUSED
|
42
|
-
raise RemoteConnectionError.new(self.api_url(code_name, version))
|
41
|
+
rescue Errno::ECONNREFUSED => e
|
42
|
+
raise RemoteConnectionError.new("#{self.api_url(code_name, version)} - #{e.class}: #{e.message}")
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
@@ -204,8 +204,8 @@ module Angus
|
|
204
204
|
authentication_client(code_name, version).store_session_private_key(response)
|
205
205
|
|
206
206
|
JSON(response.body)
|
207
|
-
rescue Exception
|
208
|
-
raise RemoteConnectionError.new(uri)
|
207
|
+
rescue Exception => e
|
208
|
+
raise RemoteConnectionError.new("#{uri} - #{e.class}: #{e.message}")
|
209
209
|
end
|
210
210
|
private_class_method :fetch_remote_service_definition
|
211
211
|
|
@@ -18,12 +18,9 @@ module Angus
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
DEFAULT_CONFIGURATION_FILE = 'config/services.yml'
|
23
|
-
|
24
|
-
add_option(:default_timeout, DEFAULT_TIMEOUT)
|
21
|
+
add_option(:default_timeout, 60)
|
25
22
|
add_option(:redis, {})
|
26
|
-
add_option(:configuration_file,
|
23
|
+
add_option(:configuration_file, 'config/services.yml')
|
27
24
|
|
28
25
|
end
|
29
26
|
|
data/lib/angus/remote/version.rb
CHANGED
@@ -24,23 +24,23 @@ describe Http::Multipart do
|
|
24
24
|
describe '.hash_contains_files?' do
|
25
25
|
|
26
26
|
it 'should return true if one of the values in the passed hash is a file' do
|
27
|
-
Http::Multipart.hash_contains_files?({:a => 1, :file => file}).should
|
27
|
+
Http::Multipart.hash_contains_files?({:a => 1, :file => file}).should be_truthy
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'should return true if one of the values in the passed hash is an upload io' do
|
31
|
-
Http::Multipart.hash_contains_files?({:a => 1, :file => some_upload_io}).should
|
31
|
+
Http::Multipart.hash_contains_files?({:a => 1, :file => some_upload_io}).should be_truthy
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'should return true if one of the values in the passed hash is a tempfile' do
|
35
|
-
Http::Multipart.hash_contains_files?({:a => 1, :file => tempfile}).should
|
35
|
+
Http::Multipart.hash_contains_files?({:a => 1, :file => tempfile}).should be_truthy
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'should return false if none of the values in the passed hash is a file' do
|
39
|
-
Http::Multipart.hash_contains_files?({:a => 1, :b => 'nope'}).should
|
39
|
+
Http::Multipart.hash_contains_files?({:a => 1, :b => 'nope'}).should be_falsey
|
40
40
|
end
|
41
41
|
|
42
42
|
it 'should return true if passed hash includes an a array of files' do
|
43
|
-
Http::Multipart.hash_contains_files?({:files => [file, file]}).should
|
43
|
+
Http::Multipart.hash_contains_files?({:files => [file, file]}).should be_truthy
|
44
44
|
end
|
45
45
|
|
46
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angus-remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Gomez
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: angus-sdoc
|
@@ -115,6 +115,20 @@ dependencies:
|
|
115
115
|
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '2.14'
|
118
|
+
- !ruby/object:Gem::Dependency
|
119
|
+
name: rspec-its
|
120
|
+
requirement: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
type: :development
|
126
|
+
prerelease: false
|
127
|
+
version_requirements: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
118
132
|
- !ruby/object:Gem::Dependency
|
119
133
|
name: mock_redis
|
120
134
|
requirement: !ruby/object:Gem::Requirement
|