Sha256: 6a3908c22e195e630c161281cec93330a6eece673ad61c82174f2304dfcdcfae

Contents?: true

Size: 759 Bytes

Versions: 11

Compression:

Stored size: 759 Bytes

Contents

require 'simplabs/excellent/runner'
require 'simplabs/excellent/formatters'

module Simplabs

  module Excellent

    class CommandLineRunner < Runner #:nodoc:

      def initialize(*checks)
        super
        @formatter = Formatters::Text.new
        @formatter.start
      end

      def check_paths(paths)
        paths.each do |path|
          if File.file?(path)
            check_file(path)
          elsif File.directory?(path)
            Dir.glob(File.join(path, '**/*.rb')).each { |file| check_file(file) }
          else
            next
          end
        end
      end

      def check_file(filename)
        super
        @formatter.file(filename, (@checks || []).collect { |check| check.warnings }.flatten)
      end

    end

  end

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
simplabs-excellent-1.3.1 lib/simplabs/excellent/command_line_runner.rb
simplabs-excellent-1.4.0 lib/simplabs/excellent/command_line_runner.rb
simplabs-excellent-1.4.1 lib/simplabs/excellent/command_line_runner.rb
simplabs-excellent-1.4.2 lib/simplabs/excellent/command_line_runner.rb
simplabs-excellent-1.5.0 lib/simplabs/excellent/command_line_runner.rb
simplabs-excellent-1.5.1 lib/simplabs/excellent/command_line_runner.rb
simplabs-excellent-1.5.2 lib/simplabs/excellent/command_line_runner.rb
simplabs-excellent-1.5.3 lib/simplabs/excellent/command_line_runner.rb
excellent-1.7.0 lib/simplabs/excellent/command_line_runner.rb
excellent-1.6.0 lib/simplabs/excellent/command_line_runner.rb
excellent-1.5.4 lib/simplabs/excellent/command_line_runner.rb