aspelllint 0.10 → 0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/aspelllint +15 -11
  3. data/lib/aspelllint.rb +24 -0
  4. data/lib/version.rb +1 -1
  5. metadata +73 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70be67487f5f243c92c34ec7fb0b21e550089d1d
4
- data.tar.gz: 86caea1cf34c4c444224d2a4c2add7fbaac2b419
3
+ metadata.gz: 3eafce9e53858c7513ea2d1d2b83b5002da5d73b
4
+ data.tar.gz: ffd7caf9a728159d6d7e3b4af1b8ea0a1dd80421
5
5
  SHA512:
6
- metadata.gz: 8132fe757536fa11eb599ab419aa8bf0e4c7388bf84220760bbed54098ab5e1ad86c074860e37665e839d047c3739890a2861a13f169475c288feaf21664dccb
7
- data.tar.gz: 2580c4563fdecb3898adcc251808868ea0a9758bb6d9ef399a2ffe75c856c77189c02c88a5dc9840ab5e07375576cd2bc0929ba6dad76eaa3be65ff4a98a0d41
6
+ metadata.gz: 537dea4fc244991cbe8b44c6fc7420c2b67ca0210bf755ae3f3fd117df169f02acb8dce65482d40166625a7bd912c9a4f5d3e9d86943d12f57cce7708b615e69
7
+ data.tar.gz: 37f078c79aa76928c108a30b12fd4790df23295f0a8884232b7c746bb248bb9390433114e830a5e487dc3d0525302fe4e15c8a70f962c09b19300de2008a37f3
@@ -9,10 +9,10 @@ require 'aspelllint'
9
9
  def main
10
10
  ignores = DEFAULT_IGNORES
11
11
 
12
- filenames = ['.']
12
+ filenames = []
13
13
 
14
14
  option = OptionParser.new do |option|
15
- option.banner = 'Usage: aspelllint [options] [<files>]'
15
+ option.banner = 'Usage: aspelllint [options] [<files>|-]'
16
16
 
17
17
  option.on('-i', '--ignore pattern', 'Ignore file names matching Ruby regex pattern') do |pattern|
18
18
  ignores << pattern
@@ -33,17 +33,21 @@ def main
33
33
 
34
34
  filenames = ARGV unless ARGV.empty?
35
35
 
36
- recursive_filenames = []
37
-
38
- filenames.each do |f|
39
- if File.directory? f
40
- recursive_filenames = recursive_filenames.concat(recursive_list(f, ignores))
41
- else
42
- recursive_filenames << f
36
+ if filenames.empty? || filenames == ['-'] then
37
+ check_stdin
38
+ else
39
+ recursive_filenames = []
40
+
41
+ filenames.each do |f|
42
+ if File.directory? f
43
+ recursive_filenames = recursive_filenames.concat(recursive_list(f, ignores))
44
+ else
45
+ recursive_filenames << f
46
+ end
43
47
  end
44
- end
45
48
 
46
- recursive_filenames.each { |f| check f }
49
+ recursive_filenames.each { |f| check f }
50
+ end
47
51
  end
48
52
 
49
53
  begin
@@ -1,8 +1,11 @@
1
1
  require 'rubygems'
2
2
  require 'ptools'
3
+ require 'tempfile'
3
4
 
4
5
  require 'version'
5
6
 
7
+ $stdout.sync = true
8
+
6
9
  DEFAULT_IGNORES = %w(
7
10
  .hg/
8
11
  .svn/
@@ -60,6 +63,27 @@ def self.recursive_list(directory, ignores = DEFAULT_IGNORES)
60
63
  end
61
64
  end
62
65
 
66
+ def self.check_stdin
67
+ contents = $stdin.read
68
+
69
+ t = Tempfile.new('aspelllint')
70
+ t.write(contents)
71
+ t.close
72
+
73
+ filename = t.path
74
+
75
+ output = `sed 's/#/ /g' "#{filename}" 2>&1 | aspell -a -c 2>&1`
76
+
77
+ lines = output.split("\n").select { |line| line =~ /^\&\s.+$/ }
78
+
79
+ misspellings = lines.map { |line| Misspelling.parse('stdin', line) }
80
+
81
+ misspellings.each { |m| puts m }
82
+
83
+ t.delete
84
+ end
85
+
86
+
63
87
  def self.check(filename)
64
88
  output = `sed 's/#/ /g' "#{filename}" 2>&1 | aspell -a -c 2>&1`
65
89
 
@@ -2,5 +2,5 @@
2
2
  # Aspelllint
3
3
  #
4
4
  module Aspelllint
5
- VERSION = '0.10'
5
+ VERSION = '0.11'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspelllint
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.10'
4
+ version: '0.11'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Pennebaker
@@ -14,212 +14,226 @@ dependencies:
14
14
  name: ptools
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ~>
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ~>
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '10.3'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ~>
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '10.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: reek
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1.3'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: flay
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '2.5'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ~>
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '2.5'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: flog
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '4.3'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '4.3'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: roodi
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '4.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '4.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: churn
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '1.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '1.0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: cane
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: '2.6'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ~>
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: '2.6'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: excellent
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - '>='
129
+ - - ~>
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: '2.1'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - '>='
136
+ - - ~>
137
137
  - !ruby/object:Gem::Version
138
- version: '0'
138
+ version: '2.1'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - '>='
143
+ - - ~>
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: '0.24'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - '>='
150
+ - - ~>
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: '0.24'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: tailor
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - '>='
157
+ - - ~>
158
158
  - !ruby/object:Gem::Version
159
- version: '0'
159
+ version: '1.4'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - '>='
164
+ - - ~>
165
165
  - !ruby/object:Gem::Version
166
- version: '0'
166
+ version: '1.4'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: guard
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - '>='
171
+ - - ~>
172
172
  - !ruby/object:Gem::Version
173
- version: '0'
173
+ version: '2.6'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - '>='
178
+ - - ~>
179
179
  - !ruby/object:Gem::Version
180
- version: '0'
180
+ version: '2.6'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: guard-shell
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - '>='
185
+ - - ~>
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0.6'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - '>='
192
+ - - ~>
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0.6'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rspec
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - '>='
199
+ - - ~>
200
200
  - !ruby/object:Gem::Version
201
- version: '0'
201
+ version: '3.0'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - '>='
206
+ - - ~>
207
207
  - !ruby/object:Gem::Version
208
- version: '0'
208
+ version: '3.0'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: cucumber
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - '>='
213
+ - - ~>
214
214
  - !ruby/object:Gem::Version
215
- version: '0'
215
+ version: '1.3'
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - '>='
220
+ - - ~>
221
221
  - !ruby/object:Gem::Version
222
- version: '0'
222
+ version: '1.3'
223
+ - !ruby/object:Gem::Dependency
224
+ name: cowl
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - ~>
228
+ - !ruby/object:Gem::Version
229
+ version: '0.2'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - ~>
235
+ - !ruby/object:Gem::Version
236
+ version: '0.2'
223
237
  description: See README.md for example usage
224
238
  email: andrew.pennebaker@gmail.com
225
239
  executables: