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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9ddd680884b093d7ef2d8f5d4dbdfa3ad58ff4ae
4
- data.tar.gz: 387975331395c28b5e61dd8fcd6be445136cfc09
3
+ metadata.gz: 1f6837966e87026cd02e15e762a2fdbd9ff85df6
4
+ data.tar.gz: bb9cfa872459c6fe06b450cdd39345dd2a89b7c0
5
5
  SHA512:
6
- metadata.gz: b42d3ca0e240e09a0a486d6b6f71415f301abf6e2bae4e9ea80baa5b203b8d3378b4f0d3827b6577324533d6bb19682807989aedf050dccd3eb7988c07830d61
7
- data.tar.gz: 86520c81cfed832b8fe638fe5cda97279294e8cb2de2e8e6a4ac183d709f210ff2f9a6356ceef8976a7b1c2279969dfff446f3d39e4bc71faaa55ba45a48723e
6
+ metadata.gz: 16bad696db1b02ab36402276bd40d0d75fafd2d2c89dc25284316bae46076c363d7f5281efde110b8960b211cd6a8a514e092fe31fc1aac77618b0f7565b91de
7
+ data.tar.gz: 346ddeccce7ad73b9669b89326f2bcc63b97c9b5a1cf181ca7dea4bf45e0555b71f9b758c168856356e0959b7e1c1923a220bf1bbd6d0f25639165202459f329
@@ -69,7 +69,11 @@ module L2meter
69
69
  end
70
70
 
71
71
  def clone
72
- self.class.new(configuration: configuration)
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
@@ -32,8 +32,8 @@ module L2meter
32
32
  def_delegators :receiver, *EMITTER_METHODS
33
33
 
34
34
  def context(*args, &block)
35
- value = emitter.context(*args, &block)
36
- block_given?? value : clone_with_emitter(value)
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
- clone.tap do |ts|
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
@@ -1,3 +1,3 @@
1
1
  module L2meter
2
- VERSION = "0.6.0".freeze
2
+ VERSION = "0.6.1".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: l2meter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Pravosud