trace_location 0.11.0 → 0.12.1
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 +9 -8
- 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: f49674737e97ee9ef9bd3b649db8e7541bd78719b41288d68040f827f65f13f6
|
4
|
+
data.tar.gz: 7655524b37f01035e2559e2900f9b1345787743f91c4e4eef55fc36d3ab27b75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e319f7513317f0f0e9729d0cd638d6063fdec0d5f2997e7b3046c724a91629d23b6d714b45e8cbaa6b5572748803210926f22cad6a3846f2e8157364a21f43b8
|
7
|
+
data.tar.gz: dda84c6c49a85acc1a8e218dae70b5ef3da3b06b21b7a545e0cfa983ee8379f622617fc8626aedc6c8054049c80edc71a9ba2a2cd454016453f66494b7cc8250
|
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.1)
|
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
@@ -5,19 +5,13 @@ require_relative 'trace_location/config'
|
|
5
5
|
require_relative 'trace_location/report'
|
6
6
|
require_relative 'trace_location/version'
|
7
7
|
|
8
|
-
begin
|
9
|
-
require 'rails'
|
10
|
-
require_relative 'trace_location/railtie'
|
11
|
-
rescue LoadError
|
12
|
-
nil
|
13
|
-
end
|
14
|
-
|
15
8
|
module TraceLocation # :nodoc:
|
16
9
|
def self.trace(options = {}, &block)
|
17
10
|
match = options.delete(:match)
|
18
11
|
ignore = options.delete(:ignore)
|
12
|
+
methods = options.delete(:methods)
|
19
13
|
|
20
|
-
result = Collector.collect(match: match, ignore: ignore, &block)
|
14
|
+
result = Collector.collect(match: match, ignore: ignore, methods: methods, &block)
|
21
15
|
Report.build(result.events, result.return_value, options).generate
|
22
16
|
true
|
23
17
|
rescue StandardError => e
|
@@ -34,3 +28,10 @@ module TraceLocation # :nodoc:
|
|
34
28
|
@config ||= Config.new
|
35
29
|
end
|
36
30
|
end
|
31
|
+
|
32
|
+
begin
|
33
|
+
require 'rails'
|
34
|
+
require_relative 'trace_location/railtie'
|
35
|
+
rescue LoadError
|
36
|
+
nil
|
37
|
+
end
|
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.1
|
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: 2023-01-04 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: []
|