blabbermouth 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a78223e98752990442658537e8adb72eb25c402a
4
- data.tar.gz: c4075260334a80209ebaf6567547245afe32a0c7
3
+ metadata.gz: 010d190597b04b7a4ea7709fddd137c9d9975b81
4
+ data.tar.gz: 9263f8c9c390a5447092f5b4dba3735f1c2f77e1
5
5
  SHA512:
6
- metadata.gz: a5f5d76743381b4a271030215d1c0cb0f5b748f001722addb4fbda92e6e21d3154ce136a677c80ceecb9a38f2465c099cc6c00dfc39761ab363023578f5afb15
7
- data.tar.gz: 894723a59b490f1c86ebe83d21fddbb91c45c22d59e476418cf702413487cbfacffa5d565719f67515d286658bad0acac5175415eccc491e31c55338a51e6c79
6
+ metadata.gz: b08e982695a8e518ea8b7a3ed04d806743723ef9c815a944dbd968289114deddaa0a38143c882c1228caf93f882282d3f1bece563c39f1c7170a27a7c1ef38f8
7
+ data.tar.gz: b6573f304388f7660560abffa576febf14d6190b94119ee57063da6c27c5be4ae63c28aade92c96c08d7c64b84ad3920f82b0bea63c0f86aa9eadc6dcbf410ce
@@ -3,7 +3,7 @@ require 'active_support/core_ext/array/extract_options'
3
3
  require 'active_support/core_ext/string'
4
4
  require 'blabbermouth/version'
5
5
  require 'blabbermouth/configuration'
6
- require 'blabbermouth/gawkers'
6
+ require 'blabbermouth/bystanders'
7
7
  require 'blabbermouth/blabber'
8
8
 
9
9
  module Blabbermouth
@@ -14,12 +14,12 @@ module Blabbermouth
14
14
  @@configuration.configure &block
15
15
  end
16
16
 
17
- def self.blabber(*gawkers)
18
- Blabbermouth::Blabber.new *gawkers
17
+ def self.blabber(*bystanders)
18
+ Blabbermouth::Blabber.new *bystanders
19
19
  end
20
20
 
21
- def self.new(*gawkers)
22
- blabber *gawkers
21
+ def self.new(*bystanders)
22
+ blabber *bystanders
23
23
  end
24
24
 
25
25
  def self.error(key, e, *args)
@@ -1,84 +1,84 @@
1
1
  module Blabbermouth
2
2
  class Blabber
3
- attr_reader :gawkers, :options
3
+ attr_reader :bystanders, :options
4
4
 
5
5
  class << self
6
6
  def parse_args(*args)
7
7
  opts = args.extract_options!
8
- args = Blabbermouth.configuration.gawkers if args.empty?
9
- gawkers = args + [opts.slice!(:data)]
10
- [gawkers, opts]
8
+ args = Blabbermouth.configuration.bystanders if args.empty?
9
+ bystanders = args + [opts.slice!(:data)]
10
+ [bystanders, opts]
11
11
  end
12
12
 
13
13
  def error(key, e, *args)
14
- gawkers, opts = parse_args(*args)
15
- new(*gawkers).error(key, e, opts)
14
+ bystanders, opts = parse_args(*args)
15
+ new(*bystanders).error(key, e, opts)
16
16
  end
17
17
 
18
18
  def info(key, msg=nil, *args)
19
- gawkers, opts = parse_args(*args)
20
- new(*gawkers).info(key, msg, opts)
19
+ bystanders, opts = parse_args(*args)
20
+ new(*bystanders).info(key, msg, opts)
21
21
  end
22
22
 
23
23
  def increment(key, by=1, *args)
24
- gawkers, opts = parse_args(*args)
25
- new(*gawkers).increment(key, by, opts)
24
+ bystanders, opts = parse_args(*args)
25
+ new(*bystanders).increment(key, by, opts)
26
26
  end
27
27
 
28
28
  def count(key, total, *args)
29
- gawkers, opts = parse_args(*args)
30
- new(*gawkers).count(key, total, opts)
29
+ bystanders, opts = parse_args(*args)
30
+ new(*bystanders).count(key, total, opts)
31
31
  end
32
32
 
33
33
  def time(key, duration=nil, *args, &block)
34
- gawkers, opts = parse_args(*args)
35
- new(*gawkers).time(key, duration, opts, &block)
34
+ bystanders, opts = parse_args(*args)
35
+ new(*bystanders).time(key, duration, opts, &block)
36
36
  end
37
37
  end
38
38
 
39
- def add_gawker!(gawker)
40
- @gawkers ||= []
41
- unless gawker_exists?(gawker)
42
- @gawkers << "Blabbermouth::Gawkers::#{gawker.to_s.camelize}".constantize.new
39
+ def add_bystander!(bystander)
40
+ @bystanders ||= []
41
+ unless bystander_exists?(bystander)
42
+ @bystanders << "Blabbermouth::Bystanders::#{bystander.to_s.camelize}".constantize.new
43
43
  end
44
- @gawkers
44
+ @bystanders
45
45
  end
46
46
 
47
- def add_gawker(gawker)
48
- add_gawker! gawker
47
+ def add_bystander(bystander)
48
+ add_bystander! bystander
49
49
  rescue => e
50
50
  false
51
51
  end
52
52
 
53
- def remove_gawker!(gawker)
54
- return if @gawkers.nil?
55
- @gawkers.slice!(gawker_index(gawker), 1)
53
+ def remove_bystander!(bystander)
54
+ return if @bystanders.nil?
55
+ @bystanders.slice!(bystander_index(bystander), 1)
56
56
  end
57
57
 
58
- def remove_gawker(gawker)
59
- remove_gawker! gawker
58
+ def remove_bystander(bystander)
59
+ remove_bystander! bystander
60
60
  rescue => e
61
61
  false
62
62
  end
63
63
 
64
64
  def error(key, e, *args)
65
65
  opts = args.extract_options!
66
- gawkers.map { |gawker| gawker.error key, e, *args.concat([gawker_options(gawker, opts)]) }
66
+ bystanders.map { |bystander| bystander.error key, e, *args.concat([bystander_options(bystander, opts)]) }
67
67
  end
68
68
 
69
69
  def info(key, msg=nil, *args)
70
70
  opts = args.extract_options!
71
- gawkers.map { |gawker| gawker.info key, msg, *args.concat([gawker_options(gawker, opts)]) }
71
+ bystanders.map { |bystander| bystander.info key, msg, *args.concat([bystander_options(bystander, opts)]) }
72
72
  end
73
73
 
74
74
  def increment(key, by=1, *args)
75
75
  opts = args.extract_options!
76
- gawkers.map { |gawker| gawker.increment key, by, *args.concat([gawker_options(gawker, opts)]) }
76
+ bystanders.map { |bystander| bystander.increment key, by, *args.concat([bystander_options(bystander, opts)]) }
77
77
  end
78
78
 
79
79
  def count(key, total, *args)
80
80
  opts = args.extract_options!
81
- gawkers.map { |gawker| gawker.count key, total, *args.concat([gawker_options(gawker, opts)]) }
81
+ bystanders.map { |bystander| bystander.count key, total, *args.concat([bystander_options(bystander, opts)]) }
82
82
  end
83
83
 
84
84
  def time(key, duration=nil, *args, &block)
@@ -91,38 +91,38 @@ module Blabbermouth
91
91
  duration = (::Time.now - start_time).to_f
92
92
  end
93
93
 
94
- gawkers.map { |gawker| gawker.time key, duration, *args.concat([gawker_options(gawker, opts)]) }
94
+ bystanders.map { |bystander| bystander.time key, duration, *args.concat([bystander_options(bystander, opts)]) }
95
95
  end
96
96
 
97
97
  def method_missing(meth, *args, &block)
98
- gawkers.map do |gawker|
99
- next unless gawker.respond_to?(meth)
100
- gawker.send(meth, *args, &block)
98
+ bystanders.map do |bystander|
99
+ next unless bystander.respond_to?(meth)
100
+ bystander.send(meth, *args, &block)
101
101
  end
