watership 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e68c5252d98d3bf463a4bd6796485624d3450c3
4
- data.tar.gz: 5bb900d6db0d07207b082254b22efc8e29a2f89c
3
+ metadata.gz: 870eb77a1e03d2d87e67b9903e80425e01ac54e8
4
+ data.tar.gz: 56926572cda379cf637f13348201af6e6f64a21c
5
5
  SHA512:
6
- metadata.gz: 6b8462e0e56e79fbd9d343d5dd00b5930768b7cab7a81ea95bd9358136f99584d3e9c00e2d26ef560d119733bb815a2ab52ff43857040badee3875bc1921255d
7
- data.tar.gz: dce9f301810261e9001e6f25439df6c5bdd26a6c7ce0420d31549a74b85d34e6bf103f716c62b234615fb8a20ae380c020f45363e9beb854188cbadc206d613d
6
+ metadata.gz: 26b25df33472d2fdc990be44b3565963ecffa1b00833881c2ad52f2f3e90cbd1ff4d5d532453ddc20d98757806555950719df0d189dd9f8384f9bbfed0574c43
7
+ data.tar.gz: 63e160d5238260fce7b0193cf8b526ee44f4a57c90ef051dcc39d551b6368f339f612f9fccb664645cadae57de188a13aae309befd4a79adf224fcd5924d40f2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Changelog
2
2
 
3
- ## 0.3.5 - 2014-06-20
3
+ ## 0.3.5, 0.3.6 - 2014-06-20
4
4
  * Remove dependency on Rails in `Watership::Consumer`.
5
5
 
6
6
  ## 0.3.4 - 2014-06-20
@@ -19,28 +19,28 @@ module Watership
19
19
  @consumer.call(JSON.parse(payload))
20
20
  success = true
21
21
  rescue StandardError => exception
22
- Watership.logger.error "Error thrown in subscribe block"
23
- Watership.logger.error exception.message
24
- Watership.logger.error exception.backtrace.join("\n")
25
- Watership.notify(exception)
26
- Watership.logger.info "Rejecting in rabbit"
22
+ logger.error "Error thrown in subscribe block"
23
+ logger.error exception.message
24
+ logger.error exception.backtrace.join("\n")
25
+ Airbrake.notify(exception) if defined?(AirBrake)
26
+ logger.info "Rejecting in rabbit"
27
27
  throw(:terminate)
28
28
  rescue Interrupt => exception
29
- Watership.logger.error "Interrupt in subscribe block"
30
- Watership.logger.warn "Stopped gracefully."
29
+ logger.error "Interrupt in subscribe block"
30
+ logger.warn "Stopped gracefully."
31
31
  throw(:terminate)
32
32
  ensure
33
33
  if success
34
- Watership.logger.info "Acking message"
34
+ logger.info "Acking message"
35
35
  channel.acknowledge(delivery_info.delivery_tag, false)
36
36
  else
37
- Watership.logger.info "Rejecting message"
37
+ logger.info "Rejecting message"
38
38
  channel.reject(delivery_info.delivery_tag, true)
39
39
  end
40
40
  end
41
41
  end
42
42
  ensure
43
- Watership.logger.info "Closing Channel"
43
+ logger.info "Closing Channel"
44
44
  channel.close
45
45
  end
46
46
  end
@@ -62,5 +62,9 @@ module Watership
62
62
  c
63
63
  end
64
64
  end
65
+
66
+ def logger
67
+ @logger ||= defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
68
+ end
65
69
  end
66
70
  end
@@ -1,3 +1,3 @@
1
1
  module Watership
2
- VERSION = '0.3.5'
2
+ VERSION = '0.3.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watership
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Scofield