tracy 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +3 -1
- data/Rakefile +5 -3
- data/bin/callsites +15 -12
- data/features/support/env.rb +3 -1
- data/lib/tracy.rb +5 -3
- metadata +46 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ecd5eadfc5a70e7a34e3fd0e1e5ebddf1b5b37129317ca82125d26c7fb6a6c4a
|
4
|
+
data.tar.gz: d11fb91d028bd722899ec728483494649f821e00d2d0929adad6b026efcc2b4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1e31b4a1079d22dbd87e0505b79888bcc9328c605748a47c49a5fbae578b55feccbfe5107de84155907d270a400ac3617ae510d6123beda7d8496a28f940d07
|
7
|
+
data.tar.gz: 9c8963d78f7568744d709655a1b099cf81e71a60e49dc27dc25c136c1ca7c8cd96254731d5e6ae702c3c23939d3ca707813dccf6fe359f329b31b16682c80c01
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/bin/callsites
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "yaml"
|
3
5
|
|
4
6
|
Location = Struct.new(:method_name, :class_name, :line, :file) do
|
5
7
|
def match(other)
|
@@ -10,37 +12,38 @@ Location = Struct.new(:method_name, :class_name, :line, :file) do
|
|
10
12
|
end
|
11
13
|
|
12
14
|
def pretty_print
|
13
|
-
if method_name
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
name = if method_name
|
16
|
+
"#{class_name}##{method_name}"
|
17
|
+
else
|
18
|
+
"<main>"
|
19
|
+
end
|
18
20
|
"#{name} at #{file}:#{line}"
|
19
21
|
end
|
20
22
|
end
|
21
23
|
|
22
24
|
location = ARGV[0]
|
23
25
|
|
24
|
-
if
|
25
|
-
file, line = location.split
|
26
|
+
if /:\d+$/.match?(location)
|
27
|
+
file, line = location.split ":"
|
26
28
|
line = line.to_i
|
27
29
|
else
|
28
|
-
class_name, method_name = location.split
|
30
|
+
class_name, method_name = location.split "#"
|
29
31
|
method_name = method_name.to_sym if method_name
|
30
32
|
end
|
31
33
|
|
32
34
|
target_location = Location.new(method_name, class_name, line, file)
|
33
35
|
|
34
|
-
location_data = YAML.
|
36
|
+
location_data = YAML.safe_load(File.read("callsite-info.yml"),
|
37
|
+
permitted_classes: [Symbol])
|
35
38
|
|
36
|
-
selection = location_data.select do |key,
|
39
|
+
selection = location_data.select do |key, _callers|
|
37
40
|
loc = Location.new(*key)
|
38
41
|
loc.match(target_location)
|
39
42
|
end
|
40
43
|
|
41
44
|
selection.each do |key, callers|
|
42
45
|
puts "#{Location.new(*key).pretty_print} is called by"
|
43
|
-
callers.
|
46
|
+
callers.each_key do |call_site|
|
44
47
|
puts " #{Location.new(*call_site).pretty_print}"
|
45
48
|
end
|
46
49
|
end
|
data/features/support/env.rb
CHANGED
data/lib/tracy.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "yaml"
|
2
4
|
|
3
5
|
class Tracy
|
4
6
|
def initialize
|
@@ -19,13 +21,13 @@ class Tracy
|
|
19
21
|
|
20
22
|
def done
|
21
23
|
@trace.disable
|
22
|
-
|
24
|
+
File.write("callsite-info.yml", YAML.dump(@callers))
|
23
25
|
end
|
24
26
|
|
25
27
|
private
|
26
28
|
|
27
29
|
def data_array(trace_point)
|
28
30
|
klass = trace_point.defined_class
|
29
|
-
[trace_point.method_id, klass ? klass.name :
|
31
|
+
[trace_point.method_id, klass ? klass.name : "", trace_point.lineno, trace_point.path]
|
30
32
|
end
|
31
33
|
end
|
metadata
CHANGED
@@ -1,58 +1,86 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tracy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matijs van Zuijlen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: aruba
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cucumber
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '7.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '7.0'
|
13
41
|
- !ruby/object:Gem::Dependency
|
14
42
|
name: rake
|
15
43
|
requirement: !ruby/object:Gem::Requirement
|
16
44
|
requirements:
|
17
45
|
- - "~>"
|
18
46
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
47
|
+
version: '13.0'
|
20
48
|
type: :development
|
21
49
|
prerelease: false
|
22
50
|
version_requirements: !ruby/object:Gem::Requirement
|
23
51
|
requirements:
|
24
52
|
- - "~>"
|
25
53
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
54
|
+
version: '13.0'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
56
|
+
name: rubocop
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
59
|
- - "~>"
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
61
|
+
version: 1.25.0
|
34
62
|
type: :development
|
35
63
|
prerelease: false
|
36
64
|
version_requirements: !ruby/object:Gem::Requirement
|
37
65
|
requirements:
|
38
66
|
- - "~>"
|
39
67
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
68
|
+
version: 1.25.0
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
70
|
+
name: rubocop-performance
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
44
72
|
requirements:
|
45
73
|
- - "~>"
|
46
74
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
75
|
+
version: 1.13.0
|
48
76
|
type: :development
|
49
77
|
prerelease: false
|
50
78
|
version_requirements: !ruby/object:Gem::Requirement
|
51
79
|
requirements:
|
52
80
|
- - "~>"
|
53
81
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
55
|
-
description:
|
82
|
+
version: 1.13.0
|
83
|
+
description:
|
56
84
|
email: matijs@matijs.net
|
57
85
|
executables:
|
58
86
|
- callsites
|
@@ -68,8 +96,9 @@ files:
|
|
68
96
|
- lib/tracy.rb
|
69
97
|
homepage: http://www.matijs.net
|
70
98
|
licenses: []
|
71
|
-
metadata:
|
72
|
-
|
99
|
+
metadata:
|
100
|
+
rubygems_mfa_required: 'true'
|
101
|
+
post_install_message:
|
73
102
|
rdoc_options: []
|
74
103
|
require_paths:
|
75
104
|
- lib
|
@@ -78,16 +107,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
78
107
|
requirements:
|
79
108
|
- - ">="
|
80
109
|
- !ruby/object:Gem::Version
|
81
|
-
version:
|
110
|
+
version: 2.7.0
|
82
111
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
83
112
|
requirements:
|
84
113
|
- - ">="
|
85
114
|
- !ruby/object:Gem::Version
|
86
115
|
version: '0'
|
87
116
|
requirements: []
|
88
|
-
|
89
|
-
|
90
|
-
signing_key:
|
117
|
+
rubygems_version: 3.3.3
|
118
|
+
signing_key:
|
91
119
|
specification_version: 4
|
92
120
|
summary: Fun with tracing
|
93
121
|
test_files: []
|