blabbermouth 0.0.10 → 0.0.11
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9405d56b0b0b3e30ec03b6d0293818b492dcf71f
|
4
|
+
data.tar.gz: 83645eeff94929226ca553a924508939886636ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d443865f74135d58efe2102fe82f7d0bb7a4fe9e811831272882e404db2950df5a8410c27ea2daeb1ae7c4a4098e813a26e94b1b75ca347142f72272ec492c3f
|
7
|
+
data.tar.gz: 9cfb78bae21d79591dbbfdfc75948fe2455725875d004e46feccd2957b84281c2f918d73d431c741774144db6146413a135ad2badebc273c88098667cd1d67aa
|
data/lib/blabbermouth/blabber.rb
CHANGED
@@ -44,7 +44,7 @@ module Blabbermouth
|
|
44
44
|
def add_bystander!(bystander)
|
45
45
|
@bystanders ||= []
|
46
46
|
unless bystander_exists?(bystander)
|
47
|
-
@bystanders << "Blabbermouth::Bystanders::#{bystander.to_s.camelize}".constantize.new
|
47
|
+
@bystanders << "Blabbermouth::Bystanders::#{bystander.to_s.camelize}".constantize.new(@options[bystander] || {})
|
48
48
|
end
|
49
49
|
@bystanders
|
50
50
|
end
|
@@ -55,6 +55,12 @@ module Blabbermouth
|
|
55
55
|
false
|
56
56
|
end
|
57
57
|
|
58
|
+
def add_bystanders(*bystdrs)
|
59
|
+
@options.merge!(bystdrs.extract_options!)
|
60
|
+
bystdrs.concat(options.keys).uniq
|
61
|
+
bystdrs.each { |bystander| add_bystander! bystander }
|
62
|
+
end
|
63
|
+
|
58
64
|
def remove_bystander!(bystander)
|
59
65
|
return if @bystanders.nil?
|
60
66
|
@bystanders.slice!(bystander_index(bystander), 1)
|
@@ -121,9 +127,8 @@ module Blabbermouth
|
|
121
127
|
protected
|
122
128
|
|
123
129
|
def initialize(*bystdrs)
|
124
|
-
@options =
|
125
|
-
bystdrs
|
126
|
-
bystdrs.each { |bystander| add_bystander! bystander }
|
130
|
+
@options = {}
|
131
|
+
add_bystanders *bystdrs
|
127
132
|
end
|
128
133
|
|
129
134
|
def bystander_options(bystander, opts={})
|
data/lib/blabbermouth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blabbermouth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Rebec
|
@@ -67,14 +67,12 @@ files:
|
|
67
67
|
- lib/blabbermouth/bystanders/base.rb
|
68
68
|
- lib/blabbermouth/bystanders/dynamic_events.rb
|
69
69
|
- lib/blabbermouth/bystanders/formatter.rb
|
70
|
-
- lib/blabbermouth/bystanders/new_relic.rb
|
71
70
|
- lib/blabbermouth/bystanders/stdout.rb
|
72
71
|
- lib/blabbermouth/configuration.rb
|
73
72
|
- lib/blabbermouth/exceptions.rb
|
74
73
|
- lib/blabbermouth/version.rb
|
75
74
|
- spec/blabbermouth/blabber_spec.rb
|
76
75
|
- spec/blabbermouth/bystanders/base_spec.rb
|
77
|
-
- spec/blabbermouth/bystanders/new_relic_spec.rb
|
78
76
|
- spec/blabbermouth/bystanders/stdout_spec.rb
|
79
77
|
- spec/blabbermouth_spec.rb
|
80
78
|
- spec/spec_helper.rb
|
@@ -110,5 +108,4 @@ test_files:
|
|
110
108
|
- spec/support/bystander.rb
|
111
109
|
- spec/blabbermouth/blabber_spec.rb
|
112
110
|
- spec/blabbermouth/bystanders/base_spec.rb
|
113
|
-
- spec/blabbermouth/bystanders/new_relic_spec.rb
|
114
111
|
- spec/blabbermouth/bystanders/stdout_spec.rb
|
@@ -1,35 +0,0 @@
|
|
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
|