error_highlight 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +2 -2
- data/.github/workflows/sync-ruby.yml +2 -2
- data/lib/error_highlight/base.rb +17 -6
- data/lib/error_highlight/version.rb +1 -1
- metadata +30 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef4c5d2f4747887533384fb54a39c1bb318199738f342d42cfe34ee43b82aac8
|
|
4
|
+
data.tar.gz: 416e7a3d066e4010a8f62ba638fda7e6513f0ab743d3f7ac1b6502c3cf260187
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6c6ab47b4e691ef2df5fc72308b26f8458cebf8f3b1b1ccd2273563f4dfea5dabf1a141040f28ce003a276dce8c6e24848b42d561e9cd3b5a7838c872a26a90d
|
|
7
|
+
data.tar.gz: 3b5b1e262f4d2e38a27d3034886344f48bdfa1e7fc76cecf56c277887ede0d6ead14d0ff2138dddcab6849068e503eef64133bbe1bdbba817ff474099fcf9cd9
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -22,7 +22,7 @@ jobs:
|
|
|
22
22
|
matrix:
|
|
23
23
|
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
|
|
24
24
|
steps:
|
|
25
|
-
- uses: actions/checkout@
|
|
25
|
+
- uses: actions/checkout@v7
|
|
26
26
|
- uses: ruby/setup-ruby@v1
|
|
27
27
|
with:
|
|
28
28
|
ruby-version: ${{ matrix.ruby }}
|
|
@@ -36,7 +36,7 @@ jobs:
|
|
|
36
36
|
prism:
|
|
37
37
|
runs-on: ubuntu-latest
|
|
38
38
|
steps:
|
|
39
|
-
- uses: actions/checkout@
|
|
39
|
+
- uses: actions/checkout@v7
|
|
40
40
|
- uses: ruby/setup-ruby@v1
|
|
41
41
|
with:
|
|
42
42
|
ruby-version: head
|
|
@@ -8,11 +8,11 @@ jobs:
|
|
|
8
8
|
runs-on: ubuntu-latest
|
|
9
9
|
if: ${{ github.repository_owner == 'ruby' }}
|
|
10
10
|
steps:
|
|
11
|
-
- uses: actions/checkout@
|
|
11
|
+
- uses: actions/checkout@v7
|
|
12
12
|
|
|
13
13
|
- name: Create GitHub App token
|
|
14
14
|
id: app-token
|
|
15
|
-
uses: actions/create-github-app-token@
|
|
15
|
+
uses: actions/create-github-app-token@v3
|
|
16
16
|
with:
|
|
17
17
|
app-id: 2060836
|
|
18
18
|
private-key: ${{ secrets.RUBY_SYNC_DEFAULT_GEMS_PRIVATE_KEY }}
|
data/lib/error_highlight/base.rb
CHANGED
|
@@ -28,7 +28,7 @@ module ErrorHighlight
|
|
|
28
28
|
# Currently, ErrorHighlight.spot only supports a single-line code fragment.
|
|
29
29
|
# Therefore, if the return value is not nil, first_lineno and last_lineno will have
|
|
30
30
|
# the same value. If the relevant code fragment spans multiple lines
|
|
31
|
-
# (e.g., Array#[] of
|
|
31
|
+
# (e.g., Array#[] of <tt>ary[(newline)expr(newline)]</tt>), the method will return nil.
|
|
32
32
|
# This restriction may be removed in the future.
|
|
33
33
|
def self.spot(obj, **opts)
|
|
34
34
|
case obj
|
|
@@ -235,17 +235,21 @@ module ErrorHighlight
|
|
|
235
235
|
spot_op_cdecl
|
|
236
236
|
|
|
237
237
|
when :DEFN
|
|
238
|
-
|
|
238
|
+
# There is nothing to highlight for the arguments of a method
|
|
239
|
+
# definition, so just return nil instead of raising.
|
|
240
|
+
return nil if @point_type != :name
|
|
239
241
|
spot_defn
|
|
240
242
|
|
|
241
243
|
when :DEFS
|
|
242
|
-
|
|
244
|
+
return nil if @point_type != :name
|
|
243
245
|
spot_defs
|
|
244
246
|
|
|
245
247
|
when :LAMBDA
|
|
248
|
+
return nil if @point_type != :name
|
|
246
249
|
spot_lambda
|
|
247
250
|
|
|
248
251
|
when :ITER
|
|
252
|
+
return nil if @point_type != :name
|
|
249
253
|
spot_iter
|
|
250
254
|
|
|
251
255
|
when :call_node
|
|
@@ -294,7 +298,12 @@ module ErrorHighlight
|
|
|
294
298
|
when :name
|
|
295
299
|
prism_spot_def_for_name
|
|
296
300
|
when :args
|
|
297
|
-
|
|
301
|
+
# There is nothing to highlight for the arguments of a method
|
|
302
|
+
# definition (e.g. an ArgumentError for a missing required keyword
|
|
303
|
+
# is spotted with point_type: :args). Return nil instead of raising
|
|
304
|
+
# NotImplementedError, which would otherwise escape
|
|
305
|
+
# Exception#detailed_message / #full_message.
|
|
306
|
+
return nil
|
|
298
307
|
end
|
|
299
308
|
|
|
300
309
|
when :lambda_node
|
|
@@ -302,7 +311,8 @@ module ErrorHighlight
|
|
|
302
311
|
when :name
|
|
303
312
|
prism_spot_lambda_for_name
|
|
304
313
|
when :args
|
|
305
|
-
|
|
314
|
+
# See the comment for :def_node above.
|
|
315
|
+
return nil
|
|
306
316
|
end
|
|
307
317
|
|
|
308
318
|
when :block_node
|
|
@@ -310,7 +320,8 @@ module ErrorHighlight
|
|
|
310
320
|
when :name
|
|
311
321
|
prism_spot_block_for_name
|
|
312
322
|
when :args
|
|
313
|
-
|
|
323
|
+
# See the comment for :def_node above.
|
|
324
|
+
return nil
|
|
314
325
|
end
|
|
315
326
|
|
|
316
327
|
end
|
metadata
CHANGED
|
@@ -1,55 +1,56 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: error_highlight
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
- Yusuke Endoh
|
|
7
|
+
- Yusuke Endoh
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
|
-
description: The gem enhances Exception#message by adding a short explanation where
|
|
13
|
-
the exception is raised
|
|
12
|
+
description: "The gem enhances Exception#message by adding a short explanation where the exception is raised"
|
|
14
13
|
email:
|
|
15
|
-
- mame@ruby-lang.org
|
|
14
|
+
- mame@ruby-lang.org
|
|
16
15
|
executables: []
|
|
17
16
|
extensions: []
|
|
18
17
|
extra_rdoc_files: []
|
|
19
18
|
files:
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
- Gemfile
|
|
25
|
-
- LICENSE.txt
|
|
26
|
-
- README.md
|
|
27
|
-
- Rakefile
|
|
28
|
-
- error_highlight.gemspec
|
|
29
|
-
- lib/error_highlight.rb
|
|
30
|
-
- lib/error_highlight/base.rb
|
|
31
|
-
- lib/error_highlight/core_ext.rb
|
|
32
|
-
- lib/error_highlight/formatter.rb
|
|
33
|
-
- lib/error_highlight/version.rb
|
|
34
|
-
homepage: https://github.com/ruby/error_highlight
|
|
19
|
+
- .github/dependabot.yml
|
|
20
|
+
- .github/workflows/ruby.yml
|
|
21
|
+
- .github/workflows/sync-ruby.yml
|
|
22
|
+
- .gitignore
|
|
23
|
+
- Gemfile
|
|
24
|
+
- LICENSE.txt
|
|
25
|
+
- README.md
|
|
26
|
+
- Rakefile
|
|
27
|
+
- error_highlight.gemspec
|
|
28
|
+
- lib/error_highlight.rb
|
|
29
|
+
- lib/error_highlight/base.rb
|
|
30
|
+
- lib/error_highlight/core_ext.rb
|
|
31
|
+
- lib/error_highlight/formatter.rb
|
|
32
|
+
- lib/error_highlight/version.rb
|
|
33
|
+
homepage: "https://github.com/ruby/error_highlight"
|
|
35
34
|
licenses:
|
|
36
|
-
- MIT
|
|
35
|
+
- MIT
|
|
37
36
|
metadata: {}
|
|
38
37
|
rdoc_options: []
|
|
39
38
|
require_paths:
|
|
40
|
-
- lib
|
|
39
|
+
- lib
|
|
41
40
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
42
41
|
requirements:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
-
|
|
43
|
+
- ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: 3.2.0
|
|
46
46
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
47
47
|
requirements:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
-
|
|
49
|
+
- ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: "0"
|
|
51
52
|
requirements: []
|
|
52
|
-
rubygems_version: 4.0.
|
|
53
|
+
rubygems_version: 4.1.0.dev
|
|
53
54
|
specification_version: 4
|
|
54
55
|
summary: Shows a one-line code snippet with an underline in the error backtrace
|
|
55
56
|
test_files: []
|