i_did_mean 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: dfd4c1069d551cd648d37b29a3d6aaaf8b300f5b82b6e858663f8ed9340362e4
4
+ data.tar.gz: defe0a27fe59b9017c713ee8cc36323e47ab5020a698524443bca0811b5178f6
5
+ SHA512:
6
+ metadata.gz: 683072b3c919038dd5b4c90412ca546f28cf33d7b7a8f938040a156aac0655c49aa31add322bf74afc234b8cf13c265e0d073c59f2ca5918bf5e3c7aef55a37b
7
+ data.tar.gz: 43928225e0ceae489f887d6e4aeeaf152f75b66c9db8d4b226815c20dd5aab9760f24ba83565f7736a6d0e87c4250716fa01fafefbfb5a2a4fe002d1a8a0072f
@@ -0,0 +1,8 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ Gemfile.lock
6
+ coverage
7
+ tmp
8
+ log
@@ -0,0 +1,56 @@
1
+ ---
2
+ require:
3
+ - rubocop-minitest
4
+
5
+ AllCops:
6
+ Exclude:
7
+ - 'gemfiles/**/*'
8
+
9
+ Style/Documentation:
10
+ Enabled: false
11
+
12
+ Metrics/LineLength:
13
+ Enabled: true
14
+ Max: 100
15
+ Exclude:
16
+ - 'test/**/*'
17
+ - 'Gemfile'
18
+ IgnoredPatterns: ['^\s*#'] # ignore comments
19
+
20
+ Metrics/ClassLength:
21
+ Exclude:
22
+ - 'test/**/*'
23
+
24
+ Metrics/AbcSize:
25
+ Exclude:
26
+ - 'test/**/*'
27
+
28
+ Metrics/MethodLength:
29
+ Enabled: false
30
+
31
+ Metrics/BlockLength:
32
+ Enabled: false
33
+
34
+ Style/ClassAndModuleChildren:
35
+ Enabled: false
36
+
37
+ Style/StringLiterals:
38
+ Enabled: true
39
+ EnforcedStyle: double_quotes
40
+
41
+ Style/NumericLiteralPrefix:
42
+ Enabled: false
43
+
44
+ Style/NumericLiterals:
45
+ Enabled: false
46
+
47
+ Style/TrailingCommaInHashLiteral:
48
+ Enabled: true
49
+ EnforcedStyleForMultiline: comma
50
+
51
+ Style/TrailingCommaInArrayLiteral:
52
+ Enabled: true
53
+ EnforcedStyleForMultiline: comma
54
+
55
+ Naming/MemoizedInstanceVariableName:
56
+ Enabled: false
@@ -0,0 +1 @@
1
+ 2.6.5
@@ -0,0 +1,12 @@
1
+ ---
2
+ language: ruby
3
+
4
+ rvm:
5
+ - 2.6.5
6
+
7
+ script:
8
+ - rubocop && bundle exec appraisal rake test
9
+
10
+ before_script:
11
+ - bundle install
12
+ - bundle exec appraisal install
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ appraise "rails-5.0" do
4
+ gem "rails", "~> 5.0.0"
5
+ gem "listen"
6
+ end
7
+
8
+ appraise "rails-5.1" do
9
+ gem "rails", "~> 5.1.0"
10
+ gem "listen"
11
+ end
12
+
13
+ appraise "rails-5.2" do
14
+ gem "rails", "~> 5.2.0"
15
+ gem "listen"
16
+ end
17
+
18
+ appraise "rails-6.0" do
19
+ gem "rails", "~> 6.0.0"
20
+ gem "listen"
21
+ end
22
+
23
+ appraise "rails-edge" do
24
+ gem "rails", github: "rails/rails"
25
+ gem "listen"
26
+ end
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2019 Hrvoje Simic
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,73 @@
1
+ # i_did_mean [![Build Status](https://travis-ci.org/shime/i_did_mean.svg?branch=master)](https://travis-ci.org/shime/i_did_mean)
2
+
3
+ [Did you mean](https://github.com/ruby/did_you_mean)? I did mean!
4
+
5
+ Autocorrects spelling mistakes reported by DidYouMean. Only attempts to autocorrect when there is a single suggestion from DidYouMean.
6
+
7
+ ## Example
8
+
9
+ This code:
10
+
11
+ ```ruby
12
+ require "i_did_mean"
13
+
14
+ def bar
15
+ "foo"
16
+ end
17
+
18
+ ba
19
+ ```
20
+
21
+ Will get autocorrected to:
22
+
23
+ ```ruby
24
+ require "i_did_mean"
25
+
26
+ def bar
27
+ "foo"
28
+ end
29
+
30
+ bar
31
+ ```
32
+
33
+ This code:
34
+
35
+ ```ruby
36
+ require "i_did_mean"
37
+
38
+ first_name = nil
39
+ flrst_name
40
+ ```
41
+
42
+ Will get autocorrected to:
43
+
44
+ ```ruby
45
+ require "i_did_mean"
46
+
47
+ first_name = nil
48
+ first_name
49
+ ```
50
+
51
+ This code:
52
+
53
+ ```ruby
54
+ require "i_did_mean"
55
+
56
+ hash = { "foo" => 1, bar: 2 }
57
+ hash.fetch(:bax)
58
+ ```
59
+
60
+ Will get autocorrected to:
61
+
62
+ ```ruby
63
+ require "i_did_mean"
64
+
65
+ hash = { "foo" => 1, bar: 2 }
66
+ hash.fetch(:bar)
67
+ ```
68
+
69
+ For more examples, check out the [test directory](https://github.com/shime/i_did_mean/tree/master/test).
70
+
71
+ ## License
72
+
73
+ Copyright (c) 2019 Hrvoje Simic. See LICENSE for further details.
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new do |task|
7
+ task.libs << "test"
8
+
9
+ task.test_files = Dir["test/**/*_test.rb"].reject { |path| /(experimental)/ =~ path }
10
+ task.verbose = true
11
+ task.warning = true
12
+ end
13
+
14
+ Rake::TestTask.new("test:experimental") do |task|
15
+ task.libs << "test"
16
+ task.pattern = "test/experimental/**/*_test.rb"
17
+ task.verbose = true
18
+ task.warning = true
19
+ task.ruby_opts << "-rdid_you_mean/experimental"
20
+ end
21
+
22
+ task default: %i[test test:experimental]
23
+
24
+ namespace :test do
25
+ namespace :accuracy do
26
+ desc "Download Wiktionary's Simple English data and save it as a dictionary"
27
+ task :prepare do
28
+ sh "ruby evaluation/dictionary_generator.rb"
29
+ end
30
+ end
31
+
32
+ desc "Calculate accuracy of the gems' spell checker"
33
+ task :accuracy do
34
+ unless File.exist?("evaluation/dictionary.yml")
35
+ puts "Generating dictionary for evaluation:"
36
+ Rake::Task["test:accuracy:prepare"].execute
37
+ puts "\n"
38
+ end
39
+
40
+ sh "ruby evaluation/calculator.rb"
41
+ end
42
+ end
43
+
44
+ namespace :benchmark do
45
+ desc "Measure memory usage by the did_you_mean gem"
46
+ task :memory do
47
+ sh "ruby benchmark/memory_usage.rb"
48
+ end
49
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source "https://rubygems.org"
6
+
7
+ gem "listen"
8
+ gem "rails", "~> 5.0.0"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,142 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ i_did_mean (1.0.0.pre.alpha)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actioncable (5.0.7.2)
10
+ actionpack (= 5.0.7.2)
11
+ nio4r (>= 1.2, < 3.0)
12
+ websocket-driver (~> 0.6.1)
13
+ actionmailer (5.0.7.2)
14
+ actionpack (= 5.0.7.2)
15
+ actionview (= 5.0.7.2)
16
+ activejob (= 5.0.7.2)
17
+ mail (~> 2.5, >= 2.5.4)
18
+ rails-dom-testing (~> 2.0)
19
+ actionpack (5.0.7.2)
20
+ actionview (= 5.0.7.2)
21
+ activesupport (= 5.0.7.2)
22
+ rack (~> 2.0)
23
+ rack-test (~> 0.6.3)
24
+ rails-dom-testing (~> 2.0)
25
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
+ actionview (5.0.7.2)
27
+ activesupport (= 5.0.7.2)
28
+ builder (~> 3.1)
29
+ erubis (~> 2.7.0)
30
+ rails-dom-testing (~> 2.0)
31
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
32
+ activejob (5.0.7.2)
33
+ activesupport (= 5.0.7.2)
34
+ globalid (>= 0.3.6)
35
+ activemodel (5.0.7.2)
36
+ activesupport (= 5.0.7.2)
37
+ activerecord (5.0.7.2)
38
+ activemodel (= 5.0.7.2)
39
+ activesupport (= 5.0.7.2)
40
+ arel (~> 7.0)
41
+ activesupport (5.0.7.2)
42
+ concurrent-ruby (~> 1.0, >= 1.0.2)
43
+ i18n (>= 0.7, < 2)
44
+ minitest (~> 5.1)
45
+ tzinfo (~> 1.1)
46
+ appraisal (2.2.0)
47
+ bundler
48
+ rake
49
+ thor (>= 0.14.0)
50
+ arel (7.1.4)
51
+ builder (3.2.3)
52
+ coderay (1.1.2)
53
+ concurrent-ruby (1.1.5)
54
+ crass (1.0.5)
55
+ erubis (2.7.0)
56
+ ffi (1.11.3)
57
+ globalid (0.4.2)
58
+ activesupport (>= 4.2.0)
59
+ i18n (1.7.0)
60
+ concurrent-ruby (~> 1.0)
61
+ listen (3.2.0)
62
+ rb-fsevent (~> 0.10, >= 0.10.3)
63
+ rb-inotify (~> 0.9, >= 0.9.10)
64
+ loofah (2.4.0)
65
+ crass (~> 1.0.2)
66
+ nokogiri (>= 1.5.9)
67
+ mail (2.7.1)
68
+ mini_mime (>= 0.1.1)
69
+ method_source (0.9.2)
70
+ mini_mime (1.0.2)
71
+ mini_portile2 (2.4.0)
72
+ minitest (5.13.0)
73
+ minitest-focus (1.1.2)
74
+ minitest (>= 4, < 6)
75
+ nio4r (2.5.2)
76
+ nokogiri (1.10.5)
77
+ mini_portile2 (~> 2.4.0)
78
+ pry (0.12.2)
79
+ coderay (~> 1.1.0)
80
+ method_source (~> 0.9.0)
81
+ rack (2.0.7)
82
+ rack-test (0.6.3)
83
+ rack (>= 1.0)
84
+ rails (5.0.7.2)
85
+ actioncable (= 5.0.7.2)
86
+ actionmailer (= 5.0.7.2)
87
+ actionpack (= 5.0.7.2)
88
+ actionview (= 5.0.7.2)
89
+ activejob (= 5.0.7.2)
90
+ activemodel (= 5.0.7.2)
91
+ activerecord (= 5.0.7.2)
92
+ activesupport (= 5.0.7.2)
93
+ bundler (>= 1.3.0)
94
+ railties (= 5.0.7.2)
95
+ sprockets-rails (>= 2.0.0)
96
+ rails-dom-testing (2.0.3)
97
+ activesupport (>= 4.2.0)
98
+ nokogiri (>= 1.6)
99
+ rails-html-sanitizer (1.3.0)
100
+ loofah (~> 2.3)
101
+ railties (5.0.7.2)
102
+ actionpack (= 5.0.7.2)
103
+ activesupport (= 5.0.7.2)
104
+ method_source
105
+ rake (>= 0.8.7)
106
+ thor (>= 0.18.1, < 2.0)
107
+ rake (13.0.1)
108
+ rb-fsevent (0.10.3)
109
+ rb-inotify (0.10.0)
110
+ ffi (~> 1.0)
111
+ sprockets (4.0.0)
112
+ concurrent-ruby (~> 1.0)
113
+ rack (> 1, < 3)
114
+ sprockets-rails (3.2.1)
115
+ actionpack (>= 4.0)
116
+ activesupport (>= 4.0)
117
+ sprockets (>= 3.0.0)
118
+ thor (0.20.3)
119
+ thread_safe (0.3.6)
120
+ tzinfo (1.2.5)
121
+ thread_safe (~> 0.1)
122
+ websocket-driver (0.6.5)
123
+ websocket-extensions (>= 0.1.0)
124
+ websocket-extensions (0.1.4)
125
+
126
+ PLATFORMS
127
+ ruby
128
+
129
+ DEPENDENCIES
130
+ appraisal
131
+ bundler
132
+ i_did_mean!
133
+ listen
134
+ minitest
135
+ minitest-focus
136
+ pry
137
+ rack-test
138
+ rails (~> 5.0.0)
139
+ rake
140
+
141
+ BUNDLED WITH
142
+ 1.17.2
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source "https://rubygems.org"
6
+
7
+ gem "listen"
8
+ gem "rails", "~> 5.1.0"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,142 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ i_did_mean (1.0.0.pre.alpha)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ actioncable (5.1.7)
10
+ actionpack (= 5.1.7)
11
+ nio4r (~> 2.0)
12
+ websocket-driver (~> 0.6.1)
13
+ actionmailer (5.1.7)
14
+ actionpack (= 5.1.7)
15
+ actionview (= 5.1.7)
16
+ activejob (= 5.1.7)
17
+ mail (~> 2.5, >= 2.5.4)
18
+ rails-dom-testing (~> 2.0)
19
+ actionpack (5.1.7)
20
+ actionview (= 5.1.7)
21
+ activesupport (= 5.1.7)
22
+ rack (~> 2.0)
23
+ rack-test (>= 0.6.3)
24
+ rails-dom-testing (~> 2.0)
25
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
26
+ actionview (5.1.7)
27
+ activesupport (= 5.1.7)
28
+ builder (~> 3.1)
29
+ erubi (~> 1.4)
30
+ rails-dom-testing (~> 2.0)
31
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
32
+ activejob (5.1.7)
33
+ activesupport (= 5.1.7)
34
+ globalid (>= 0.3.6)
35
+ activemodel (5.1.7)
36
+ activesupport (= 5.1.7)
37
+ activerecord (5.1.7)
38
+ activemodel (= 5.1.7)
39
+ activesupport (= 5.1.7)
40
+ arel (~> 8.0)
41
+ activesupport (5.1.7)
42
+ concurrent-ruby (~> 1.0, >= 1.0.2)
43
+ i18n (>= 0.7, < 2)
44
+ minitest (~> 5.1)
45
+ tzinfo (~> 1.1)
46
+ appraisal (2.2.0)
47
+ bundler
48
+ rake
49
+ thor (>= 0.14.0)
50
+ arel (8.0.0)
51
+ builder (3.2.3)
52
+ coderay (1.1.2)
53
+ concurrent-ruby (1.1.5)
54
+ crass (1.0.5)
55
+ erubi (1.9.0)
56
+ ffi (1.11.3)
57
+ globalid (0.4.2)
58
+ activesupport (>= 4.2.0)
59
+ i18n (1.7.0)
60
+ concurrent-ruby (~> 1.0)
61
+ listen (3.2.0)
62
+ rb-fsevent (~> 0.10, >= 0.10.3)
63
+ rb-inotify (~> 0.9, >= 0.9.10)
64
+ loofah (2.4.0)
65
+ crass (~> 1.0.2)
66
+ nokogiri (>= 1.5.9)
67
+ mail (2.7.1)
68
+ mini_mime (>= 0.1.1)
69
+ method_source (0.9.2)
70
+ mini_mime (1.0.2)
71
+ mini_portile2 (2.4.0)
72
+ minitest (5.13.0)
73
+ minitest-focus (1.1.2)
74
+ minitest (>= 4, < 6)
75
+ nio4r (2.5.2)
76
+ nokogiri (1.10.5)
77
+ mini_portile2 (~> 2.4.0)
78
+ pry (0.12.2)
79
+ coderay (~> 1.1.0)
80
+ method_source (~> 0.9.0)
81
+ rack (2.0.7)
82
+ rack-test (1.1.0)
83
+ rack (>= 1.0, < 3)
84
+ rails (5.1.7)
85
+ actioncable (= 5.1.7)
86
+ actionmailer (= 5.1.7)
87
+ actionpack (= 5.1.7)
88
+ actionview (= 5.1.7)
89
+ activejob (= 5.1.7)
90
+ activemodel (= 5.1.7)
91
+ activerecord (= 5.1.7)
92
+ activesupport (= 5.1.7)
93
+ bundler (>= 1.3.0)
94
+ railties (= 5.1.7)
95
+ sprockets-rails (>= 2.0.0)
96
+ rails-dom-testing (2.0.3)
97
+ activesupport (>= 4.2.0)
98
+ nokogiri (>= 1.6)
99
+ rails-html-sanitizer (1.3.0)
100
+ loofah (~> 2.3)
101
+ railties (5.1.7)
102
+ actionpack (= 5.1.7)
103
+ activesupport (= 5.1.7)
104
+ method_source
105
+ rake (>= 0.8.7)
106
+ thor (>= 0.18.1, < 2.0)
107
+ rake (13.0.1)
108
+ rb-fsevent (0.10.3)
109
+ rb-inotify (0.10.0)
110
+ ffi (~> 1.0)
111
+ sprockets (4.0.0)
112
+ concurrent-ruby (~> 1.0)
113
+ rack (> 1, < 3)
114
+ sprockets-rails (3.2.1)
115
+ actionpack (>= 4.0)
116
+ activesupport (>= 4.0)
117
+ sprockets (>= 3.0.0)
118
+ thor (0.20.3)
119
+ thread_safe (0.3.6)
120
+ tzinfo (1.2.5)
121
+ thread_safe (~> 0.1)
122
+ websocket-driver (0.6.5)
123
+ websocket-extensions (>= 0.1.0)
124
+ websocket-extensions (0.1.4)
125
+
126
+ PLATFORMS
127
+ ruby
128
+
129
+ DEPENDENCIES
130
+ appraisal
131
+ bundler
132
+ i_did_mean!
133
+ listen
134
+ minitest
135
+ minitest-focus
136
+ pry
137
+ rack-test
138
+ rails (~> 5.1.0)
139
+ rake
140
+
141
+ BUNDLED WITH
142
+ 1.17.2