bellbro 0.0.3 → 0.0.4

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: 43c18ca42ab05b75b1b6edd106de60f9c249d018
4
- data.tar.gz: 28eed86de826d915ec6a3c9250ac49da7e4073c8
3
+ metadata.gz: 120efff8ea0e78fb3d66c956710c992b334f7b2c
4
+ data.tar.gz: 4b60e315848cac0223753b75cdf272cea8faaa73
5
5
  SHA512:
6
- metadata.gz: 7acdfbb45d76f7712c7a6596788c9d9a66d5737c6b0e897905d38c062ba8ecf9284d0d9b342d4ff6db5c3ecc231c7d97f5e9adac9c9d3c085b035563dc345bcf
7
- data.tar.gz: 65734addf0b5627347e6d70256658a5fe45faf26622691a0e4dae8431d48e7d2fc2421917940c2fafd8f35b630398129599ce0e26a6ebcfc08710cbd265785d6
6
+ metadata.gz: 85942bd6428e156b6dc0491817a04a2a14f01d52c756679eefdea32595b399123c893f0e46b30cfb5ba2d7f91411ff83b1f1ffdbee91eaade4f1994503674caa
7
+ data.tar.gz: bbbac39c8e0006e740bd495c70d1147a07a37ee1a72b0263df63eccdf9d85d9a0c5b18bcf05934d9b3670e8edf41175b6512e7513d7f813353d73f339416b8c8
data/lib/bellbro/bell.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Bellbro
2
2
  class Bell
3
3
  include Bellbro::Retryable
4
- include Bellbro::Notifier
4
+ include Bellbro::Ringer
5
5
  end
6
6
  end
7
7
 
@@ -1,10 +1,10 @@
1
1
  module Bellbro
2
- module Notifier
2
+ module Ringer
3
3
  def self.included(klass)
4
4
  klass.extend(self)
5
5
  end
6
6
 
7
- def notify(logline, opts={})
7
+ def ring(logline, opts={})
8
8
  domain_insert = @domain ? "[#{@domain}]": ""
9
9
  error_insert = (opts[:type] == :error) ? "##ERROR## " : ""
10
10
  complete_logline = "[#{self.class}](#{Thread.current.object_id})#{domain_insert}: #{error_insert}#{logline}"
@@ -20,8 +20,8 @@ module Bellbro
20
20
  begin
21
21
  run
22
22
  rescue Exception => @thread_error
23
- notify "#{@thread_error.inspect}", type: :error
24
- Airbrake.notify(@thread_error)
23
+ ring "#{@thread_error.inspect}", type: :error
24
+ Airbrake.ring(@thread_error)
25
25
  raise @thread_error
26
26
  end
27
27
  end
@@ -29,13 +29,13 @@ module Bellbro
29
29
 
30
30
  def stop
31
31
  @done = true
32
- notify "Stopping #{self.class} service..."
32
+ ring "Stopping #{self.class} service..."
33
33
  @thread.join
34
- notify "#{self.class.to_s.capitalize} service stopped."
34
+ ring "#{self.class.to_s.capitalize} service stopped."
35
35
  end
36
36
 
37
37
  def run
38
- notify "Starting #{self.class} service."
38
+ ring "Starting #{self.class} service."
39
39
  Service.mutex.synchronize { track }
40
40
  begin
41
41
  start_jobs
@@ -49,7 +49,7 @@ module Bellbro
49
49
  each_job do |job|
50
50
  klass = job[:klass].constantize
51
51
  jid = klass.perform_async(job[:arguments])
52
- notify "Starting job #{jid} #{job[:klass]} with #{job[:arguments]}."
52
+ ring "Starting job #{jid} #{job[:klass]} with #{job[:arguments]}."
53
53
  record_incr(:jobs_started)
54
54
  end
55
55
  end
@@ -1,3 +1,3 @@
1
1
  module Bellbro
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bellbro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Stokes
@@ -95,9 +95,9 @@ files:
95
95
  - bellbro.gemspec
96
96
  - lib/bellbro.rb
97
97
  - lib/bellbro/bell.rb
98
- - lib/bellbro/notifier.rb
99
98
  - lib/bellbro/redis_pool.rb
100
99
  - lib/bellbro/retryable.rb
100
+ - lib/bellbro/ringer.rb
101
101
  - lib/bellbro/service.rb
102
102
  - lib/bellbro/settings.rb
103
103
  - lib/bellbro/sidekiq_utils.rb