refining 0.0.5 → 0.0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/refining.rb +4 -4
  2. metadata +1 -1
@@ -24,7 +24,7 @@ class Object
24
24
  end
25
25
 
26
26
  what.send :define_method, meth do |*args, &blk|
27
- return if @__refining_defined__ && [:method_added, :singleton_method_added].member?(meth)
27
+ return if instance_variable_defined?(:@__refining_defined__) && [:method_added, :singleton_method_added].member?(meth)
28
28
 
29
29
  @__refining_defined__ = true
30
30
  what.send(:define_method, 'temporary method for refining', &block)
@@ -32,7 +32,7 @@ class Object
32
32
  target.send('temporary method for refining', old.is_a?(UnboundMethod) ? old.bind(self) : old, *args, &blk).tap {
33
33
  what.send(:undef_method, 'temporary method for refining') rescue nil
34
34
 
35
- @__refining_defined__ = false
35
+ remove_instance_variable(:@__refining_defined__) rescue nil
36
36
  }
37
37
  end
38
38
  }
@@ -47,7 +47,7 @@ class Module
47
47
  old ||= proc {}
48
48
 
49
49
  define_method(meth) {|*args, &blk|
50
- return if @__refining_defined__ && [:method_added, :singleton_method_added].member?(meth)
50
+ return if instance_variable_defined?(:@__refining_defined__) && [:method_added, :singleton_method_added].member?(meth)
51
51
 
52
52
  what = class << self
53
53
  self
@@ -59,7 +59,7 @@ class Module
59
59
  send('temporary method for refining', old.is_a?(UnboundMethod) ? old.bind(self) : old, *args, &blk).tap {
60
60
  what.send(:undef_method, 'temporary method for refining') rescue nil
61
61
 
62
- @__refining_defined__ = false
62
+ remove_instance_variable(:@__refining_defined__) rescue nil
63
63
  }
64
64
  }
65
65
  }
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refining
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.5
5
+ version: 0.0.5.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - meh.