aspelllint 0.2 → 0.3
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 +17 -0
- data/lib/aspelllint.rb +4 -20
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2124c61cdbf10aa42731e5b53b0971c8c07fedd
|
4
|
+
data.tar.gz: 3782d104cbd84886357832e7fe8cfdb30e3b18ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c1668da98679e4ebc8e015015d6b023de40fb7793651170a2d6c49dfed04c9e25f2525e6e4d6fec86369ab71c40c20e8882578116d0191eeb31d8ffabb9c456
|
7
|
+
data.tar.gz: af4d7ff407b0b2405127fd3068edece461e16fd2031e4de7c3439692524a48238e2f0727399946aaf9655293aaa0826b541e20986e19287d668f3bd0b1a99788
|
data/bin/aspelllint
CHANGED
@@ -48,6 +48,23 @@ end
|
|
48
48
|
|
49
49
|
begin
|
50
50
|
main
|
51
|
+
|
52
|
+
#
|
53
|
+
# User quits aspelllint before completion.
|
54
|
+
#
|
55
|
+
|
51
56
|
rescue Interrupt
|
52
57
|
nil
|
58
|
+
#
|
59
|
+
# Invalid byte sequence in UTF-8 file.
|
60
|
+
# Likely a false positive text file.
|
61
|
+
#
|
62
|
+
rescue ArgumentError
|
63
|
+
nil
|
64
|
+
#
|
65
|
+
# aspelllint piped to another program (e.g. `less`),
|
66
|
+
# which is quit before aspelllint completes.
|
67
|
+
#
|
68
|
+
rescue Errno::EPIPE, Errno::EMFILE
|
69
|
+
nil
|
53
70
|
end
|
data/lib/aspelllint.rb
CHANGED
@@ -48,27 +48,11 @@ def self.recursive_list(directory, ignores = DEFAULT_IGNORES)
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def self.check(filename)
|
51
|
-
|
52
|
-
output = `sed 's/#/ /g' #{filename} | aspell -a -c 2>&1`
|
51
|
+
output = `sed 's/#/ /g' #{filename} 2>&1 | aspell -a -c 2>&1`
|
53
52
|
|
54
|
-
|
53
|
+
lines = output.split("\n").select { |line| line =~ /^\&\s.+$/ }
|
55
54
|
|
56
|
-
|
55
|
+
misspellings = lines.map { |line| Misspelling.parse(filename, line) }
|
57
56
|
|
58
|
-
|
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
|
57
|
+
misspellings.each { |m| puts m }
|
74
58
|
end
|
data/lib/version.rb
CHANGED