Sha256: 3e4c5eb5138fd348fa205ee9e4ae3a7a81481db805c74164ff29317b7e157be2
Contents?: true
Size: 904 Bytes
Versions: 5
Compression:
Stored size: 904 Bytes
Contents
#!/usr/bin/env ruby # # Use: # # => cfl # => cfl all # => cfl last # => cfl last 3 # ARGV.push "all" class LintRunner attr_reader :files def initialize # Find all coffee files, sort by last modified time @files = Dir['**/*.coffee'].sort_by { |f| File.mtime(f) } @printed = 0 end def lint(index) if (@printed > 0) puts "----------------------------------------------------------------------------\n\n" end file = @files[index] system "coffeelint #{file}" @printed = @printed + 1 end end runner = LintRunner.new # Lint based on args if ARGV.length > 0 if ARGV[0] == 'last' if ARGV[1] ARGV[1].to_i.times {|i| runner.lint i } else runner.lint 0 end elsif ARGV[0] == 'all' runner.files.length.times {|i| runner.lint i } elsif ARGV[0] == 'list' runner.files.each {|f| puts " #{f}" } end else runner.lint 0 end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
bait-0.5.13 | .bait/coffeelint.rb |
bait-0.5.12 | .bait/coffeelint.rb |
bait-0.5.11 | .bait/coffeelint.rb |
bait-0.5.10 | .bait/coffeelint.rb |
bait-0.5.9 | .bait/coffeelint.rb |