blabbermouth 0.0.7 → 0.0.8
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f8cb1c408b36723e237f714d54d49ff20360b55
|
4
|
+
data.tar.gz: 5168452e9248a9de95d65d09fc3375cc349775e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b323b3bec6a44c4cf62a5fabd26129ed7ce3655616731dfb6ff3dcbb58bb98112e887ddb451eb6227966b8749224839b4e386d341d26f54d316e03ae96c94a53
|
7
|
+
data.tar.gz: 90a45baffb26eb2336bae067b686949f34d3b78cab4687294bfedb9d5b9edcacdf347d8c949bee376a3c78ea1a980e3a45e9ac9efc39fbe7f3093d3f2aee7a90
|
data/lib/blabbermouth/blabber.rb
CHANGED
@@ -93,7 +93,8 @@ module Blabbermouth
|
|
93
93
|
opts = args.extract_options!
|
94
94
|
bystanders.map do |bystander|
|
95
95
|
next unless bystander.respond_to?(meth)
|
96
|
-
|
96
|
+
bystander_args = args.dup.push(bystander_options(bystander, opts))
|
97
|
+
bystander.send meth, key, *bystander_args, &block
|
97
98
|
end
|
98
99
|
end
|
99
100
|
|
@@ -3,11 +3,7 @@ module Blabbermouth
|
|
3
3
|
module DynamicEvents
|
4
4
|
|
5
5
|
def method_missing(meth, *args)
|
6
|
-
|
7
|
-
key = args.slice!(0,1).first
|
8
|
-
value = args.slice!(0,1).first
|
9
|
-
data.merge!({args: args}) unless args.empty?
|
10
|
-
blab meth, key, value, data: data
|
6
|
+
blab meth, *args
|
11
7
|
end
|
12
8
|
|
13
9
|
def respond_to_missing?(meth, include_private=false)
|
@@ -1,8 +1,12 @@
|
|
1
1
|
module Blabbermouth
|
2
2
|
module Bystanders
|
3
3
|
module Formatter
|
4
|
+
def timestamp
|
5
|
+
::Time.now.strftime('%Y/%m/%d %H:%M:%S %Z')
|
6
|
+
end
|
7
|
+
|
4
8
|
def log_message(event, key, msg, data={})
|
5
|
-
message = "[#{
|
9
|
+
message = "[#{timestamp}] Blabbermouth.#{event.to_s}: #{key.to_s}"
|
6
10
|
message += ": #{msg.to_s}" unless msg.to_s.blank?
|
7
11
|
message += " #{data.to_s}"
|
8
12
|
message
|
@@ -24,9 +24,9 @@ module Blabbermouth
|
|
24
24
|
blab :time, key, duration, *args
|
25
25
|
end
|
26
26
|
|
27
|
-
def blab(meth, key,
|
27
|
+
def blab(meth, key, *args)
|
28
28
|
data, opts, args = parse_args(*args)
|
29
|
-
puts meth, key,
|
29
|
+
puts meth, key, args.first, data
|
30
30
|
end
|
31
31
|
|
32
32
|
protected
|
data/lib/blabbermouth/version.rb
CHANGED