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 CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/gateway.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gateway"
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aaron Qian"]
@@ -4,14 +4,16 @@ module Gateway
4
4
  DEFAULT_TIMEOUT = 2
5
5
 
6
6
  def timeout
7
- @timeout ||= (options[:timeout] || Gateway::Feature::Timeout::DEFAULT_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
- return block.call if opts[:timeout] == false
14
- t = opts[:timeout] || timeout
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.1
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: -387436425427271469
172
+ hash: 3427182143372525761
173
173
  required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  none: false
175
175
  requirements: