gateway 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/gateway.gemspec +1 -1
- data/lib/gateway/feature/timeout.rb +5 -3
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/gateway.gemspec
CHANGED
@@ -4,14 +4,16 @@ module Gateway
|
|
4
4
|
DEFAULT_TIMEOUT = 2
|
5
5
|
|
6
6
|
def timeout
|
7
|
-
@timeout ||=
|
7
|
+
@timeout ||= options.fetch :timeout,
|
8
|
+
Gateway::Feature::Timeout::DEFAULT_TIMEOUT
|
8
9
|
end
|
9
10
|
|
10
11
|
protected
|
11
12
|
|
12
13
|
def with_timeout(opts={}, &block)
|
13
|
-
|
14
|
-
|
14
|
+
t = opts.fetch(:timeout, timeout)
|
15
|
+
|
16
|
+
return block.call if t == false
|
15
17
|
|
16
18
|
# if the timeout is 0 or negative, timeout is raised
|
17
19
|
# without executing the block
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gateway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -169,7 +169,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
169
169
|
version: '0'
|
170
170
|
segments:
|
171
171
|
- 0
|
172
|
-
hash:
|
172
|
+
hash: 3427182143372525761
|
173
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
174
|
none: false
|
175
175
|
requirements:
|