spellr 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 90aae5e24ba00624fea110acb2efb0a796cbf154
4
- data.tar.gz: f46b4df50970c2043937aab35e2771a96ee6a3f9
2
+ SHA256:
3
+ metadata.gz: caf392b95976c2f8908a578a8d192e7869ef25686bc2b86a9bf8a05c61459d29
4
+ data.tar.gz: 9a8639a5ce3fe9850399168025e82ca63e16df3456f9b877c4331983f7b204bc
5
5
  SHA512:
6
- metadata.gz: cc31f2cbe8f1870a4eae00d4fcf1dc88eaf905a5fc477605650c67a50768950da5cd3e6e845405c713be073104c778a4c2d50a1d377a2efb5da0329311c4ce09
7
- data.tar.gz: 58763f377f33faa8465fe69e06558da8ed97eb783d3c814dcb642920aa7ecfa99d6ce6488df8e3acace87a9a8a77875ad278919e475246984354260a79ae69f5
6
+ metadata.gz: 397d2ac127b392658571003b2507393e373b3d0dc32854c5d7f6f12855ec3468d31e3014a01a0a4f17c2e8bc667c38470ce88e9efd6e98f8225584c6f4782637
7
+ data.tar.gz: 1dace40995b4ba4950c363c7ea80cbf211034e5069019a9449adc8ddf4a6ed704e8fb35d257ecbc23fb4c8403e42389136b3e4e0db0ed415eab5c21ba5e5f3d5
@@ -1,3 +1,6 @@
1
+ # v0.3.1
2
+ - remove unnecessary files
3
+
1
4
  # v0.3.0
2
5
  - interactive add to wordlist uses consistent letters rather than random numbers as keys
3
6
  - additional wordlists per language can no longer be defined
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spellr (0.3.0)
4
+ spellr (0.3.1)
5
5
  fast_ignore
6
- parallel
7
6
 
8
7
  GEM
9
8
  remote: https://rubygems.org/
@@ -46,6 +45,7 @@ GEM
46
45
  rubocop-rspec (1.35.0)
47
46
  rubocop (>= 0.60.0)
48
47
  ruby-progressbar (1.10.1)
48
+ tty_string (0.1.0)
49
49
  unicode-display_width (1.6.0)
50
50
 
51
51
  PLATFORMS
@@ -60,6 +60,7 @@ DEPENDENCIES
60
60
  rubocop
61
61
  rubocop-rspec
62
62
  spellr!
63
+ tty_string
63
64
 
64
65
  BUNDLED WITH
65
66
  2.0.2
@@ -89,12 +89,12 @@ module Spellr
89
89
 
90
90
  def skip_nonwords # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
91
91
  skip(NOT_EVEN_NON_WORDS_RE) ||
92
- skip_uri_heuristically ||
93
- skip_key_heuristically ||
94
- skip(HEX_RE) ||
95
- skip(URL_ENCODED_ENTITIES_RE) ||
96
92
  skip(SHELL_COLOR_ESCAPE_RE) ||
97
93
  skip(BACKSLASH_ESCAPE_RE) ||
94
+ skip(URL_ENCODED_ENTITIES_RE) ||
95
+ skip(HEX_RE) ||
96
+ skip_key_heuristically ||
97
+ skip_uri_heuristically ||
98
98
  skip(LEFTOVER_NON_WORD_BITS_RE) ||
99
99
  skip(REPEATED_SINGLE_LETTERS_RE) ||
100
100
  skip(SEQUENTIAL_LETTERS_RE)
@@ -102,21 +102,26 @@ module Spellr
102
102
 
103
103
  # I didn't want to do this myself. BUT i need something to heuristically match on, and it's difficult
