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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73634b4beb653f0e05265c961dfb77f82a7af55b6d623e588768d041b756f5f1
4
- data.tar.gz: 487b8777837e9042b44891881784ae286c23fff98203d913b6d52e517265802c
3
+ metadata.gz: bbbeb7108727e93706ca6fe199dc58b9c5fd5246e0d47d52d45dafd1908c343f
4
+ data.tar.gz: f7e10fb3febf2091394f5aaf0adcd2d712ce3d93faedd21f6ebf57621bf04305
5
5
  SHA512:
6
- metadata.gz: dfd75357dd3ef4da9b644118bcc1f434e008823700c4a260cd02db2f024ad7f6916140649486e5db16a4df7dca669048efef8b293363aa328614136bf4ea71b6
7
- data.tar.gz: 0a8877f99fbc51ff5be791a979bb61a9d124104a705e545048553522850694011b288ac1576e6d92fa1ac00e35c616e066b46da1fff29a311c44fc9d1478556d
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
@@ -1,5 +1,8 @@
1
- AllCops:
2
- TargetRubyVersion: 2.6
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - rubocop-rake
5
+ - rubocop-rspec
3
6
 
4
7
  Metrics:
5
8
  Enabled: false
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
@@ -5,4 +5,6 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in trace_location.gemspec
6
6
  gemspec
7
7
 
8
- gem 'rubocop'
8
+ gem 'rubocop', require: false
9
+ gem 'rubocop-rake', require: false
10
+ gem 'rubocop-rspec', require: false
data/Gemfile.lock CHANGED
@@ -1,50 +1,60 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trace_location (0.12.2)
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
- diff-lcs (1.5.0)
12
- json (2.6.3)
13
- method_source (1.0.0)
14
- parallel (1.22.1)
15
- parser (3.2.0.0)
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.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.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.12.0)
30
- rspec-mocks (3.12.1)
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.12.0)
33
- rspec-support (3.12.0)
34
- rubocop (1.42.0)
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.1.2.1)
42
+ parser (>= 3.3.0.2)
38
43
  rainbow (>= 2.2.2, < 4.0)
39
- regexp_parser (>= 1.8, < 3.0)
40
- rexml (>= 3.2.5, < 4.0)
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 (>= 1.4.0, < 3.0)
44
- rubocop-ast (1.24.1)
45
- parser (>= 3.1.1.0)
46
- ruby-progressbar (1.11.0)
47
- unicode-display_width (2.4.1)
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.1.4
72
+ 2.6.2
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # TraceLocation
2
2
 
3
- [![Build Status](https://travis-ci.org/yhirano55/trace_location.svg?branch=master)](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
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'trace_location'
4
5
  require 'trace_location/cli'
@@ -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
@@ -2,10 +2,12 @@
2
2
 
3
3
  module TraceLocation
4
4
  class Event # :nodoc:
5
- CLASS_FORMAT = /\A#<(?:Class|refinement)\:([A-Za-z0-9\:]+).*>\z/.freeze
6
- attr_reader :id, :event, :path, :lineno, :caller_path, :caller_lineno, :owner, :name, :source, :hierarchy, :is_module
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:, is_module:)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TraceLocation
4
- VERSION = '0.12.2'
4
+ VERSION = '1.1'
5
5
  end
@@ -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
- $stderr.puts "Failure: TraceLocation got an unexpected error."
19
- $stderr.puts e.full_message
18
+ warn 'Failure: TraceLocation got an unexpected error.'
19
+ warn e.full_message
20
20
  false
21
21
  end
22
22
 
@@ -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', 'Misaki Shioi']
11
- s.email = ['yhirano@me.com', 'shioi.mm@gmail.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 = %(TraceLocation helps you get tracing the source location of codes, and helps you can get reading the huge open souce libraries in Ruby)
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 = '>= 2.6.0'
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: 0.12.2
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: 2023-06-20 00:00:00.000000000 Z
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: TraceLocation helps you get tracing the source location of codes, and
71
- helps you can get reading the huge open souce libraries in Ruby
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
- - ".travis.yml"
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: 2.6.0
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.3.26
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: []
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.6.7
7
- - 2.7.3
8
- - ruby-head
9
- before_install: gem install bundler -v 2.1.4
10
-
11
- matrix:
12
- allow_failures:
13
- - rvm: ruby-head