trace_location 0.12.2 → 1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +33 -0
- data/.github/workflows/rubocop.yml +24 -0
- data/.rubocop.yml +5 -2
- data/.rubocop_todo.yml +24 -0
- data/CHANGELOG.md +19 -0
- data/Gemfile +3 -1
- data/Gemfile.lock +43 -31
- data/README.md +0 -2
- data/exe/trace_location +1 -0
- data/lib/trace_location/cli.rb +4 -2
- data/lib/trace_location/event.rb +5 -3
- data/lib/trace_location/version.rb +1 -1
- data/lib/trace_location.rb +2 -2
- data/trace_location.gemspec +8 -4
- metadata +25 -12
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbbeb7108727e93706ca6fe199dc58b9c5fd5246e0d47d52d45dafd1908c343f
|
4
|
+
data.tar.gz: f7e10fb3febf2091394f5aaf0adcd2d712ce3d93faedd21f6ebf57621bf04305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7045401ffcd0b8732097fa273257409fb6c75da2f0bcf4aa277ad96a90db591c48202f37ff6b06f01f5ae7f9bfec2fbebccff963bc161b0646c15a9b49335448
|
7
|
+
data.tar.gz: 1267a27317e29eb71c346c89ce017fc07fef1f89ce30485addff44962f767db592c4e2fc3a21c5ad78cae59c9221218f8762d8a167f6c64093d37aa61a5ee176
|
@@ -0,0 +1,33 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- master
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
tests:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
continue-on-error: ${{ matrix.experimental }}
|
13
|
+
name: ${{ matrix.ruby }}
|
14
|
+
strategy:
|
15
|
+
matrix:
|
16
|
+
experimental: [false]
|
17
|
+
ruby:
|
18
|
+
- "3.1"
|
19
|
+
- "3.2"
|
20
|
+
- "3.3"
|
21
|
+
- "3.4"
|
22
|
+
include:
|
23
|
+
- { ruby: head, experimental: true }
|
24
|
+
steps:
|
25
|
+
- uses: actions/checkout@v3
|
26
|
+
- name: Set up Ruby
|
27
|
+
uses: ruby/setup-ruby@v1
|
28
|
+
with:
|
29
|
+
ruby-version: ${{ matrix.ruby }}
|
30
|
+
bundler-cache: true
|
31
|
+
- name: Run tests
|
32
|
+
timeout-minutes: 5
|
33
|
+
run: bundle exec rake
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Rubocop
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- master
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
strategy:
|
13
|
+
matrix:
|
14
|
+
ruby:
|
15
|
+
- "3.1"
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v3
|
18
|
+
- name: Set up Ruby
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
bundler-cache: true
|
23
|
+
- name: Run linter
|
24
|
+
run: bundle exec rubocop
|
data/.rubocop.yml
CHANGED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp`
|
3
|
+
# using RuboCop version 1.69.2.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Configuration parameters: AllowComments, AllowNil.
|
10
|
+
Lint/SuppressedException:
|
11
|
+
Exclude:
|
12
|
+
- 'lib/trace_location/collector.rb'
|
13
|
+
|
14
|
+
# Configuration parameters: Max, AllowedGroups.
|
15
|
+
RSpec/NestedGroups:
|
16
|
+
Exclude:
|
17
|
+
- 'spec/trace_location_spec.rb'
|
18
|
+
|
19
|
+
# Configuration parameters: AllowedConstants.
|
20
|
+
Style/Documentation:
|
21
|
+
Exclude:
|
22
|
+
- 'spec/**/*'
|
23
|
+
- 'test/**/*'
|
24
|
+
- 'lib/trace_location/cli.rb'
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# TraceLocation changelog
|
2
|
+
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
## 1.1.0 (2025-01-02)
|
6
|
+
|
7
|
+
* Fix rubocop offenses
|
8
|
+
|
9
|
+
## 1.0.0 (2025-01-01)
|
10
|
+
|
11
|
+
* Use GitHub Actions for CI instead of Travis CI
|
12
|
+
* Bump rexml from 3.2.8 to 3.3.9 (#36)
|
13
|
+
* Add csv dependency to gemspec (#35 by @tnagatomi)
|
14
|
+
* Support Ruby 3.4
|
15
|
+
* Drop Ruby <= 3.0 support
|
16
|
+
* Update development dependencies.
|
17
|
+
* Add rubocop-rake, rubocop-rspec to development dependencies.
|
18
|
+
* Generate `.rubocop_todo.yml`
|
19
|
+
* Add rubocop jobs to GitHub Actions
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,50 +1,60 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
trace_location (
|
4
|
+
trace_location (1.1)
|
5
|
+
csv
|
5
6
|
method_source
|
6
7
|
|
7
8
|
GEM
|
8
9
|
remote: https://rubygems.org/
|
9
10
|
specs:
|
10
11
|
ast (2.4.2)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
csv (3.3.2)
|
13
|
+
diff-lcs (1.5.1)
|
14
|
+
json (2.9.1)
|
15
|
+
language_server-protocol (3.17.0.3)
|
16
|
+
method_source (1.1.0)
|
17
|
+
parallel (1.26.3)
|
18
|
+
parser (3.3.6.0)
|
16
19
|
ast (~> 2.4.1)
|
20
|
+
racc
|
21
|
+
racc (1.8.1)
|
17
22
|
rainbow (3.1.1)
|
18
|
-
rake (13.
|
19
|
-
regexp_parser (2.
|
20
|
-
|
21
|
-
|
22
|
-
rspec-
|
23
|
-
rspec-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
rspec-expectations (3.12.1)
|
23
|
+
rake (13.2.1)
|
24
|
+
regexp_parser (2.10.0)
|
25
|
+
rspec (3.13.0)
|
26
|
+
rspec-core (~> 3.13.0)
|
27
|
+
rspec-expectations (~> 3.13.0)
|
28
|
+
rspec-mocks (~> 3.13.0)
|
29
|
+
rspec-core (3.13.2)
|
30
|
+
rspec-support (~> 3.13.0)
|
31
|
+
rspec-expectations (3.13.3)
|
28
32
|
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
-
rspec-support (~> 3.
|
30
|
-
rspec-mocks (3.
|
33
|
+
rspec-support (~> 3.13.0)
|
34
|
+
rspec-mocks (3.13.2)
|
31
35
|
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
-
rspec-support (~> 3.
|
33
|
-
rspec-support (3.
|
34
|
-
rubocop (1.
|
36
|
+
rspec-support (~> 3.13.0)
|
37
|
+
rspec-support (3.13.2)
|
38
|
+
rubocop (1.69.2)
|
35
39
|
json (~> 2.3)
|
40
|
+
language_server-protocol (>= 3.17.0)
|
36
41
|
parallel (~> 1.10)
|
37
|
-
parser (>= 3.
|
42
|
+
parser (>= 3.3.0.2)
|
38
43
|
rainbow (>= 2.2.2, < 4.0)
|
39
|
-
regexp_parser (>=
|
40
|
-
|
41
|
-
rubocop-ast (>= 1.24.1, < 2.0)
|
44
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
45
|
+
rubocop-ast (>= 1.36.2, < 2.0)
|
42
46
|
ruby-progressbar (~> 1.7)
|
43
|
-
unicode-display_width (>=
|
44
|
-
rubocop-ast (1.
|
45
|
-
parser (>= 3.
|
46
|
-
|
47
|
-
|
47
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
48
|
+
rubocop-ast (1.37.0)
|
49
|
+
parser (>= 3.3.1.0)
|
50
|
+
rubocop-rake (0.6.0)
|
51
|
+
rubocop (~> 1.0)
|
52
|
+
rubocop-rspec (3.3.0)
|
53
|
+
rubocop (~> 1.61)
|
54
|
+
ruby-progressbar (1.13.0)
|
55
|
+
unicode-display_width (3.1.3)
|
56
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
57
|
+
unicode-emoji (4.0.4)
|
48
58
|
|
49
59
|
PLATFORMS
|
50
60
|
ruby
|
@@ -54,7 +64,9 @@ DEPENDENCIES
|
|
54
64
|
rake
|
55
65
|
rspec
|
56
66
|
rubocop
|
67
|
+
rubocop-rake
|
68
|
+
rubocop-rspec
|
57
69
|
trace_location!
|
58
70
|
|
59
71
|
BUNDLED WITH
|
60
|
-
2.
|
72
|
+
2.6.2
|
data/README.md
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# TraceLocation
|
2
2
|
|
3
|
-
[](https://travis-ci.org/yhirano55/trace_location)
|
4
|
-
|
5
3
|
TraceLocation helps you trace the source location to ease reading huge open-source libraries in Ruby.
|
6
4
|
|
7
5
|
## Installation
|
data/exe/trace_location
CHANGED
data/lib/trace_location/cli.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'optparse'
|
2
4
|
|
3
5
|
module TraceLocation
|
@@ -20,7 +22,7 @@ module TraceLocation
|
|
20
22
|
opt.order!(argv, into: params)
|
21
23
|
params.transform_keys! { |k| k.to_s.gsub('-', '_').to_sym }
|
22
24
|
|
23
|
-
if code = params.delete(:e)
|
25
|
+
if (code = params.delete(:e))
|
24
26
|
exec_code code, params
|
25
27
|
else
|
26
28
|
file = argv.shift
|
@@ -52,7 +54,7 @@ module TraceLocation
|
|
52
54
|
|
53
55
|
def exec_code(code, params)
|
54
56
|
TraceLocation.trace(params) do
|
55
|
-
eval code
|
57
|
+
eval code # rubocop:disable Security/Eval
|
56
58
|
end
|
57
59
|
end
|
58
60
|
end
|
data/lib/trace_location/event.rb
CHANGED
@@ -2,10 +2,12 @@
|
|
2
2
|
|
3
3
|
module TraceLocation
|
4
4
|
class Event # :nodoc:
|
5
|
-
CLASS_FORMAT = /\A#<(?:Class|refinement)
|
6
|
-
attr_reader :id, :event, :path, :lineno, :caller_path, :caller_lineno, :owner, :name, :source, :hierarchy,
|
5
|
+
CLASS_FORMAT = /\A#<(?:Class|refinement):([A-Za-z0-9:]+).*>\z/
|
6
|
+
attr_reader :id, :event, :path, :lineno, :caller_path, :caller_lineno, :owner, :name, :source, :hierarchy,
|
7
|
+
:is_module
|
7
8
|
|
8
|
-
def initialize(id:, event:, path:, lineno:, caller_path:, caller_lineno:, owner:, name:, source:, hierarchy:,
|
9
|
+
def initialize(id:, event:, path:, lineno:, caller_path:, caller_lineno:, owner:, name:, source:, hierarchy:,
|
10
|
+
is_module:)
|
9
11
|
@id = id
|
10
12
|
@event = event
|
11
13
|
@path = path
|
data/lib/trace_location.rb
CHANGED
@@ -15,8 +15,8 @@ module TraceLocation # :nodoc:
|
|
15
15
|
Report.build(result.events, result.return_value, options).generate
|
16
16
|
true
|
17
17
|
rescue StandardError => e
|
18
|
-
|
19
|
-
|
18
|
+
warn 'Failure: TraceLocation got an unexpected error.'
|
19
|
+
warn e.full_message
|
20
20
|
false
|
21
21
|
end
|
22
22
|
|
data/trace_location.gemspec
CHANGED
@@ -7,11 +7,14 @@ require 'trace_location/version'
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = 'trace_location'
|
9
9
|
s.version = TraceLocation::VERSION
|
10
|
-
s.authors = ['Yoshiyuki Hirano'
|
11
|
-
s.email = ['yhirano@me.com'
|
10
|
+
s.authors = ['Yoshiyuki Hirano']
|
11
|
+
s.email = ['yhirano@me.com']
|
12
12
|
s.homepage = 'https://github.com/yhirano55/trace_location'
|
13
13
|
s.summary = 'helps you get tracing the source location of codes'
|
14
|
-
s.description =
|
14
|
+
s.description = <<~DESCRIPTION
|
15
|
+
TraceLocation helps you get tracing the source location of codes,
|
16
|
+
and helps you can get reading the huge open souce libraries in Ruby
|
17
|
+
DESCRIPTION
|
15
18
|
s.license = 'MIT'
|
16
19
|
s.files = Dir.chdir(File.expand_path('.', __dir__)) do
|
17
20
|
`git ls-files -z`.split("\x0").reject do |f|
|
@@ -21,8 +24,9 @@ Gem::Specification.new do |s|
|
|
21
24
|
s.bindir = 'exe'
|
22
25
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
26
|
s.require_paths = ['lib']
|
24
|
-
s.required_ruby_version = '>=
|
27
|
+
s.required_ruby_version = '>= 3.1.0'
|
25
28
|
|
29
|
+
s.add_dependency 'csv'
|
26
30
|
s.add_dependency 'method_source'
|
27
31
|
|
28
32
|
s.add_development_dependency 'bundler'
|
metadata
CHANGED
@@ -1,16 +1,28 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trace_location
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: '1.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshiyuki Hirano
|
8
|
-
- Misaki Shioi
|
9
|
-
autorequire:
|
10
8
|
bindir: exe
|
11
9
|
cert_chain: []
|
12
|
-
date:
|
10
|
+
date: 2025-01-02 00:00:00.000000000 Z
|
13
11
|
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: csv
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '0'
|
14
26
|
- !ruby/object:Gem::Dependency
|
15
27
|
name: method_source
|
16
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,20 +79,23 @@ dependencies:
|
|
67
79
|
- - ">="
|
68
80
|
- !ruby/object:Gem::Version
|
69
81
|
version: '0'
|
70
|
-
description:
|
71
|
-
helps you
|
82
|
+
description: |
|
83
|
+
TraceLocation helps you get tracing the source location of codes,
|
84
|
+
and helps you can get reading the huge open souce libraries in Ruby
|
72
85
|
email:
|
73
86
|
- yhirano@me.com
|
74
|
-
- shioi.mm@gmail.com
|
75
87
|
executables:
|
76
88
|
- trace_location
|
77
89
|
extensions: []
|
78
90
|
extra_rdoc_files: []
|
79
91
|
files:
|
92
|
+
- ".github/workflows/ci.yml"
|
93
|
+
- ".github/workflows/rubocop.yml"
|
80
94
|
- ".gitignore"
|
81
95
|
- ".rspec"
|
82
96
|
- ".rubocop.yml"
|
83
|
-
- ".
|
97
|
+
- ".rubocop_todo.yml"
|
98
|
+
- CHANGELOG.md
|
84
99
|
- Gemfile
|
85
100
|
- Gemfile.lock
|
86
101
|
- LICENSE.txt
|
@@ -122,7 +137,6 @@ homepage: https://github.com/yhirano55/trace_location
|
|
122
137
|
licenses:
|
123
138
|
- MIT
|
124
139
|
metadata: {}
|
125
|
-
post_install_message:
|
126
140
|
rdoc_options: []
|
127
141
|
require_paths:
|
128
142
|
- lib
|
@@ -130,15 +144,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
130
144
|
requirements:
|
131
145
|
- - ">="
|
132
146
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
147
|
+
version: 3.1.0
|
134
148
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - ">="
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '0'
|
139
153
|
requirements: []
|
140
|
-
rubygems_version: 3.
|
141
|
-
signing_key:
|
154
|
+
rubygems_version: 3.6.2
|
142
155
|
specification_version: 4
|
143
156
|
summary: helps you get tracing the source location of codes
|
144
157
|
test_files: []
|