trace_location 1.0 → 1.2.0
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 +2 -0
- data/.rubocop.yml +9 -2
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +3 -1
- data/exe/trace_location +1 -0
- data/lib/trace_location/cli.rb +4 -2
- data/lib/trace_location/collector.rb +1 -0
- 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 +7 -3
- metadata +19 -7
- data/.rubocop_todo.yml +0 -113
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d37e8b471c4a66786bf78aab1c023c62e34f542e10b9031656afb26c650fab7
|
4
|
+
data.tar.gz: 8b7b6a30398f0c458c245f9aa542835fe177e55351a5b4d53824d9e17bd5cd5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa6e3b4b465203a6dc5beba06a99c5fda0ccd2e65c6ddfb22c3c49c7cfd58caff95f3adaaa44b4f062b7ed418d0f4dae90aece2b199c206663d7d1035891108f
|
7
|
+
data.tar.gz: baec0749164cf226b82821579ac5d928beea569a2d5a315b62c935beb695202574d57b1bcd56b0bc172c6acdf2e9416d548531d9f3dfd51d7998a72f1ea1eaef
|
data/.github/workflows/ci.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,8 +1,15 @@
|
|
1
|
-
inherit_from: .rubocop_todo.yml
|
2
|
-
|
3
1
|
require:
|
4
2
|
- rubocop-rake
|
5
3
|
- rubocop-rspec
|
6
4
|
|
7
5
|
Metrics:
|
8
6
|
Enabled: false
|
7
|
+
|
8
|
+
RSpec/NestedGroups:
|
9
|
+
Max: 4
|
10
|
+
|
11
|
+
Style/Documentation:
|
12
|
+
Exclude:
|
13
|
+
- 'spec/**/*'
|
14
|
+
- 'test/**/*'
|
15
|
+
- 'lib/trace_location/cli.rb'
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,15 @@
|
|
2
2
|
|
3
3
|
## Unreleased
|
4
4
|
|
5
|
+
## 1.2.0 (2025-01-03)
|
6
|
+
|
7
|
+
* Fix rubocop offenses
|
8
|
+
* Add warning gem to development dependencies
|
9
|
+
|
10
|
+
## 1.1.0 (2025-01-02)
|
11
|
+
|
12
|
+
* Fix rubocop offenses
|
13
|
+
|
5
14
|
## 1.0.0 (2025-01-01)
|
6
15
|
|
7
16
|
* Use GitHub Actions for CI instead of Travis CI
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
trace_location (1.0)
|
4
|
+
trace_location (1.2.0)
|
5
5
|
csv
|
6
6
|
method_source
|
7
7
|
|
@@ -55,6 +55,7 @@ GEM
|
|
55
55
|
unicode-display_width (3.1.3)
|
56
56
|
unicode-emoji (~> 4.0, >= 4.0.4)
|
57
57
|
unicode-emoji (4.0.4)
|
58
|
+
warning (1.5.0)
|
58
59
|
|
59
60
|
PLATFORMS
|
60
61
|
ruby
|
@@ -67,6 +68,7 @@ DEPENDENCIES
|
|
67
68
|
rubocop-rake
|
68
69
|
rubocop-rspec
|
69
70
|
trace_location!
|
71
|
+
warning
|
70
72
|
|
71
73
|
BUNDLED WITH
|
72
74
|
2.6.2
|
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|
|
@@ -29,4 +32,5 @@ Gem::Specification.new do |s|
|
|
29
32
|
s.add_development_dependency 'bundler'
|
30
33
|
s.add_development_dependency 'rake'
|
31
34
|
s.add_development_dependency 'rspec'
|
35
|
+
s.add_development_dependency 'warning'
|
32
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trace_location
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshiyuki Hirano
|
8
|
-
- Misaki Shioi
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: csv
|
@@ -80,11 +79,25 @@ dependencies:
|
|
80
79
|
- - ">="
|
81
80
|
- !ruby/object:Gem::Version
|
82
81
|
version: '0'
|
83
|
-
|
84
|
-
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: warning
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
type: :development
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - ">="
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '0'
|
96
|
+
description: |
|
97
|
+
TraceLocation helps you get tracing the source location of codes,
|
98
|
+
and helps you can get reading the huge open souce libraries in Ruby
|
85
99
|
email:
|
86
100
|
- yhirano@me.com
|
87
|
-
- shioi.mm@gmail.com
|
88
101
|
executables:
|
89
102
|
- trace_location
|
90
103
|
extensions: []
|
@@ -95,7 +108,6 @@ files:
|
|
95
108
|
- ".gitignore"
|
96
109
|
- ".rspec"
|
97
110
|
- ".rubocop.yml"
|
98
|
-
- ".rubocop_todo.yml"
|
99
111
|
- CHANGELOG.md
|
100
112
|
- Gemfile
|
101
113
|
- Gemfile.lock
|
data/.rubocop_todo.yml
DELETED
@@ -1,113 +0,0 @@
|
|
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
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
10
|
-
# Configuration parameters: AllowSafeAssignment.
|
11
|
-
Lint/AssignmentInCondition:
|
12
|
-
Exclude:
|
13
|
-
- 'lib/trace_location/cli.rb'
|
14
|
-
|
15
|
-
# Configuration parameters: AllowComments, AllowNil.
|
16
|
-
Lint/SuppressedException:
|
17
|
-
Exclude:
|
18
|
-
- 'lib/trace_location/collector.rb'
|
19
|
-
|
20
|
-
# This cop supports safe autocorrection (--autocorrect).
|
21
|
-
# Configuration parameters: EnforcedStyle.
|
22
|
-
# SupportedStyles: be, be_nil
|
23
|
-
RSpec/BeNil:
|
24
|
-
Exclude:
|
25
|
-
- 'spec/trace_location_spec.rb'
|
26
|
-
|
27
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
28
|
-
# Configuration parameters: SkipBlocks, EnforcedStyle, OnlyStaticConstants.
|
29
|
-
# SupportedStyles: described_class, explicit
|
30
|
-
RSpec/DescribedClass:
|
31
|
-
Exclude:
|
32
|
-
- 'spec/trace_location_spec.rb'
|
33
|
-
|
34
|
-
# This cop supports safe autocorrection (--autocorrect).
|
35
|
-
# Configuration parameters: AutoCorrect.
|
36
|
-
RSpec/HooksBeforeExamples:
|
37
|
-
Exclude:
|
38
|
-
- 'spec/trace_location_spec.rb'
|
39
|
-
|
40
|
-
# Configuration parameters: Max, AllowedGroups.
|
41
|
-
RSpec/NestedGroups:
|
42
|
-
Exclude:
|
43
|
-
- 'spec/trace_location_spec.rb'
|
44
|
-
|
45
|
-
Security/Eval:
|
46
|
-
Exclude:
|
47
|
-
- 'lib/trace_location/cli.rb'
|
48
|
-
|
49
|
-
# This cop supports safe autocorrection (--autocorrect).
|
50
|
-
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
|
51
|
-
# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
|
52
|
-
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
53
|
-
# FunctionalMethods: let, let!, subject, watch
|
54
|
-
# AllowedMethods: lambda, proc, it
|
55
|
-
Style/BlockDelimiters:
|
56
|
-
Exclude:
|
57
|
-
- 'spec/trace_location_spec.rb'
|
58
|
-
|
59
|
-
# Configuration parameters: AllowedConstants.
|
60
|
-
Style/Documentation:
|
61
|
-
Exclude:
|
62
|
-
- 'spec/**/*'
|
63
|
-
- 'test/**/*'
|
64
|
-
- 'lib/trace_location/cli.rb'
|
65
|
-
|
66
|
-
# This cop supports safe autocorrection (--autocorrect).
|
67
|
-
Style/EvalWithLocation:
|
68
|
-
Exclude:
|
69
|
-
- 'spec/trace_location_spec.rb'
|
70
|
-
|
71
|
-
# This cop supports unsafe autocorrection (--autocorrect-all).
|
72
|
-
# Configuration parameters: EnforcedStyle.
|
73
|
-
# SupportedStyles: always, always_true, never
|
74
|
-
Style/FrozenStringLiteralComment:
|
75
|
-
Exclude:
|
76
|
-
- 'exe/trace_location'
|
77
|
-
- 'lib/trace_location/cli.rb'
|
78
|
-
|
79
|
-
# This cop supports safe autocorrection (--autocorrect).
|
80
|
-
Style/RedundantFreeze:
|
81
|
-
Exclude:
|
82
|
-
- 'lib/trace_location/event.rb'
|
83
|
-
|
84
|
-
# This cop supports safe autocorrection (--autocorrect).
|
85
|
-
Style/RedundantRegexpEscape:
|
86
|
-
Exclude:
|
87
|
-
- 'lib/trace_location/event.rb'
|
88
|
-
|
89
|
-
# This cop supports safe autocorrection (--autocorrect).
|
90
|
-
# Configuration parameters: AllowAsExpressionSeparator.
|
91
|
-
Style/Semicolon:
|
92
|
-
Exclude:
|
93
|
-
- 'spec/trace_location_spec.rb'
|
94
|
-
|
95
|
-
# This cop supports safe autocorrection (--autocorrect).
|
96
|
-
Style/StderrPuts:
|
97
|
-
Exclude:
|
98
|
-
- 'lib/trace_location.rb'
|
99
|
-
|
100
|
-
# This cop supports safe autocorrection (--autocorrect).
|
101
|
-
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
102
|
-
# SupportedStyles: single_quotes, double_quotes
|
103
|
-
Style/StringLiterals:
|
104
|
-
Exclude:
|
105
|
-
- 'lib/trace_location.rb'
|
106
|
-
|
107
|
-
# This cop supports safe autocorrection (--autocorrect).
|
108
|
-
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
109
|
-
# URISchemes: http, https
|
110
|
-
Layout/LineLength:
|
111
|
-
Exclude:
|
112
|
-
- 'lib/trace_location/event.rb'
|
113
|
-
- 'trace_location.gemspec'
|