l2meter 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/l2meter/emitter.rb +5 -1
- data/lib/l2meter/thread_safe.rb +3 -5
- data/lib/l2meter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f6837966e87026cd02e15e762a2fdbd9ff85df6
|
4
|
+
data.tar.gz: bb9cfa872459c6fe06b450cdd39345dd2a89b7c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16bad696db1b02ab36402276bd40d0d75fafd2d2c89dc25284316bae46076c363d7f5281efde110b8960b211cd6a8a514e092fe31fc1aac77618b0f7565b91de
|
7
|
+
data.tar.gz: 346ddeccce7ad73b9669b89326f2bcc63b97c9b5a1cf181ca7dea4bf45e0555b71f9b758c168856356e0959b7e1c1923a220bf1bbd6d0f25639165202459f329
|
data/lib/l2meter/emitter.rb
CHANGED
@@ -69,7 +69,11 @@ module L2meter
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def clone
|
72
|
-
|
72
|
+
cloned_contexts = @contexts.clone
|
73
|
+
self.class.new(configuration: configuration).instance_eval do
|
74
|
+
@contexts = cloned_contexts
|
75
|
+
self
|
76
|
+
end
|
73
77
|
end
|
74
78
|
|
75
79
|
def batch
|
data/lib/l2meter/thread_safe.rb
CHANGED
@@ -32,8 +32,8 @@ module L2meter
|
|
32
32
|
def_delegators :receiver, *EMITTER_METHODS
|
33
33
|
|
34
34
|
def context(*args, &block)
|
35
|
-
value =
|
36
|
-
|
35
|
+
value = current_emitter.context(*args, &block)
|
36
|
+
Emitter === value ? clone_with_emitter(value) : value
|
37
37
|
end
|
38
38
|
|
39
39
|
def disable!
|
@@ -49,9 +49,7 @@ module L2meter
|
|
49
49
|
attr_reader :emitter
|
50
50
|
|
51
51
|
def clone_with_emitter(emitter)
|
52
|
-
|
53
|
-
ts.emitter = emitter
|
54
|
-
end
|
52
|
+
self.class.new(emitter).tap { |ts| ts.disable! if @disabled }
|
55
53
|
end
|
56
54
|
|
57
55
|
def receiver
|
data/lib/l2meter/version.rb
CHANGED