aspelllint 0.12 → 0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/aspelllint +16 -34
- data/lib/aspelllint.rb +43 -55
- data/lib/version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a16d4d81e4c5531ccb781951bbdd71723fc6abc0
|
4
|
+
data.tar.gz: 6f7a0e906693a0ca63abac127649eb795adfb754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc743aa0747bc4db0389e1e52a62880cbd58459daf4912c5d54ae2e766ad63c5a3fcd9fa8eb9e65fae504479f7ede124944a7885dd806627fd01e3f966a6f71b
|
7
|
+
data.tar.gz: 8b60a55f02e8d67c19597c7d3eb6378098213a49918927e08ef0550590878365118a269e08019bd3d9cf08c55a4b5643f3d18aad82f67da53413b8561f7bede7
|
data/bin/aspelllint
CHANGED
@@ -3,11 +3,9 @@
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'find'
|
5
5
|
require 'optparse'
|
6
|
-
require '
|
6
|
+
require 'dotsmack'
|
7
7
|
require 'aspelllint'
|
8
8
|
|
9
|
-
IGNORE_FILENAME = '.aspelllintignore'
|
10
|
-
|
11
9
|
def main
|
12
10
|
ignores = DEFAULT_IGNORES
|
13
11
|
|
@@ -16,7 +14,7 @@ def main
|
|
16
14
|
option = OptionParser.new do |option|
|
17
15
|
option.banner = 'Usage: aspelllint [options] [<files>|-]'
|
18
16
|
|
19
|
-
option.on('-i', '--ignore pattern', 'Ignore file
|
17
|
+
option.on('-i', '--ignore pattern', 'Ignore file pattern (fnmatch)') do |pattern|
|
20
18
|
ignores << pattern
|
21
19
|
end
|
22
20
|
|
@@ -33,39 +31,23 @@ def main
|
|
33
31
|
|
34
32
|
option.parse!
|
35
33
|
|
36
|
-
filenames =
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
recursive_filenames = []
|
42
|
-
|
43
|
-
filenames.each do |f|
|
44
|
-
if File.directory? f
|
45
|
-
recursive_filenames = recursive_filenames.concat(recursive_list(f, ignores))
|
46
|
-
else
|
47
|
-
recursive_filenames << f
|
48
|
-
end
|
34
|
+
filenames =
|
35
|
+
if ARGV == []
|
36
|
+
['-']
|
37
|
+
else
|
38
|
+
ARGV
|
49
39
|
end
|
50
40
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
while dir != parent_of_home
|
57
|
-
ignore_file = dir + File::SEPARATOR + IGNORE_FILENAME
|
58
|
-
|
59
|
-
if File.exist?(ignore_file) then
|
60
|
-
ignores.concat(open(ignore_file).read.split("\n"))
|
61
|
-
end
|
62
|
-
|
63
|
-
dir = File.expand_path("..", dir)
|
64
|
-
end
|
41
|
+
dotsmack = Dotsmack::Smacker.new(
|
42
|
+
dotignore = '.aspelllintignore',
|
43
|
+
additional_ignores = ignores
|
44
|
+
)
|
65
45
|
|
66
|
-
|
67
|
-
|
68
|
-
|
46
|
+
dotsmack.enumerate(filenames).each do |filename, _|
|
47
|
+
if filename == '-'
|
48
|
+
check_stdin
|
49
|
+
else
|
50
|
+
check(filename)
|
69
51
|
end
|
70
52
|
end
|
71
53
|
end
|
data/lib/aspelllint.rb
CHANGED
@@ -1,56 +1,52 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'ptools'
|
3
2
|
require 'tempfile'
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
$stdout.sync = true
|
4
|
+
require_relative 'version'
|
8
5
|
|
9
6
|
DEFAULT_IGNORES = %w(
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
node_modules
|
17
|
-
bower_components
|
18
|
-
target
|
19
|
-
dist
|
20
|
-
|
7
|
+
.hg
|
8
|
+
.svn
|
9
|
+
.git
|
10
|
+
.aspelllintignore
|
11
|
+
.gtdlintignore
|
12
|
+
.gtdlintrc.yml
|
13
|
+
node_modules
|
14
|
+
bower_components
|
15
|
+
target
|
16
|
+
dist
|
17
|
+
.vagrant
|
21
18
|
Gemfile.lock
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
res
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
-min\.js
|
19
|
+
*.exe
|
20
|
+
*.bin
|
21
|
+
*.apk
|
22
|
+
*.ap_
|
23
|
+
res
|
24
|
+
*.class
|
25
|
+
*.zip
|
26
|
+
*.jar
|
27
|
+
*.war
|
28
|
+
*.xpi
|
29
|
+
*.dmg
|
30
|
+
*.pkg
|
31
|
+
*.app
|
32
|
+
*.xcodeproj
|
33
|
+
*.lproj
|
34
|
+
*.xcassets
|
35
|
+
*.pmdoc
|
36
|
+
*.dSYM
|
37
|
+
*.jad
|
38
|
+
*.cmo
|
39
|
+
*.cmi
|
40
|
+
*.png
|
41
|
+
*.gif
|
42
|
+
*.jpg
|
43
|
+
*.jpeg
|
44
|
+
*.tiff
|
45
|
+
*.ico
|
46
|
+
*.svg
|
47
|
+
*.dot
|
48
|
+
*.wav
|
49
|
+
*[.-]min.*
|
54
50
|
)
|
55
51
|
|
56
52
|
#
|
@@ -83,14 +79,6 @@ class Misspelling
|
|
83
79
|
end
|
84
80
|
end
|
85
81
|
|
86
|
-
def self.recursive_list(directory, ignores = DEFAULT_IGNORES)
|
87
|
-
Find.find(directory).reject do |f|
|
88
|
-
File.directory?(f) ||
|
89
|
-
ignores.any? { |ignore| f =~ /#{ignore}/ } ||
|
90
|
-
File.binary?(f)
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
82
|
def self.check_stdin
|
95
83
|
contents = $stdin.read
|
96
84
|
|
data/lib/version.rb
CHANGED
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.
|
4
|
+
version: '0.13'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Pennebaker
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: dotsmack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.3'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rake
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -271,7 +285,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
271
285
|
requirements:
|
272
286
|
- - '>='
|
273
287
|
- !ruby/object:Gem::Version
|
274
|
-
version: '0'
|
288
|
+
version: '2.0'
|
275
289
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
276
290
|
requirements:
|
277
291
|
- - '>='
|
@@ -279,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
293
|
version: '0'
|
280
294
|
requirements: []
|
281
295
|
rubyforge_project:
|
282
|
-
rubygems_version: 2.
|
296
|
+
rubygems_version: 2.4.6
|
283
297
|
signing_key:
|
284
298
|
specification_version: 4
|
285
299
|
summary: spell check for large projects
|