102
102
  end
103
103
 
104
104
  def respond_to_missing?(meth, include_private=false)
105
- gawkers.any? { |gawker| gawker.respond_to?(meth, include_private) }
105
+ bystanders.any? { |bystander| bystander.respond_to?(meth, include_private) }
106
106
  end
107
107
 
108
108
  protected
109
109
 
110
- def initialize(*gawks)
111
- @options = gawks.extract_options!
112
- gawks.concat(options.keys).uniq
113
- gawks.each { |gawker| add_gawker! gawker }
110
+ def initialize(*bystdrs)
111
+ @options = bystdrs.extract_options!
112
+ bystdrs.concat(options.keys).uniq
113
+ bystdrs.each { |bystander| add_bystander! bystander }
114
114
  end
115
115
 
116
- def gawker_options(gawker, opts={})
117
- (@options[gawker.class.name.demodulize.underscore.to_sym] || {}).merge(opts)
116
+ def bystander_options(bystander, opts={})
117
+ (@options[bystander.class.name.demodulize.underscore.to_sym] || {}).merge(opts)
118
118
  end
119
119
 
120
- def gawker_index(gawker)
121
- @gawkers.index { |gawk| gawk.class.name.demodulize.underscore == gawker.to_s }
120
+ def bystander_index(bystander)
121
+ @bystanders.index { |bystdr| bystdr.class.name.demodulize.underscore == bystander.to_s }
122
122
  end
123
123
 
124
- def gawker_exists?(gawker)
125
- !gawker_index(gawker).nil?
124
+ def bystander_exists?(bystander)
125
+ !bystander_index(bystander).nil?
126
126
  end
127
127
  end
128
128
  end
@@ -0,0 +1,7 @@
1
+ module Blabbermouth
2
+ module Bystanders
3
+ end
4
+ end
5
+
6
+ require 'blabbermouth/bystanders/base'
7
+ require 'blabbermouth/bystanders/stdout'
@@ -1,5 +1,5 @@
1
1
  module Blabbermouth
2
- module Gawkers
2
+ module Bystanders
3
3
  class Base
4
4
  def error(key, e, *args)
5
5
  raise NotImplementedError, "#{self.class.name}##{__method__} has not been implemented"
@@ -0,0 +1,35 @@
1
+ module Blabbermouth
2
+ module Bystanders
3
+ class NewRelic < Base
4
+ def error(key, e, *args)
5
+ super
6
+ end
7
+
8
+ def info(key, msg=nil, *args)
9
+ super
10
+ end
11
+
12
+ def increment(key, by=1, *args)
13
+ super
14
+ end
15
+
16
+ def count(key, total, *args)
17
+ super
18
+ end
19
+
20
+ def time(key, duration=nil, *args)
21
+ super
22
+ end
23
+
24
+ protected
25
+
26
+ def new_relic?
27
+ defined?(::NewRelic)
28
+ end
29
+
30
+ def new_relic!
31
+ raise "You must require and configure the newrelic_rpm gem to use it as a bystander" unless new_relic?
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,5 +1,5 @@
1
1
  module Blabbermouth
2
- module Gawkers
2
+ module Bystanders
3
3
  class Stdout < Base
4
4
  def error(key, e, *args)
5
5
  data, opts, args = parse_args(*args)
@@ -1,7 +1,7 @@
1
1
  module Blabbermouth
2
2
  class Configuration
3
3
  DEFAULT_CONFIGURATION_OPTIONS = {
4
- gawkers: [:stdout]
4
+ bystanders: [:stdout]
5
5
  }
6
6
 
7
7
  attr_reader *DEFAULT_CONFIGURATION_OPTIONS.keys
