Sha256: 8edff9f03b871ac4b08cc4302339fa3b63fdd4a965ef312f7312619afd743300

Contents?: true

Size: 735 Bytes

Versions: 1

Compression:

Stored size: 735 Bytes

Contents

# encoding: utf-8
module Phare
  class Check
    class JSCS < Check
      attr_reader :config, :path

      def initialize(directory)
        @config = File.expand_path("#{directory}.jscs.json", __FILE__)
        @path = File.expand_path("#{directory}app/assets", __FILE__)
      end

      def command
        "jscs #{@path}"
      end

    protected

      def should_run?
        !Phare.system_output('which jscs').empty? && File.exists?(@config) && Dir.exists?(@path)
      end

      def print_banner
        Phare.puts '---------------------------------------------'
        Phare.puts 'Running JSCS to check for JavaScript style…'
        Phare.puts '---------------------------------------------'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
phare-0.4 lib/phare/check/jscs.rb