Sha256: 4e25ed04dfa66827c95fdeb3818208ae6c7510410cbf6b24dfcd320208947026

Contents?: true

Size: 716 Bytes

Versions: 2

Compression:

Stored size: 716 Bytes

Contents

# encoding: utf-8
module Phare
  class Check
    class Rubocop < Check
      def initialize(directory, options = {})
        @path = directory
        @extensions = %w(.rb)
        @options = options

        super
      end

      def command
        if @tree.changed?
          "rubocop #{@tree.changes.join(' ')}"
        else
          'rubocop'
        end
      end

    protected

      def binary_exists?
        !Phare.system_output('which rubocop').empty?
      end

      def print_banner
        Phare.puts '----------------------------------------'
        Phare.puts 'Running Rubocop to check for Ruby style…'
        Phare.puts '----------------------------------------'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phare-0.5.2 lib/phare/check/rubocop.rb
phare-0.5.1 lib/phare/check/rubocop.rb