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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3aa5c1515f5f237357db96db2851882f30217bfc
4
- data.tar.gz: 6e1153b4b11dc8a12ae85fa492460105899fd377
3
+ metadata.gz: e41915bcb577b2004b10fde5bf595b93b6421d1b
4
+ data.tar.gz: 4075ce9b09d6a1cfe7325d685c2006c5c40abf83
5
5
  SHA512:
6
- metadata.gz: 4c679d0d9accb0590cf5dc54b031e4fe46b07cb52ba327259f1cee20057d56842d304521d2508c19974ec2d23fe872cc751b39bdccf796f01c09d325c1bed3a3
7
- data.tar.gz: 80855b3c522bbb4d0eb4b91163f9a1d67871545c8bf0783468cc38fbd194497ea438ad021e22123e3b929a68098499a39bf472a0b70f4ad5fd3da1a1e0ea9de9
6
+ metadata.gz: fd2cac56dd12c13ad7456a8a04f2837bbd29b183ea1ce5b1c3efe13202f106da6ce6300db16fbebe77a531768deefc381a6b69b09ff2d9a5697326c849ed28b2
7
+ data.tar.gz: ac19c9cc6f40a2bfc9a812d87142545285b8ffa866cefad3b216b7222506eed78bb4ce1fd125e74d3e8b041e5183343e4720a49b15cc82565814e0a1cda0e3e0
@@ -33,17 +33,17 @@ def main
33
33
 
34
34
  filenames = ARGV unless ARGV.empty?
35
35
 
36
- recursive_files = []
36
+ recursive_filenames = []
37
37
 
38
38
  filenames.each do |f|
39
39
  if File.directory? f
40
- recursive_files = recursive_files.concat(recursive_list(f, ignores))
40
+ recursive_filenames = recursive_filenames.concat(recursive_list(f, ignores))
41
41
  else
42
- recursive_files << f
42
+ recursive_filenames << f
43
43
  end
44
44
  end
45
45
 
46
- recursive_files.each { |f| check f }
46
+ recursive_filenames.each { |f| check f }
47
47
  end
48
48
 
49
49
  begin
@@ -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
- output = `sed 's/#/ /g' < #{filename} | aspell -a -c 2>&1`
50
+ def self.check(filename)
51
+ begin
52
+ output = `sed 's/#/ /g' #{filename} | aspell -a -c 2>&1`
52
53
 
53
- lines = output.split("\n").select { |line| line =~ /^\&\s.+$/ }
54
+ lines = output.split("\n").select { |line| line =~ /^\&\s.+$/ }
54
55
 
55
- misspellings = lines.map { |line| Misspelling.parse(filename, line) }
56
+ misspellings = lines.map { |line| Misspelling.parse(filename, line) }
56
57
 
57
- misspellings.each { |m| puts m }
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
@@ -2,5 +2,5 @@
2
2
  # Aspelllint
3
3
  #
4
4
  module Aspelllint
5
- VERSION = '0.1'
5
+ VERSION = '0.2'
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.1'
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.1.10
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: