call_graph 1.3.0 → 1.4.0

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
  SHA256:
3
- metadata.gz: 7ec8d09cac62e18130df21d02f0b7eeea51154745075624690130ef86fea98f7
4
- data.tar.gz: e838253ebd96b790b94060170479b40aaf332e9cb29a5e6b88f3270ab743dd92
3
+ metadata.gz: bcd33a52fc43f59ef6091fe3a92434a95235f5f2e58566967bc7d7d3bf46349e
4
+ data.tar.gz: 10a27b36fc8564f215d460f86617af342fbeb3343c3d7bd11ffb6b2b46d263f9
5
5
  SHA512:
6
- metadata.gz: 5963c9694168762faae31960ea239cd93dc4c28660d6ae029485e8d7b9c09ab0cf6f0e350aef3314cc13b53a1f2b1827ac3507e1f06631c663fecbc394482943
7
- data.tar.gz: 36724ffefd64a31ff9f06240ee1e6a111158a8202702eae8f94be529a75dc0fa8092eea16f4cb880b45c68cdd235b6cd2d27de9d714c1ea5d333d407856ee080
6
+ metadata.gz: 42592b022f1c7a19852a89ec357f64b326cac18db7b7151486912b6264cbdf203004ae6185d8c8e2b2c4e311a78436e9ad9aa642caf2fa7c11dc1f6daa14417e
7
+ data.tar.gz: 2bbab7ec72ac7683e40d91ae3e5b719f5145f24311caf5b0490c1aad8554094d4a057c3bfc7ddc6505113269f7f5e9fd43f9ddbd1a3d6f012bec9065790b07dd
@@ -46,11 +46,9 @@ module CallGraph
46
46
  ]
47
47
  end
48
48
 
49
- # :nocov:
50
- # NOTE: - some calls outside the trace proc cause the vm to segvault.
51
- # - i've be unable to extract methods because of the above.
52
49
  def start
53
- set_trace_func ->(event, file, _line, id, receiver_binding, classname) {
50
+ set_trace_func ->(event, file, _line, id, receiver_binding, classname) do
51
+ # :nocov:
54
52
  return if ignore_paths.any? { |path| file[path] }
55
53
 
56
54
  case event
@@ -67,16 +65,22 @@ module CallGraph
67
65
  receiver_class = receiver_class + ' ' + receiver_binding.eval("self.class == Class ? '(Class)' : '(Instance)'")
68
66
 
69
67
  return if classname == CallGraph
68
+ return if classname == CallGraph::Instrument
70
69
  return if caller_class == receiver_class
71
70
  return if ignore_methods.include?(id)
72
71
 
73
72
  set.add("#{caller_class},#{receiver_class},#{id}")
74
73
  end
75
- }
74
+ #:nocov:
75
+ end
76
76
  end
77
77
 
78
78
  def stop
79
+ set_trace_func nil
80
+
79
81
  File.open(path(:tmp), 'w') { |fd| fd.write set.to_a.compact.join("\n") }
82
+
83
+ set.clear
80
84
  end
81
85
  end
82
86
  end
@@ -1,3 +1,3 @@
1
1
  module CallGraph
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
data/lib/call_graph.rb CHANGED
@@ -17,8 +17,6 @@ module CallGraph
17
17
  end
18
18
 
19
19
  def self.stop
20
- set_trace_func nil
21
-
22
20
  instrument.stop
23
21
  end
24
22
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: call_graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Moriarty
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-24 00:00:00.000000000 Z
11
+ date: 2019-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller