tracy 0.0.2 → 0.0.4
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 +14 -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: b7dcd6a7eca599ef9d741f553822ca529c2f38eff179b08340b53fedff0bbed5
|
4
|
+
data.tar.gz: 40c1126a26fcbb0d6da23a29149adce8b4e9c15cdc6b1ce101bec9ce38d9d691
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba2ef839cc4ec6faa9a28a818ebb2ae07b26a7f8280962f1ff0d169fb86e92e233d2859bb5e7a9ecc23ab2a9fa475631c0278a015c4b8111370d9e828468b3d2
|
7
|
+
data.tar.gz: 8ecda946b40b9e5b7aeda7a463280f2b23aa1929d91df51ff8cd92d3f9b5c59221b0a35572e38cfb22d2873a0d8e248fefe5bae40c54c91fca1f78cf218ab17a
|
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,37 @@ 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("callsite-info.yml", permitted_classes: [Symbol])
|
35
37
|
|
36
|
-
selection = location_data.select do |key,
|
38
|
+
selection = location_data.select do |key, _callers|
|
37
39
|
loc = Location.new(*key)
|
38
40
|
loc.match(target_location)
|
39
41
|
end
|
40
42
|
|
41
43
|
selection.each do |key, callers|
|
42
44
|
puts "#{Location.new(*key).pretty_print} is called by"
|
43
|
-
callers.
|
45
|
+
callers.each_key do |call_site|
|
44
46
|
puts " #{Location.new(*call_site).pretty_print}"
|
45
47
|
end
|
46
48
|
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.4
|
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: 2024-11-30 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: '9.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '9.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.52'
|
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.52'
|
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.18'
|
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.18'
|
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: 3.0.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.5.23
|
118
|
+
signing_key:
|
91
119
|
specification_version: 4
|
92
120
|
summary: Fun with tracing
|
93
121
|
test_files: []
|