@@ -1,3 +1,3 @@
1
1
  module Blabbermouth
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -1,124 +1,124 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe Blabbermouth::Blabber do
4
- describe '#add_gawker!' do
5
- context 'when the gawker does not exist' do
6
- it 'adds a gawker to the list of gawkers' do
7
- subject.add_gawker!(:rails)
8
- expect(subject.gawkers.count).to eql(1)
9
- expect(subject.gawkers.first).to be_an_instance_of(Blabbermouth::Gawkers::Rails)
4
+ describe '#add_bystander!' do
5
+ context 'when the bystander does not exist' do
6
+ it 'adds a bystander to the list of bystanders' do
7
+ subject.add_bystander!(:rails)
8
+ expect(subject.bystanders.count).to eql(1)
9
+ expect(subject.bystanders.first).to be_an_instance_of(Blabbermouth::Bystanders::Rails)
10
10
  end
11
11
  end
12
12
  end
13
13
 
14
- describe '#remove_gawker!' do
15
- context 'when the gawker exists' do
16
- it 'removes a gawker from the list of gawkers' do
17
- subject.add_gawker!(:rails)
18
- expect(subject.gawkers.count).to eql(1)
19
- subject.remove_gawker!(:rails)
20
- expect(subject.gawkers.count).to eql(0)
14
+ describe '#remove_bystander!' do
15
+ context 'when the bystander exists' do
16
+ it 'removes a bystander from the list of bystanders' do
17
+ subject.add_bystander!(:rails)
18
+ expect(subject.bystanders.count).to eql(1)
19
+ subject.remove_bystander!(:rails)
20
+ expect(subject.bystanders.count).to eql(0)
21
21
  end
22
22
  end
23
23
  end
24
24
 
25
25
  describe '#error' do
26
- it 'blabs to any added gawkers' do
27
- subject.add_gawker!(:test)
28
- subject.add_gawker!(:rails)
26
+ it 'blabs to any added bystanders' do
27
+ subject.add_bystander!(:test)
28
+ subject.add_bystander!(:rails)
29
29
  subject.error('key', StandardError.new)
30
- expect(Blabbermouth::Gawkers::Test.logged?(:error, 'key', StandardError.new.message)).to be_true
31
- expect(Rails.logger.errors).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :error, 'key', StandardError.new))
30
+ expect(Blabbermouth::Bystanders::Test.logged?(:error, 'key', StandardError.new.message)).to be_true
31
+ expect(Rails.logger.errors).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :error, 'key', StandardError.new))
32
32
  end
33
33
  end
34
34
 
35
35
  describe '#info' do
36
- it 'blabs to any added gawkers' do
37
- subject.add_gawker!(:test)
38
- subject.add_gawker!(:rails)
36
+ it 'blabs to any added bystanders' do
37
+ subject.add_bystander!(:test)
38
+ subject.add_bystander!(:rails)
39
39
  subject.info('key', 'test')
40
- expect(Blabbermouth::Gawkers::Test.logged?(:info, 'key', 'test')).to be_true
41
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :info, 'key', 'test'))
40
+ expect(Blabbermouth::Bystanders::Test.logged?(:info, 'key', 'test')).to be_true
41
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :info, 'key', 'test'))
42
42
  end
43
43
  end
44
44
 
45
45
  describe '#increment' do
46
- it 'blabs to any added gawkers' do
47
- subject.add_gawker!(:test)
48
- subject.add_gawker!(:rails)
46
+ it 'blabs to any added bystanders' do
47
+ subject.add_bystander!(:test)
48
+ subject.add_bystander!(:rails)
49
49
  subject.increment('key', 1)
50
- expect(Blabbermouth::Gawkers::Test.logged?(:increment, 'key', 1)).to be_true
51
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :increment, 'key', 1))
50
+ expect(Blabbermouth::Bystanders::Test.logged?(:increment, 'key', 1)).to be_true
51
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :increment, 'key', 1))
52
52
  end
53
53
  end
54
54
 
55
55
  describe '#count' do
56
- it 'blabs to any added gawkers' do
57
- subject.add_gawker!(:test)
58
- subject.add_gawker!(:rails)
56
+ it 'blabs to any added bystanders' do
57
+ subject.add_bystander!(:test)
58
+ subject.add_bystander!(:rails)
59
59
  subject.count('key', 1)
