tapping_device 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/tapping_device.rb +4 -5
- data/lib/tapping_device/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 89e8a71fd5423c54c59b6b46f672e228aa72e413173a79885c92ea5c5839c8b6
|
4
|
+
data.tar.gz: 83960e79383e8f892e060f892be301a54744c177f36219d3a24828e734d0ffb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3917a20a5f63ba529bf5834b09d5446ecde966fb033e682460fcad47be6861912bfc4d908c2d16b0e5d567a179a469a7e173adb196acdf6a217a44fee05a579
|
7
|
+
data.tar.gz: 53998f52cbfbe390e047237236dc26646803b0a0d59428e4d73d85319fb820a27e64832082ee0a328f87f514f7de6cbc4f9d08737dfe44ee644b798a87fb6d10
|
data/Gemfile.lock
CHANGED
data/lib/tapping_device.rb
CHANGED
@@ -158,6 +158,7 @@ class TappingDevice
|
|
158
158
|
return false if is_from_target?(self, tp)
|
159
159
|
|
160
160
|
method_object = get_method_object_from(tp.self, tp.callee_id)
|
161
|
+
return false unless method_object.is_a?(Method)
|
161
162
|
# if a no-arugment method is called, tp.binding.local_variables will be those local variables in the same scope
|
162
163
|
# so we need to make sure the method takes arguments, then we can be sure that the locals are arguments
|
163
164
|
return false unless method_object && method_object.arity.to_i > 0
|
@@ -167,12 +168,10 @@ class TappingDevice
|
|
167
168
|
argument_values.any? do |value|
|
168
169
|
# during comparison, Ruby might perform data type conversion like calling `to_sym` on the value
|
169
170
|
# but not every value supports every conversion methods
|
170
|
-
|
171
|
-
object == value
|
172
|
-
rescue NoMethodError
|
173
|
-
false
|
174
|
-
end
|
171
|
+
object == value rescue false
|
175
172
|
end
|
173
|
+
rescue
|
174
|
+
false
|
176
175
|
end
|
177
176
|
|
178
177
|
def get_method_object_from(target, method_name)
|