multiconnect 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1e5808b71957ab6a552635704ed899384eb7893
|
4
|
+
data.tar.gz: 0a4d19c0b30e97fa4c61612b190c9c1219aa2e8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6a55e27bb7a078c0263da226ba33669a6f1e126427ff608316cceb9d8952b6fed5fb51ea5cc133b45bec9594c2a20589244499f48777a5275b08814abd0cbe8
|
7
|
+
data.tar.gz: fe2867a1fea129ea979783116fead2c1a940e82288e74945962ff8d221e4e64929ece06dff302daab9096939de761507864a73943d9a9f23e50271f25e4820d1
|
@@ -15,12 +15,13 @@ module Multiconnect
|
|
15
15
|
self._connections = [connection_class.new(options)] + _connections
|
16
16
|
end
|
17
17
|
|
18
|
-
def request(action, *args)
|
18
|
+
def request(action, *args, &default)
|
19
19
|
self._connections.each do |connection|
|
20
20
|
result = connection.execute(action, *args)
|
21
21
|
return result if result.success?
|
22
22
|
end
|
23
|
-
|
23
|
+
|
24
|
+
raise Multiconnect::Error::UnsuccessfulRequestError.new( class: self, action: action )
|
24
25
|
end
|
25
26
|
end
|
26
27
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Multiconnect
|
2
|
+
module Error
|
3
|
+
class UnsuccessfulRequestError < StandardError
|
4
|
+
def initialize(opts = {})
|
5
|
+
@class = opts.fetch :class, nil
|
6
|
+
@action = opts.fetch :action, nil
|
7
|
+
end
|
8
|
+
|
9
|
+
def message
|
10
|
+
"#{@class}: Failed to request #{@action}"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/multiconnect/version.rb
CHANGED
data/lib/multiconnect.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multiconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Orlov
|
@@ -115,6 +115,8 @@ files:
|
|
115
115
|
- lib/multiconnect/connection.rb
|
116
116
|
- lib/multiconnect/connection/base.rb
|
117
117
|
- lib/multiconnect/connection/result.rb
|
118
|
+
- lib/multiconnect/error.rb
|
119
|
+
- lib/multiconnect/error/unsuccessful_request_error.rb
|
118
120
|
- lib/multiconnect/version.rb
|
119
121
|
- multiconnect.gemspec
|
120
122
|
homepage: https://github.com/gaorlov/multiconnect
|