60
- expect(Blabbermouth::Gawkers::Test.logged?(:count, 'key', 1)).to be_true
61
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :count, 'key', 1))
60
+ expect(Blabbermouth::Bystanders::Test.logged?(:count, 'key', 1)).to be_true
61
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :count, 'key', 1))
62
62
  end
63
63
  end
64
64
 
65
65
  describe '#time' do
66
- it 'blabs to any added gawkers' do
67
- subject.add_gawker!(:test)
68
- subject.add_gawker!(:rails)
66
+ it 'blabs to any added bystanders' do
67
+ subject.add_bystander!(:test)
68
+ subject.add_bystander!(:rails)
69
69
  subject.time('key', 1)
70
- expect(Blabbermouth::Gawkers::Test.logged?(:time, 'key', 1)).to be_true
71
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :time, 'key', 1))
70
+ expect(Blabbermouth::Bystanders::Test.logged?(:time, 'key', 1)).to be_true
71
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :time, 'key', 1))
72
72
  end
73
73
  end
74
74
 
75
75
  describe '#method_missing' do
76
- context 'when added gawkers respond to the requested method' do
77
- it 'passes method calls through to added gawkers' do
78
- subject.add_gawker!(:test)
76
+ context 'when added bystanders respond to the requested method' do
77
+ it 'passes method calls through to added bystanders' do
78
+ subject.add_bystander!(:test)
79
79
  subject.test('key', 'test')
80
- expect(Blabbermouth::Gawkers::Test.logged?(:test, 'key', 'test')).to be_true
80
+ expect(Blabbermouth::Bystanders::Test.logged?(:test, 'key', 'test')).to be_true
81
81
  end
82
82
  end
83
83
  end
84
84
 
85
85
  describe '.error' do
86
- it 'blabs to any provided gawkers' do
86
+ it 'blabs to any provided bystanders' do
87
87
  Blabbermouth::Blabber.error('key', StandardError.new, :test, :rails)
88
- expect(Blabbermouth::Gawkers::Test.logged?(:error, 'key', StandardError.new.message)).to be_true
89
- expect(Rails.logger.errors).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :error, 'key', StandardError.new))
88
+ expect(Blabbermouth::Bystanders::Test.logged?(:error, 'key', StandardError.new.message)).to be_true
89
+ expect(Rails.logger.errors).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :error, 'key', StandardError.new))
90
90
  end
91
91
  end
92
92
 
93
93
  describe '.info' do
94
- it 'blabs to any provided gawkers' do
94
+ it 'blabs to any provided bystanders' do
95
95
  Blabbermouth::Blabber.info('key', 'test', :test, :rails)
96
- expect(Blabbermouth::Gawkers::Test.logged?(:info, 'key', 'test')).to be_true
97
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :info, 'key', 'test'))
96
+ expect(Blabbermouth::Bystanders::Test.logged?(:info, 'key', 'test')).to be_true
97
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :info, 'key', 'test'))
98
98
  end
99
99
  end
100
100
 
101
101
  describe '.increment' do
102
- it 'blabs to any provided gawkers' do
102
+ it 'blabs to any provided bystanders' do
103
103
  Blabbermouth::Blabber.increment('key', 1, :test, :rails)
104
- expect(Blabbermouth::Gawkers::Test.logged?(:increment, 'key', 1)).to be_true
105
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :increment, 'key', 1))
104
+ expect(Blabbermouth::Bystanders::Test.logged?(:increment, 'key', 1)).to be_true
105
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :increment, 'key', 1))
106
106
  end
107
107
  end
108
108
 
109
109
  describe '.count' do
110
- it 'blabs to any provided gawkers' do
110
+ it 'blabs to any provided bystanders' do
111
111
  Blabbermouth::Blabber.count('key', 1, :test, :rails)
112
- expect(Blabbermouth::Gawkers::Test.logged?(:count, 'key', 1)).to be_true
113
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :count, 'key', 1))
112
+ expect(Blabbermouth::Bystanders::Test.logged?(:count, 'key', 1)).to be_true
113
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :count, 'key', 1))
114
114
  end
115
115
  end
116
116
 
117
117
  describe '.time' do
