spellr 0.10.1 → 0.11.0

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: 21ab4e433d233e14066dd74202d26ce302ea6b61807b06c74d5418f0351f576a
4
- data.tar.gz: 865fe94e51e2ad6b819eef675b2075eaaf15214bc599e14de2c76b376169ad3a
3
+ metadata.gz: cb3c19ba481190944dadf76bbc0d4953e4488aefedb8debfa6f153e752577831
4
+ data.tar.gz: acddcaf1433e9190ad4fdd61e1714fad9623acbd98f951c413ac7bab4ce484b3
5
5
  SHA512:
6
- metadata.gz: ff244a207751f57b402c1c5080487205935a4c80fd0b2481cd8a58a12ba717412596714c1684fde3e28aac6caff182e8985855243dc02c720463d17e1e533bc8
7
- data.tar.gz: bf87a587fd6cf7ab5ef907645cfc68b627f65098b9e771c09a9fb19360467817c05cb3d61bda17bb01296f81a71e23048f42ec4054e1cd8a96703332571f1ff1
6
+ metadata.gz: cbb4ef118126f6f04ffbf6316490bb8c6b382339fb34b948b11400ecc1edcf61ff7442e2b59711babcec67b69e56ffe826f64d0f91385ca720fe1139c30463e0
7
+ data.tar.gz: a47bf93a6e524282bd03b282e25cba90279066e045ec5b8a1ee269dc332722d70743b2cc0b95fafd38c4b16fff26ec46c74ea3c2c7a42b7c1e5dfd6e3b55e945
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # v0.11.0
2
+ - Remove explicit did_you_mean dependency
3
+ (if you want the suggestions in ruby 2.5 & 2.6, you'll need to add did_you_mean to your Gemfile directly).
4
+ - require 'set' in Spellr::Reporter
5
+ previously we were just were relying on FastIgnore requiring it, and i don't use it there any longer.
6
+
1
7
  # v0.10.1
2
8
  - Resolve fast_ignore follow_symlinks deprecation
3
9
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require_relative '../spellr'
4
4
  require_relative 'base_reporter'
5
- require_relative 'suggester'
5
+ require_relative 'maybe_suggester'
6
6
 
7
7
  module Spellr
8
8
  class AutocorrectReporter < BaseReporter
@@ -5,7 +5,7 @@ require_relative '../spellr'
5
5
  require_relative 'interactive_add'
6
6
  require_relative 'interactive_replacement'
7
7
  require_relative 'base_reporter'
8
- require_relative 'suggester'
8
+ require_relative 'maybe_suggester'
9
9
 
10
10
  module Spellr
11
11
  class Interactive < BaseReporter # rubocop:disable Metrics/ClassLength
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require_relative 'suggester'
5
+ # :nocov:
6
+ rescue LoadError
7
+ require_relative 'null_suggester'
8
+ Spellr::Suggester = Spellr::NullSuggester
9
+ # :nocov:
10
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spellr
4
+ class NullSuggester
5
+ class << self
6
+ def suggestions(_token)
7
+ []
8
+ end
9
+
10
+ def fast_suggestions(_token)
11
+ []
12
+ end
13
+
14
+ def slow?
15
+ true
16
+ end
17
+ end
18
+
19
+ def initialize(_wordlist); end
20
+
21
+ def suggestions(_term)
22
+ []
23
+ end
24
+ end
25
+ end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative 'base_reporter'
4
4
  require 'shellwords'
5
+ require 'set'
5
6
 
6
7
  module Spellr
7
8
  class Reporter < Spellr::BaseReporter
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spellr
4
- VERSION = '0.10.1'
4
+ VERSION = '0.11.0'
5
5
  end
@@ -86,7 +86,7 @@ module Spellr
86
86
 
87
87
  def suggester
88
88
  @suggester ||= begin
89
- require_relative 'suggester'
89
+ require_relative 'maybe_suggester'
90
90
 
91
91
  ::Spellr::Suggester.new(self)
92
92
  end
data/spellr.gemspec CHANGED
@@ -34,6 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.require_paths = ['lib']
35
35
 
36
36
  spec.add_development_dependency 'bundler', '~> 2.0'
37
+ spec.add_development_dependency 'did_you_mean' unless ENV['DID_YOU_MEAN'] == '0'
37
38
  spec.add_development_dependency 'leftovers', '>= 0.4.0'
38
39
  spec.add_development_dependency 'mime-types', '~> 3.3.1'
39
40
  spec.add_development_dependency 'nokogiri'
@@ -47,7 +48,6 @@ Gem::Specification.new do |spec|
47
48
  spec.add_development_dependency 'tty_string', '>= 1.1.0'
48
49
  spec.add_development_dependency 'webmock', '~> 3.8'
49
50
 
50
- spec.add_dependency 'did_you_mean'
51
51
  spec.add_dependency 'fast_ignore', '>= 0.11.0'
52
52
  spec.add_dependency 'jaro_winkler'
53
53
  spec.add_dependency 'parallel', '~> 1.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spellr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dana Sherson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-30 00:00:00.000000000 Z
11
+ date: 2022-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: did_you_mean
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: leftovers
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -192,20 +206,6 @@ dependencies:
192
206
  - - "~>"
193
207
  - !ruby/object:Gem::Version
194
208
  version: '3.8'
195
- - !ruby/object:Gem::Dependency
196
- name: did_you_mean
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :runtime
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: fast_ignore
211
211
  requirement: !ruby/object:Gem::Requirement
@@ -286,6 +286,8 @@ files:
286
286
  - lib/spellr/language.rb
287
287
  - lib/spellr/line_location.rb
288
288
  - lib/spellr/line_tokenizer.rb
289
+ - lib/spellr/maybe_suggester.rb
290
+ - lib/spellr/null_suggester.rb
289
291
  - lib/spellr/output.rb
290
292
  - lib/spellr/output_stubbed.rb
291
293
  - lib/spellr/pwd.rb
@@ -346,7 +348,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
346
348
  - !ruby/object:Gem::Version
347
349
  version: '0'
348
350
  requirements: []
349
- rubygems_version: 3.2.15
351
+ rubygems_version: 3.3.7
350
352
  signing_key:
351
353
  specification_version: 4
352
354
  summary: Spell check your source code