watership 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b81f52be62e1afd94b281b277db48de7b3b840e5
4
- data.tar.gz: a2b662d3ab5fb052dd456391bea188e31a4f6eb2
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDRlOTVhZGM1OGI4ZDUwMWZhMzY1MWY0YmVhNmEwOGM1YmFmMGQ1OA==
5
+ data.tar.gz: !binary |-
6
+ YWY5OWE4ZmM2ZmYxMWFlZGYxOTQ4M2VhNWFhZmNiMmQzZmYxNzlkOQ==
5
7
  SHA512:
6
- metadata.gz: f150f7a740e51ffcb47bd4f5d2a7bc9c48410631bb2d3e4b651cdfab61d752249c971de930143e7cc77c3e121428bd33109024f0b25034410c794fa159fd845f
7
- data.tar.gz: 6144a2c707403801ee66254461edaf46c7227b39957d832764c7d9f60fa96a9514dd9125604bd29dfa96ea89e1962ebd2da1929718a5e1e1aca1a2404d32bf1f
8
+ metadata.gz: !binary |-
9
+ NjExN2FhNzhlMGQxOTZhZjNhYmExZTRlMzA0MWIzYWMxZTBiOGI1N2U2NDEz
10
+ Njk5MTQxMzYyM2I2YmRkNDI0Zjk5ZjBkODRlNjhjODBhM2NhY2I2ZTljMzA2
11
+ YzU1NWE5Nzc5N2E0NGM5NDQzZjYzZDNkMWNkOTU2YzMzY2IwMzI=
12
+ data.tar.gz: !binary |-
13
+ YzZlZDNjMTQ1NjNjOGQwZGIwNjZiZWE1MWI3ZGEyOTI3M2FmN2VlZjE2Njli
14
+ YTY0ZDk3OWMzYTlhMDM2YTMzZTRmMzczMWNlOGQ1N2U2ZTAzOTc1ZjBmZmI0
15
+ NzRkYWIxODIyNjQwMTFhNTIyY2VkY2I4NmU3Zjk0Y2FhNzJjYWE=
@@ -1,3 +1,3 @@
1
1
  module Watership
2
- VERSION = '0.8.1'
2
+ VERSION = "0.8.2"
3
3
  end
data/lib/watership.rb CHANGED
@@ -10,6 +10,16 @@ module Watership
10
10
  Bunny::TCPConnectionFailed
11
11
  ]
12
12
 
13
+ CLEAR_CONNECTION_EXCEPTIONS = [
14
+ Bunny::ConnectionError,
15
+ Timeout::Error
16
+ ]
17
+
18
+ CLEAR_CHANNEL_EXCEPTIONS = [
19
+ Bunny::ChannelError,
20
+ Timeout::Error
21
+ ]
22
+
13
23
  def self.register(name, uri, env = 'production')
14
24
  registered[name.to_sym] = Client.new(uri, env)
15
25
  end
@@ -90,7 +100,12 @@ module Watership
90
100
  end
91
101
 
92
102
  def connection
93
- @bunny_connection ||= Bunny.new(@uri).tap { |bunny| bunny.start }
103
+ @bunny_connection ||= begin
104
+ Bunny.new(@uri).tap { |bunny| bunny.start }
105
+ rescue Timeout::Error => exception
106
+ logger.error("Exception #{exception.class.name} got raised in Watership#connection")
107
+ raise exception
108
+ end
94
109
  end
95
110
  alias create_connection connection
96
111
 
@@ -98,7 +113,8 @@ module Watership
98
113
  if @bunny_connection.respond_to?(:close)
99
114
  begin
100
115
  @bunny_connection.close
101
- rescue Bunny::ConnectionError # the connection is already closed
116
+ rescue *CLEAR_CONNECTION_EXCEPTIONS => exception # the connection is already closed
117
+ logger.error("Exception #{exception.class.name} got raised in Watership#clear_connection")
102
118
  end
103
119
  end
104
120
  ensure
@@ -118,7 +134,8 @@ module Watership
118
134
  if thread[:bunny_channel].respond_to?(:close)
119
135
  begin
120
136
  thread[:bunny_channel].close
121
- rescue Bunny::ChannelError # the channel is already closed
137
+ rescue *CLEAR_CHANNEL_EXCEPTIONS => exception # the channel is already closed
138
+ logger.error("Exception #{exception.class.name} got raised in Watership#clear_channel")
122
139
  end
123
140
  end
124
141
  ensure
metadata CHANGED
@@ -1,69 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watership
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Scofield
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-29 00:00:00.000000000 Z
11
+ date: 2014-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - ! '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - ! '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bunny
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - ! '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - ! '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  description: Wrapper around Bunny to better handle connection issues
@@ -73,7 +73,7 @@ executables: []
73
73
  extensions: []
74
74
  extra_rdoc_files: []
75
75
  files:
76
- - ".gitignore"
76
+ - .gitignore
77
77
  - CHANGELOG.md
78
78
  - Gemfile
79
79
  - LICENSE.txt
@@ -94,12 +94,12 @@ require_paths:
94
94
  - lib
95
95
  required_ruby_version: !ruby/object:Gem::Requirement
96
96
  requirements:
97
- - - ">="
97
+ - - ! '>='
98
98
  - !ruby/object:Gem::Version
99
99
  version: '0'
100
100
  required_rubygems_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ">="
102
+ - - ! '>='
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  requirements: []