118
- it 'blabs to any provided gawkers' do
118
+ it 'blabs to any provided bystanders' do
119
119
  Blabbermouth::Blabber.time('key', 1, :test, :rails)
120
- expect(Blabbermouth::Gawkers::Test.logged?(:time, 'key', 1)).to be_true
121
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :time, 'key', 1))
120
+ expect(Blabbermouth::Bystanders::Test.logged?(:time, 'key', 1)).to be_true
121
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :time, 'key', 1))
122
122
  end
123
123
  end
124
124
  end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe Blabbermouth::Gawkers::Base do
3
+ RSpec.describe Blabbermouth::Bystanders::Base do
4
4
  describe '#error' do
5
5
  it 'raises NotImplementedError' do
6
6
  expect { subject.error('key', StandardError.new) }.to raise_exception(NotImplementedError)
@@ -0,0 +1,5 @@
1
+ require 'blabbermouth-new_relic'
2
+ require 'spec_helper'
3
+
4
+ RSpec.describe Blabbermouth::Bystanders::NewRelic do
5
+ end
@@ -1,6 +1,6 @@
1
1
  require 'spec_helper'
2
2
 
3
- RSpec.describe Blabbermouth::Gawkers::Stdout do
3
+ RSpec.describe Blabbermouth::Bystanders::Stdout do
4
4
  describe '#error' do
5
5
  it 'outputs to STDOUT' do
6
6
  expect(capture_stdout { subject.error('key', StandardError.new) }).to eql(subject.send(:log_message, :error, 'key', StandardError.new))
@@ -2,47 +2,47 @@ require 'spec_helper'
2
2
 
3
3
  RSpec.describe Blabbermouth do
4
4
  describe '#error' do
5
- it 'blabs to any provided gawkers' do
5
+ it 'blabs to any provided bystanders' do
6
6
  subject.error('key', StandardError.new, :rollbar, :rails)
7
7
  error = ::Rollbar.errors.last
8
8
  expect(error[0]).to be_an_instance_of(Blabbermouth::Error)
9
- expect(Rails.logger.errors).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :error, 'key', StandardError.new))
9
+ expect(Rails.logger.errors).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :error, 'key', StandardError.new))
10
10
  end
11
11
  end
12
12
 
13
13
  describe '#info' do
14
- it 'blabs to any provided gawkers' do
14
+ it 'blabs to any provided bystanders' do
15
15
  subject.info('key', 'test', :rollbar, :rails)
16
16
  info = ::Rollbar.infos.last
17
17
  expect(info[0]).to be_an_instance_of(Blabbermouth::Info)
18
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :info, 'key', 'test'))
18
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :info, 'key', 'test'))
19
19
  end
20
20
  end
21
21
 
22
22
  describe '#increment' do
23
- it 'blabs to any provided gawkers' do
23
+ it 'blabs to any provided bystanders' do
24
24
  subject.increment('key', 1, :rollbar, :rails)
25
25
  info = ::Rollbar.infos.last
26
26
  expect(info[0]).to be_an_instance_of(Blabbermouth::Increment)
27
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :increment, 'key', 1))
27
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :increment, 'key', 1))
28
28
  end
29
29
  end
30
30
 
31
31
  describe '#count' do
32
- it 'blabs to any provided gawkers' do
32
+ it 'blabs to any provided bystanders' do
33
33
  subject.count('key', 1, :rollbar, :rails)
34
34
  info = ::Rollbar.infos.last
35
35
  expect(info[0]).to be_an_instance_of(Blabbermouth::Count)
36
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :count, 'key', 1))
36
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :count, 'key', 1))
37
37
  end
38
38
  end
39
39
 
40
40
  describe '#time' do
41
- it 'blabs to any provided gawkers' do
41
+ it 'blabs to any provided bystanders' do
42
42
  subject.time('key', 1, :rollbar, :rails)
43
43
  info = ::Rollbar.infos.last
44
44
  expect(info[0]).to be_an_instance_of(Blabbermouth::Time)
