did_you_mean 1.6.2 → 1.6.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efe3eda9f13dc6e837711f29799ee6701771200e75f11017c1f18cc521de10ca
|
4
|
+
data.tar.gz: 96476669d502e64083fa91cbbb7c91c583228b86f34ea0b22929bf38c931ee6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2697751c0b6ba2afa9153b41c306118fddd7ce584cdb9de9f71974cf924d83208fdb47a307e1ee4ea6161b63641334ea7ff1ca58fff0e141116809d6690e254b
|
7
|
+
data.tar.gz: 1cd6e82755d1d66c9503fc5ff3f6c42931860edb3fbb11c94c1411317ddffaa1ba1f0e7020cc1ad553cb0ad26195e6ab897a0c88a8fad58cad779d008f38bbb1
|
data/.github/workflows/ruby.yml
CHANGED
@@ -13,7 +13,7 @@ jobs:
|
|
13
13
|
runs-on: ubuntu-latest
|
14
14
|
strategy:
|
15
15
|
matrix:
|
16
|
-
ruby: [ '2.5', '2.6', '2.7', '3.0', 'ruby-head', 'jruby-9.2', 'jruby-head' ]
|
16
|
+
ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1', 'ruby-head', 'jruby-9.2', 'jruby-9.3', 'jruby-head' ]
|
17
17
|
steps:
|
18
18
|
- uses: actions/checkout@v3
|
19
19
|
- uses: ruby/setup-ruby@v1
|
@@ -30,7 +30,7 @@ jobs:
|
|
30
30
|
- uses: actions/checkout@v3
|
31
31
|
- uses: ruby/setup-ruby@v1
|
32
32
|
with:
|
33
|
-
ruby-version:
|
33
|
+
ruby-version: 3.1.3
|
34
34
|
- name: Test performance and accuracy
|
35
35
|
run: |
|
36
36
|
gem install bundler
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## v1.6.3
|
2
|
+
|
3
|
+
_<sup>released at 2022-12-19 5:57:00 UTC</sup>_
|
4
|
+
|
5
|
+
- Do not suggest #name= for #name.
|
6
|
+
|
7
|
+
## v1.6.2
|
8
|
+
|
9
|
+
_<sup>released at 2022-12-05 10:29:20 UTC</sup>_
|
10
|
+
|
11
|
+
- Define Exception#detailed_message instead of clobbering #message
|
12
|
+
- Fixed correction duplicates in VaribaleNameChecker
|
13
|
+
|
1
14
|
## v1.6.1
|
2
15
|
|
3
16
|
_<sup>released at 2020-12-22 13:22:35 UTC</sup>_
|
@@ -59,6 +59,13 @@ module DidYouMean
|
|
59
59
|
method_names = receiver.methods + receiver.singleton_methods
|
60
60
|
method_names += receiver.private_methods if @private_call
|
61
61
|
method_names.uniq!
|
62
|
+
# Assume that people trying to use a writer are not interested in a reader
|
63
|
+
# and vice versa
|
64
|
+
if method_name.match?(/=\Z/)
|
65
|
+
method_names.select! { |name| name.match?(/=\Z/) }
|
66
|
+
else
|
67
|
+
method_names.reject! { |name| name.match?(/=\Z/) }
|
68
|
+
end
|
62
69
|
method_names
|
63
70
|
else
|
64
71
|
[]
|
data/lib/did_you_mean/version.rb
CHANGED
@@ -4,6 +4,8 @@ class MethodNameCheckTest < Test::Unit::TestCase
|
|
4
4
|
include DidYouMean::TestHelper
|
5
5
|
|
6
6
|
class User
|
7
|
+
attr_writer :writer
|
8
|
+
attr_reader :reader
|
7
9
|
def friends; end
|
8
10
|
def first_name; end
|
9
11
|
def descendants; end
|
@@ -144,4 +146,20 @@ class MethodNameCheckTest < Test::Unit::TestCase
|
|
144
146
|
assert_correction [], error.corrections
|
145
147
|
assert_not_match(/Did you mean\? +yield/, get_message(error))
|
146
148
|
end if RUBY_ENGINE != "jruby"
|
149
|
+
|
150
|
+
# Do not suggest `name=` for `name`
|
151
|
+
def test_does_not_suggest_writer
|
152
|
+
error = assert_raise(NoMethodError) { @user.writer }
|
153
|
+
|
154
|
+
assert_correction [], error.corrections
|
155
|
+
assert_not_match(/Did you mean\? writer=/, get_message(error))
|
156
|
+
end
|
157
|
+
|
158
|
+
# Do not suggest `name` for `name=`
|
159
|
+
def test_does_not_suggest_reader
|
160
|
+
error = assert_raise(NoMethodError) { @user.reader = 1 }
|
161
|
+
|
162
|
+
assert_correction [], error.corrections
|
163
|
+
assert_not_match(/Did you mean\? reader/, get_message(error))
|
164
|
+
end
|
147
165
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: did_you_mean
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuki Nishijima
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|