aspelllint 0.12 → 0.13

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 +16 -34
  3. data/lib/aspelllint.rb +43 -55
  4. data/lib/version.rb +1 -1
  5. metadata +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9a5eefbad23a767d260a1028cb6c2fdd660fba8
4
- data.tar.gz: 04b3e94da6f57be352b3304bcd463f9e4a214b83
3
+ metadata.gz: a16d4d81e4c5531ccb781951bbdd71723fc6abc0
4
+ data.tar.gz: 6f7a0e906693a0ca63abac127649eb795adfb754
5
5
  SHA512:
6
- metadata.gz: 79c31b6a2910b9580c34055157b9f5f507dc4342a3b3e4014f972a5a835e6c9ccce9f395d71029b5f5cb77ce862796544f93433ac5164ff1fb27c2c70d330f5d
7
- data.tar.gz: 7d0184edc37425244d60f783bf38b3a378849325b38b357c468a262985ab54674ea9a2eeb6baee515c217008cbe815cc593d33150f110d2bdda268b19cf3f6af
6
+ metadata.gz: fc743aa0747bc4db0389e1e52a62880cbd58459daf4912c5d54ae2e766ad63c5a3fcd9fa8eb9e65fae504479f7ede124944a7885dd806627fd01e3f966a6f71b
7
+ data.tar.gz: 8b60a55f02e8d67c19597c7d3eb6378098213a49918927e08ef0550590878365118a269e08019bd3d9cf08c55a4b5643f3d18aad82f67da53413b8561f7bede7
@@ -3,11 +3,9 @@
3
3
  require 'rubygems'
4
4
  require 'find'
5
5
  require 'optparse'
6
- require 'yaml'
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 names matching Ruby regex pattern') do |pattern|
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 = ARGV unless ARGV.empty?
37
-
38
- if filenames.empty? || filenames == ['-'] then
39
- check_stdin
40
- else
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
- recursive_filenames.each do |f|
52
- dir = File.expand_path("..", f)
53
-
54
- parent_of_home = File.expand_path("..", ENV["HOME"])
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
- if ignores.none? { |ignore| f =~ %r(#{ignore}) } then
67
- check(f)
68
- end
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
@@ -1,56 +1,52 @@
1
- require 'rubygems'
2
1
  require 'ptools'
3
2
  require 'tempfile'
4
3
 
5
- require 'version'
6
-
7
- $stdout.sync = true
4
+ require_relative 'version'
8
5
 
9
6
  DEFAULT_IGNORES = %w(
10
- \.hg/
11
- \.svn/
12
- \.git/
13
- \.aspelllintignore
14
- \.gtdlintignore
15
- \.gtdlintrc\.yml
16
- node_modules/
17
- bower_components/
18
- target/
19
- dist/
20
- \.vagrant/
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
- \.exe
23
- \.bin
24
- \.apk
25
- \.ap_
26
- res/
27
- \.class
28
- \.zip
29
- \.jar
30
- \.war
31
- \.xpi
32
- \.dmg
33
- \.pkg
34
- \.app
35
- \.xcodeproj/
36
- \.lproj/
37
- \.xcassets/
38
- \.pmdoc/
39
- \.dSYM/
40
- \.jad
41
- \.cmo
42
- \.cmi
43
- \.png
44
- \.gif
45
- \.jpg
46
- \.jpeg
47
- \.tiff
48
- \.ico
49
- \.svg
50
- \.dot
51
- \.wav
52
- \.min.js
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
 
@@ -2,5 +2,5 @@
2
2
  # Aspelllint
3
3
  #
4
4
  module Aspelllint
5
- VERSION = '0.12'
5
+ VERSION = '0.13'
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.12'
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.2.2
296
+ rubygems_version: 2.4.6
283
297
  signing_key:
284
298
  specification_version: 4
285
299
  summary: spell check for large projects