trace_location 0.11.0 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/Gemfile.lock +33 -26
- data/README.md +2 -1
- data/lib/trace_location/collector.rb +3 -1
- data/lib/trace_location/version.rb +1 -1
- data/lib/trace_location.rb +2 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f72080e074e711ead889178f5bf03db6f01b2d1f2baee4c7a0017c8e1b374e2
|
4
|
+
data.tar.gz: 83d066fd0c05fd30488ab17a213d2e6cc871a6b2274e155dd3ee87f2c12cf7a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5ea1a2a317eeddd8a02b6013150a8969db58738b724004775f99d4a284cfdc394d620a81bff79063cd07cf295f42f4be98d62b3150c62da83fed95b3f51e6dc
|
7
|
+
data.tar.gz: 9fae9ec4eb6e18de78ffec2e94718fd8eb7b3d3fb8f46964aecce96da4fedfc5efe161d2ce2f514a201e0cb556b3e2759e1f7136a0c9c0b9ef655419e4bedd2a
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,43 +1,50 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
trace_location (0.
|
4
|
+
trace_location (0.12.0)
|
5
5
|
method_source
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
ast (2.4.
|
11
|
-
diff-lcs (1.
|
12
|
-
|
10
|
+
ast (2.4.2)
|
11
|
+
diff-lcs (1.5.0)
|
12
|
+
json (2.6.3)
|
13
13
|
method_source (1.0.0)
|
14
|
-
parallel (1.
|
15
|
-
parser (
|
16
|
-
ast (~> 2.4.
|
17
|
-
rainbow (3.
|
18
|
-
rake (13.0.
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
rspec-
|
23
|
-
|
24
|
-
rspec-
|
25
|
-
rspec-
|
14
|
+
parallel (1.22.1)
|
15
|
+
parser (3.1.3.0)
|
16
|
+
ast (~> 2.4.1)
|
17
|
+
rainbow (3.1.1)
|
18
|
+
rake (13.0.6)
|
19
|
+
regexp_parser (2.6.1)
|
20
|
+
rexml (3.2.5)
|
21
|
+
rspec (3.12.0)
|
22
|
+
rspec-core (~> 3.12.0)
|
23
|
+
rspec-expectations (~> 3.12.0)
|
24
|
+
rspec-mocks (~> 3.12.0)
|
25
|
+
rspec-core (3.12.0)
|
26
|
+
rspec-support (~> 3.12.0)
|
27
|
+
rspec-expectations (3.12.0)
|
26
28
|
diff-lcs (>= 1.2.0, < 2.0)
|
27
|
-
rspec-support (~> 3.
|
28
|
-
rspec-mocks (3.
|
29
|
+
rspec-support (~> 3.12.0)
|
30
|
+
rspec-mocks (3.12.1)
|
29
31
|
diff-lcs (>= 1.2.0, < 2.0)
|
30
|
-
rspec-support (~> 3.
|
31
|
-
rspec-support (3.
|
32
|
-
rubocop (
|
33
|
-
|
32
|
+
rspec-support (~> 3.12.0)
|
33
|
+
rspec-support (3.12.0)
|
34
|
+
rubocop (1.40.0)
|
35
|
+
json (~> 2.3)
|
34
36
|
parallel (~> 1.10)
|
35
|
-
parser (>= 2.
|
37
|
+
parser (>= 3.1.2.1)
|
36
38
|
rainbow (>= 2.2.2, < 4.0)
|
39
|
+
regexp_parser (>= 1.8, < 3.0)
|
40
|
+
rexml (>= 3.2.5, < 4.0)
|
41
|
+
rubocop-ast (>= 1.23.0, < 2.0)
|
37
42
|
ruby-progressbar (~> 1.7)
|
38
|
-
unicode-display_width (>= 1.4.0, <
|
39
|
-
|
40
|
-
|
43
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
44
|
+
rubocop-ast (1.24.0)
|
45
|
+
parser (>= 3.1.1.0)
|
46
|
+
ruby-progressbar (1.11.0)
|
47
|
+
unicode-display_width (2.3.0)
|
41
48
|
|
42
49
|
PLATFORMS
|
43
50
|
ruby
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/yhirano55/trace_location.svg?branch=master)](https://travis-ci.org/yhirano55/trace_location)
|
4
4
|
|
5
|
-
TraceLocation helps you
|
5
|
+
TraceLocation helps you trace the source location to ease reading huge open-source libraries in Ruby.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -42,6 +42,7 @@ Then you can get logs like this: [.md](https://github.com/yhirano55/trace_locati
|
|
42
42
|
| format | `:md`, `:log`, `:csv` (default: `:md`) | `:md` |
|
43
43
|
| match | Regexp, Symbol, String or Array for allow list | `[:activerecord, :activesupport]` |
|
44
44
|
| ignore | Regexp, Symbol, String or Array for deny list | `/bootsnap\|activesupport/` |
|
45
|
+
| methods | Symbol or Array of method names | `[:call]` |
|
45
46
|
|
46
47
|
## More examples
|
47
48
|
|
@@ -8,7 +8,8 @@ module TraceLocation
|
|
8
8
|
Result = Struct.new(:events, :return_value)
|
9
9
|
|
10
10
|
class << self
|
11
|
-
def collect(match:, ignore:, &block)
|
11
|
+
def collect(match:, ignore:, methods:, &block)
|
12
|
+
methods = Array(methods) if methods
|
12
13
|
events = []
|
13
14
|
hierarchy = 0
|
14
15
|
id = 0
|
@@ -18,6 +19,7 @@ module TraceLocation
|
|
18
19
|
tracer = TracePoint.new(:call, :return) do |trace_point|
|
19
20
|
next if match && !trace_point.path.to_s.match?(/#{Array(match).join('|')}/)
|
20
21
|
next if ignore && trace_point.path.to_s.match?(/#{Array(ignore).join('|')}/)
|
22
|
+
next if methods && !methods.include?(trace_point.method_id)
|
21
23
|
|
22
24
|
id += 1
|
23
25
|
caller_loc = caller_locations(2, 1)[0]
|
data/lib/trace_location.rb
CHANGED
@@ -16,8 +16,9 @@ module TraceLocation # :nodoc:
|
|
16
16
|
def self.trace(options = {}, &block)
|
17
17
|
match = options.delete(:match)
|
18
18
|
ignore = options.delete(:ignore)
|
19
|
+
methods = options.delete(:methods)
|
19
20
|
|
20
|
-
result = Collector.collect(match: match, ignore: ignore, &block)
|
21
|
+
result = Collector.collect(match: match, ignore: ignore, methods: methods, &block)
|
21
22
|
Report.build(result.events, result.return_value, options).generate
|
22
23
|
true
|
23
24
|
rescue StandardError => e
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trace_location
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshiyuki Hirano
|
8
8
|
- Misaki Shioi
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-12-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: method_source
|
@@ -122,7 +122,7 @@ homepage: https://github.com/yhirano55/trace_location
|
|
122
122
|
licenses:
|
123
123
|
- MIT
|
124
124
|
metadata: {}
|
125
|
-
post_install_message:
|
125
|
+
post_install_message:
|
126
126
|
rdoc_options: []
|
127
127
|
require_paths:
|
128
128
|
- lib
|
@@ -137,8 +137,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
|
-
rubygems_version: 3.
|
141
|
-
signing_key:
|
140
|
+
rubygems_version: 3.3.26
|
141
|
+
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: helps you get tracing the source location of codes
|
144
144
|
test_files: []
|