tapping_device 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c63ce4e4858d3782152aa6a3bf320ac2a4f04f8ed733529b359a3bb8d331b53b
|
4
|
+
data.tar.gz: 3e0c20025265029c50a92ae563f9474667c964e9f45f08aae9712343b07f9a00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97ad06b1e7036ba88fa172db1e6908da7c85f28caf5592994829b40bcb3e999344c4cafb5f28e51cb87809a9a48f196dd34007d698e6ec363835ef6a095a7613
|
7
|
+
data.tar.gz: bd100d874f054ae5836d047d6f1acf142123b322c9b7bec7f6ef5f273823944e12ba11e9e9041f8bbd349575ac25b374ab8508393eb3468fd6c747b7b0dd9fd0
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tapping_device (0.5.
|
4
|
+
tapping_device (0.5.5)
|
5
5
|
activerecord (>= 5.2)
|
6
6
|
activesupport
|
7
7
|
pry
|
@@ -56,7 +56,7 @@ GEM
|
|
56
56
|
thread_safe (0.3.6)
|
57
57
|
tzinfo (1.2.7)
|
58
58
|
thread_safe (~> 0.1)
|
59
|
-
zeitwerk (2.
|
59
|
+
zeitwerk (2.4.0)
|
60
60
|
|
61
61
|
PLATFORMS
|
62
62
|
ruby
|
data/lib/tapping_device.rb
CHANGED
@@ -158,10 +158,7 @@ class TappingDevice
|
|
158
158
|
end
|
159
159
|
|
160
160
|
def get_method_object_from(target, method_name)
|
161
|
-
|
162
|
-
rescue ArgumentError
|
163
|
-
method_method = Object.method(:method).unbind
|
164
|
-
method_method.bind(target).call(method_name)
|
161
|
+
Object.instance_method(:method).bind(target).call(method_name)
|
165
162
|
rescue NameError
|
166
163
|
# if any part of the program uses Refinement to extend its methods
|
167
164
|
# we might still get NoMethodError when trying to get that method outside the scope
|
@@ -36,7 +36,7 @@ class TappingDevice
|
|
36
36
|
define_method "#{output_action}_instance_#{subject}" do |target_klass, options = {}|
|
37
37
|
collection_proxy = AsyncCollectionProxy.new
|
38
38
|
|
39
|
-
tap_init!(target_klass, options) do |payload|
|
39
|
+
tap_init!(target_klass, options.merge(force_recording: true)) do |payload|
|
40
40
|
collection_proxy << send(helper_method_name, payload.return_value, options)
|
41
41
|
end
|
42
42
|
|
@@ -9,6 +9,12 @@ class TappingDevice
|
|
9
9
|
@options[:event_type] = [event_type, "c_#{event_type}"]
|
10
10
|
end
|
11
11
|
|
12
|
+
def track(object)
|
13
|
+
super
|
14
|
+
@options[:is_active_record_model] = target.ancestors.include?(ActiveRecord::Base)
|
15
|
+
self
|
16
|
+
end
|
17
|
+
|
12
18
|
def build_payload(tp:, filepath:, line_number:)
|
13
19
|
payload = super
|
14
20
|
payload[:return_value] = payload[:receiver]
|
@@ -24,8 +30,8 @@ class TappingDevice
|
|
24
30
|
receiver = tp.self
|
25
31
|
method_name = tp.callee_id
|
26
32
|
|
27
|
-
if
|
28
|
-
method_name == :new && receiver.ancestors.include?(target)
|
33
|
+
if @options[:is_active_record_model]
|
34
|
+
method_name == :new && receiver.is_a?(Class) && receiver.ancestors.include?(target)
|
29
35
|
else
|
30
36
|
method_name == :initialize && receiver.is_a?(target)
|
31
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tapping_device
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- st0012
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|