104
104
  URL_RE = %r{
105
- (?<scheme>//|https?://|s?ftp://|mailto:)?
106
- (?<userinfo>[[:alnum:]]+(?::[[:alnum:]]+)?@)?
107
- (?<hostname>(?:[[:alnum:]-]+(?:\\?\.[[:alnum:]-]+)+|localhost|\d{1,3}(?:.\d{1,3}){3}))
108
- (?<port>:\d+)?
109
- (?<path>/(?:[[:alnum:]=!$&\-/._\\]|%\h{2})+)?
110
- (?<query>\?(?:[[:alnum:]=!$\-/.\\]|%\h{2})+(?:&(?:[[:alnum:]=!$\-/.\\]|%\h{2})+)*)?
111
- (?<fragment>\#(?:[[:alnum:]=!$&\-/.\\]|%\h{2})+)?
105
+ (//|https?://|s?ftp://|mailto:)? # 0 scheme
106
+ ([[:alnum:]]+(?::[[:alnum:]]+)?@)? # 1 userinfo
107
+ (?:(?:[[:alnum:]-]+(?:\\?\.[[:alnum:]-]+)+|localhost|\d{1,3}(?:.\d{1,3}){3})) # 2 hostname
108
+ (?::\d+)? # 3 port
109
+ (/(?:[[:alnum:]=!$&\-/._\\]|%\h{2})+)? # 4 path
110
+ (?:\?(?:[[:alnum:]=!$\-/.\\]|%\h{2})+(?:&(?:[[:alnum:]=!$\-/.\\]|%\h{2})+)*)? # 5 query
111
+ (?:\#(?:[[:alnum:]=!$&\-/.\\]|%\h{2})+)? # 6 fragment
112
112
  }x.freeze
113
- # unfortunately i have to match this regex a couple times because stringscanner doesn't give me matchdata
114
113
  def skip_uri_heuristically
115
114
  return unless skip_uri?
116
- return unless match?(URL_RE)
115
+ return unless scan(URL_RE)
116
+
117
+ heuristic_failed = if RUBY_VERSION >= '2.5'
118
+ captures.all?(&:empty?)
119
+ else
120
+ # unfortunately i have to match this regex again because stringscanner doesn't give me matchdata
121
+ matched.match(URL_RE).captures.compact.all?(&:empty?)
122
+ end
117
123
 
118
- captures = URL_RE.match(matched)
119
- skip(URL_RE) if captures['scheme'] || captures['userinfo'] || captures['path']
124
+ unscan && false if heuristic_failed
120
125
  end
121
126
 
122
127
  # url unsafe base64 or url safe base64
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spellr
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
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.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dana Sherson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-22 00:00:00.000000000 Z
11
+ date: 2019-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -109,13 +109,13 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: fast_ignore
112
+ name: tty_string
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
- type: :runtime
118
+ type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: parallel
126
+ name: fast_ignore
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -144,25 +144,13 @@ executables:
144
144
  extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
- - ".gitignore"
148
- - ".rspec"
149
- - ".rubocop.yml"
150
- - ".ruby-version"
151
- - ".spellr.yml"
152
- - ".spellr_wordlists/english.txt"
153
- - ".spellr_wordlists/lorem.txt"
154
- - ".spellr_wordlists/ruby.txt"
155
- - ".travis.yml"
156
147
  - CHANGELOG.md
157
148
  - Gemfile
158
149
  - Gemfile.lock
159
150
  - LICENSE.txt
160
151
  - README.md
161
- - Rakefile
162
- - bin/console
163
152
  - bin/fetch_wordlist/english
164
153
  - bin/fetch_wordlist/ruby
165
- - bin/setup
166
154
  - exe/spellr
167
155
  - lib/.spellr.yml
168
156
  - lib/spellr.rb
@@ -184,8 +172,6 @@ files:
184
172
  - lib/spellr/version.rb
185
173
  - lib/spellr/wordlist.rb
186
174
  - lib/spellr/wordlist_reporter.rb
187
- - spellr.gemspec
188
- - wordlist
189
175
  - wordlists/dockerfile.txt
190
176
  - wordlists/html.txt
191
177
  - wordlists/javascript.txt
@@ -210,8 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
196
  - !ruby/object:Gem::Version
211
197
  version: '0'
212
198
  requirements: []
213
- rubyforge_project:
214
- rubygems_version: 2.5.2.1
199
+ rubygems_version: 3.0.3
215
200
  signing_key:
216
201
  specification_version: 4
217
202
  summary: Spell check your source code
data/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- /.spellr_wordlists/generated/*
2
- .rspec_status
3
- pkg
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
@@ -1,186 +0,0 @@
1
- require: rubocop-rspec
2
-
3
- # Reference:
4
- # https://rubocop.readthedocs.io/en/latest/
5
-
6
- # Keep this in alphabetical order.
7
- # Each override should have a comment (even if it's just "default is bad")
8
-
9
- AllCops:
10
- Exclude:
11
- - db/schema*
12
- - .bundle/**/*
13
- - tmp/**/*
14
- DisplayCopNames: true
15
- DisplayStyleGuide: true
16
- TargetRubyVersion: 2.5
17
-
18
- # all of our layout customisations are because we prefer indentation to be
19
- # always consistently 2 spaces, for blocks, scopes, multiline expressions, etc
20
- # e.g.
21
- # class Klass
22
- # def method(arg1,
23
- # arg2)
24
- # value = if arg1 == 'value' && arg2 == 'value'
25
- # method2
26
- # .method(arg_a, arg_b,
27
- # arg_c, arg_d, keyword1: true,
28
- # keyword2: true) do
29
- # @last = [
30
- # arg_a, arg_b,
31
- # arg_c, arg_d
32
- # ]
33
- # end
34
- # end
35
- # value
36
- # end
37
- # end
38
-
39
- # to match our preference for consistent indentation
40
- Layout/AlignHash:
41
- EnforcedLastArgumentHashStyle: always_ignore
42
-
43
- # to match our preference for consistent indentation
44
- Layout/AlignParameters:
45
- EnforcedStyle: with_fixed_indentation
46
-
47
- # to match our preference for consistent indentation
48
- Layout/BlockAlignment:
49
- EnforcedStyleAlignWith: start_of_block
50
-
51
- # to match our preference for consistent indentation
52
- Layout/CaseIndentation:
53
- EnforcedStyle: end
54
-
55
- # to match our preference for consistent indentation
56
- Layout/EndAlignment:
57
- EnforcedStyleAlignWith: start_of_line
58
-
59
- # Aligning Assignments, etc makes diffs noisy
60
- Layout/ExtraSpacing:
61
- AllowForAlignment: false
62
-
63
- # to match our preference for consistent indentation
64
- Layout/FirstArrayElementLineBreak:
65
- Enabled: true
66
-
67
- # to match our preference for consistent indentation
68
- Layout/FirstHashElementLineBreak:
69
- Enabled: true
70
-
71
- # to match our preference for consistent indentation
72
- Layout/IndentFirstArgument:
73
- EnforcedStyle: consistent
74
-
75
- # to match our preference for consistent indentation
76
- Layout/IndentFirstArrayElement:
77
- EnforcedStyle: consistent
78
-
79
- # to match our preference for consistent indentation
80
- Layout/IndentFirstHashElement:
81
- EnforcedStyle: consistent
82
-
83
- # to match our preference for consistent indentation
84
- # and hanging assignment looks lost
85
- Layout/MultilineAssignmentLayout:
86
- EnforcedStyle: same_line
87
-
88
- # this changes our preferred:
89
- # value = if thing1 &&
90
- # thing2
91
- # to:
92
- # value = if thing1 &&
93
- # thing2
94
- # even though the IndentationWidth is 2
95
- # but it's right most of the time so I put up with it
96
- Layout/MultilineOperationIndentation:
97
- EnforcedStyle: indented
98
-
99
- Layout/MultilineMethodCallIndentation:
100
- EnforcedStyle: indented
101
-
102
- # Temporarily disable this spec as a recent change has broken it for us:
103
- # https://github.com/rubocop-hq/rubocop/issues/6254
104
- Layout/RescueEnsureAlignment:
105
- Enabled: false
106
-
107
- Metrics:
108
- CountComments: false
109
-
110
- Metrics/BlockLength:
111
- ExcludedMethods:
112
- - configure
113
- - describe
114
- - context
115
- - it
116
-
117
- Metrics/LineLength:
118
- Max: 120
119
-
120
- Naming/UncommunicativeMethodParamName:
121
- AllowedNames: [_, io, id, to, by, 'on', in, at, ip, db]
122
-
123
- RSpec:
124
- Enabled: true
125
- Include:
126
- - 'spec/**/*.rb'
127
-
128
- RSpec/DescribeClass:
129
- Enabled: false
130
-
131
- # I misuse matchers often
132
- RSpec/ExpectActual:
133
- Enabled: false
134
-
135
- RSpec/FilePath:
136
- Enabled: false
137
-
138
- # Multiple expectations are useful
139
- # checking you've partially achieved something on the way to completely achieving it is useful for debugging failures
140
- RSpec/MultipleExpectations:
141
- Enabled: false
142
-
143
- # It should be obvious from context. Chill out rubocop
144
- RSpec/NamedSubject:
145
- Enabled: false
146
-
147
-
148
- # This matches the style we've been using all along (ever so slightly more frequently)
149
- Style/Alias:
150
- EnforcedStyle: prefer_alias_method
151
-
152
- Style/CollectionMethods:
153
- Enabled: true
154
-
155
- # we don't rdoc
156
- Style/Documentation:
157
- Enabled: false
158
-
159
- # [a, b].include?(x) is more unclear than a == x || b == x
160
- Style/MultipleComparison:
161
- Enabled: false
162
-
163
- Style/NumericPredicate:
164
- Enabled: false
165
-
166
- # we use %w{} pretty frequently
167
- Style/PercentLiteralDelimiters:
168
- PreferredDelimiters:
169
- default: '{}'
170
- '%w': '{}'
171
- '%W': '{}'
172
- '%i': '{}'
173
- '%I': '{}'
174
- '%r': '{}'
175
-
176
- # We want this to warn to force consistency within the codebase.
177
- Style/SafeNavigation:
178
- Enabled: true
179
-
180
- # different methods calls that do exactly the same thing are a smell, regardless of semantics
181
- Style/SignalException:
182
- EnforcedStyle: only_raise
183
-
184
- # this wants less descriptive names
185
- Style/SingleLineBlockParams:
186
- Enabled: false
@@ -1 +0,0 @@
1
- ruby-2.5.1
@@ -1,19 +0,0 @@
1
- ---
2
- ignore:
3
- - wordlists/*
4
- only:
5
- - '*.rb'
6
- - '*.yml'
7
- - '*.txt'
8
- - Rakefile
9
- - '*.md'
10
- - '*.gemspec'
11
- - Gemfile
12
- languages:
13
- ruby:
14
- only:
15
- - README.md
16
- lorem:
17
- only:
18
- - spec/*
19
- - .spellr.yml
@@ -1,123 +0,0 @@
1
- abc
2
- addable
3
- arg
4
- args
5
- baz
6
- bundler
7
- changelog
8
- charpos
9
- cli
10
- cmd
11
- codebase
12
- colours
13
- config
14
- configs
15
- css
16
- customisations
17
- cyclomatic
18
- def
19
- dict
20
- diffable
21
- diffs
22
- dockerfile
23
- downloader
24
- env
25
- eos
26
- eot
27
- erb
28
- exclusions
29
- exe
30
- executables
31
- exitstatus
32
- ext
33
- filename
34
- filenames
35
- foo
36
- gemfile
37
- gemspec
38
- getch
39
- git
40
- github
41
- gitignore
42
- gitignored
43
- gitkeep
44
- haml
45
- hashbang
46
- hashbangs
47
- hashbangs
48
- heuristically
49
- hml
50
- hostnames
51
- href
52
- htt
53
- ico
54
- inclusions
55
- jbuilder
56
- jpg
57
- json
58
- jsx
59
- klass
60
- localhost
61
- lstripped
62
- mailto
63
- marketplacer
64
- matcher
65
- matchers
66
- maths
67
- merchantability
68
- multiline
69
- newlines
70
- noninfringement
71
- nonwords
72
- optparse
73
- org
74
- param
75
- params
76
- png
77
- pwd
78
- rakefile
79
- rdoc
80
- readme
81
- redisplay
82
- repo
83
- rspec
84
- rubocop
85
- rvm
86
- scss
87
- shelljoin
88
- shellsplit
89
- shellwords
90
- sherson
91
- spellr
92
- stderr
93
- stdlib
94
- stdout
95
- str
96
- stringscanner
97
- strscan
98
- sublicense
99
- subwords
100
- sudo
101
- svg
102
- thu
103
- tlds
104
- tmp
105
- todo
106
- tokenize
107
- tokenizes
108
- tsx
109
- ttf
110
- txt
111
- uploader
112
- uri
113
- usr
114
- utf
115
- woff
116
- wordlist
117
- wordlists
118
- wordn't
119
- xdescribe
120
- xit
121
- xlsx
122
- yardoc
123
- yml
@@ -1,4 +0,0 @@
1
- amet
2
- dolor
3
- ipsum
4
- lorem
@@ -1,2 +0,0 @@
1
- matchdata
2
- pty
@@ -1,10 +0,0 @@
1
- ---
2
- sudo: false
3
- language: ruby
4
- cache: bundler
5
- rvm:
6
- - 2.3
7
- - 2.4
8
- - 2.5
9
- - 2.6
10
- before_install: gem install bundler
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- require 'bundler/setup'
5
- require 'spellr'
6
- require 'pry'
7
-
8
- Pry.start
data/bin/setup DELETED
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- bundle install
@@ -1,35 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- lib = ::File.expand_path('lib', __dir__)
4
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'spellr/version'
6
-
7
- Gem::Specification.new do |spec|
8
- spec.name = 'spellr'
9
- spec.version = Spellr::VERSION
10
- spec.authors = ['Dana Sherson']
11
- spec.email = ['robot@dana.sh']
12
-
13
- spec.summary = 'Spell check your source code'
14
- spec.homepage = 'http://github.com/robotdana/spellr'
15
- spec.license = 'MIT'
16
-
17
- # Specify which files should be added to the gem when it is released.
18
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
- spec.files = Dir.chdir(::File.expand_path(__dir__)) do
20
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
- end
22
- spec.bindir = 'exe'
23
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
- spec.require_paths = ['lib']
25
-
26
- spec.add_development_dependency 'bundler', '~> 2.0'
27
- spec.add_development_dependency 'pry'
28
- spec.add_development_dependency 'rake', '~> 10.0'
29
- spec.add_development_dependency 'rspec', '~> 3.0'
30
- spec.add_development_dependency 'rspec-eventually'
31
- spec.add_development_dependency 'rubocop'
32
- spec.add_development_dependency 'rubocop-rspec'
33
- spec.add_dependency 'fast_ignore'
34
- spec.add_dependency 'parallel'
35
- end
data/wordlist DELETED
@@ -1,2 +0,0 @@
1
- bar
2
- foo