45
- expect(Rails.logger.infos).to include(Blabbermouth::Gawkers::Rails.new.send(:log_message, :time, 'key', 1))
45
+ expect(Rails.logger.infos).to include(Blabbermouth::Bystanders::Rails.new.send(:log_message, :time, 'key', 1))
46
46
  end
47
47
  end
48
48
  end
@@ -4,7 +4,7 @@ require 'rspec'
4
4
  Dir[File.join(File.dirname(__FILE__), '..', "spec/support/**/*.rb")].each { |f| require f }
5
5
 
6
6
  Blabbermouth.configure do |config|
7
- config.gawkers = []
7
+ config.bystanders = []
8
8
  end
9
9
 
10
10
  RSpec.configure do |config|
@@ -1,5 +1,5 @@
1
1
  module Blabbermouth
2
- module Gawkers
2
+ module Bystanders
3
3
  class Test < Base
4
4
  EVENTS = []
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blabbermouth
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
  - Mark Rebec
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -53,8 +53,8 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: Flexible instrumentation/reporting library for pushing info, errors,
56
- counts, timing, etc. to various datastores like Librato, Rollbar, Rails logs or
57
- custom ActiveRecord models
56
+ counts, timing, etc. to listening bystanders like Librato, Rollbar, New Relic, Rails
57
+ logs or any custom reporting class.
58
58
  email:
59
59
  - mark@markrebec.com
60
60
  executables: []
@@ -63,19 +63,21 @@ extra_rdoc_files: []
63
63
  files:
64
64
  - lib/blabbermouth.rb
65
65
  - lib/blabbermouth/blabber.rb
66
+ - lib/blabbermouth/bystanders.rb
67
+ - lib/blabbermouth/bystanders/base.rb
68
+ - lib/blabbermouth/bystanders/new_relic.rb
69
+ - lib/blabbermouth/bystanders/stdout.rb
66
70
  - lib/blabbermouth/configuration.rb
67
71
  - lib/blabbermouth/exceptions.rb
68
- - lib/blabbermouth/gawkers.rb
69
- - lib/blabbermouth/gawkers/base.rb
70
- - lib/blabbermouth/gawkers/stdout.rb
71
72
  - lib/blabbermouth/version.rb
72
73
  - spec/blabbermouth/blabber_spec.rb
73
- - spec/blabbermouth/gawkers/base_spec.rb
74
- - spec/blabbermouth/gawkers/stdout_spec.rb
74
+ - spec/blabbermouth/bystanders/base_spec.rb
75
+ - spec/blabbermouth/bystanders/new_relic_spec.rb
76
+ - spec/blabbermouth/bystanders/stdout_spec.rb
75
77
  - spec/blabbermouth_spec.rb
76
78
  - spec/spec_helper.rb
79
+ - spec/support/bystander.rb
77
80
  - spec/support/capture_stdout.rb
78
- - spec/support/gawker.rb
79
81
  homepage: http://github.com/markrebec/blabbermouth
80
82
  licenses: []
81
83
  metadata: {}
@@ -98,12 +100,13 @@ rubyforge_project:
98
100
  rubygems_version: 2.2.2
99
101
  signing_key:
100
102
  specification_version: 4
101
- summary: Blabs your business to various datastores
103
+ summary: Blabs your business to listening bystanders
102
104
  test_files:
103
105
  - spec/blabbermouth_spec.rb
104
106
  - spec/spec_helper.rb
105
107
  - spec/support/capture_stdout.rb
106
- - spec/support/gawker.rb
108
+ - spec/support/bystander.rb
107
109
  - spec/blabbermouth/blabber_spec.rb
108
- - spec/blabbermouth/gawkers/base_spec.rb
109
- - spec/blabbermouth/gawkers/stdout_spec.rb
110
+ - spec/blabbermouth/bystanders/base_spec.rb
111
+ - spec/blabbermouth/bystanders/new_relic_spec.rb
112
+ - spec/blabbermouth/bystanders/stdout_spec.rb
@@ -1,7 +0,0 @@
1
- module Blabbermouth
2
- module Gawkers
3
- end
4
- end
5
-
6
- require 'blabbermouth/gawkers/base'
7
- require 'blabbermouth/gawkers/stdout'