aspelllint 0.1 → 0.2
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 +4 -4
- data/bin/aspelllint +4 -4
- data/lib/aspelllint.rb +21 -5
- data/lib/version.rb +1 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e41915bcb577b2004b10fde5bf595b93b6421d1b
|
4
|
+
data.tar.gz: 4075ce9b09d6a1cfe7325d685c2006c5c40abf83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd2cac56dd12c13ad7456a8a04f2837bbd29b183ea1ce5b1c3efe13202f106da6ce6300db16fbebe77a531768deefc381a6b69b09ff2d9a5697326c849ed28b2
|
7
|
+
data.tar.gz: ac19c9cc6f40a2bfc9a812d87142545285b8ffa866cefad3b216b7222506eed78bb4ce1fd125e74d3e8b041e5183343e4720a49b15cc82565814e0a1cda0e3e0
|
data/bin/aspelllint
CHANGED
@@ -33,17 +33,17 @@ def main
|
|
33
33
|
|
34
34
|
filenames = ARGV unless ARGV.empty?
|
35
35
|
|
36
|
-
|
36
|
+
recursive_filenames = []
|
37
37
|
|
38
38
|
filenames.each do |f|
|
39
39
|
if File.directory? f
|
40
|
-
|
40
|
+
recursive_filenames = recursive_filenames.concat(recursive_list(f, ignores))
|
41
41
|
else
|
42
|
-
|
42
|
+
recursive_filenames << f
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
|
46
|
+
recursive_filenames.each { |f| check f }
|
47
47
|
end
|
48
48
|
|
49
49
|
begin
|
data/lib/aspelllint.rb
CHANGED
@@ -47,12 +47,28 @@ def self.recursive_list(directory, ignores = DEFAULT_IGNORES)
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
def check(filename)
|
51
|
-
|
50
|
+
def self.check(filename)
|
51
|
+
begin
|
52
|
+
output = `sed 's/#/ /g' #{filename} | aspell -a -c 2>&1`
|
52
53
|
|
53
|
-
|
54
|
+
lines = output.split("\n").select { |line| line =~ /^\&\s.+$/ }
|
54
55
|
|
55
|
-
|
56
|
+
misspellings = lines.map { |line| Misspelling.parse(filename, line) }
|
56
57
|
|
57
|
-
|
58
|
+
misspellings.each { |m| puts m }
|
59
|
+
|
60
|
+
#
|
61
|
+
# Invalid byte sequence in UTF-8 file.
|
62
|
+
# Likely a false positive text file.
|
63
|
+
#
|
64
|
+
rescue ArgumentError
|
65
|
+
nil
|
66
|
+
|
67
|
+
#
|
68
|
+
# aspelllint piped to another program (e.g. `less`),
|
69
|
+
# which is quit before aspelllint completes.
|
70
|
+
#
|
71
|
+
rescue Errno::EPIPE, Errno::EMFILE
|
72
|
+
nil
|
73
|
+
end
|
58
74
|
end
|
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.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Pennebaker
|
@@ -251,9 +251,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
251
|
version: '0'
|
252
252
|
requirements: []
|
253
253
|
rubyforge_project:
|
254
|
-
rubygems_version: 2.
|
254
|
+
rubygems_version: 2.0.6
|
255
255
|
signing_key:
|
256
256
|
specification_version: 4
|
257
257
|
summary: spell check for large projects
|
258
258
|
test_files: []
|
259
|
-
has_rdoc:
|