Sha256: 579cb44727441beff1b1d5c9265a5802df20a67065a4e9462bc93f0fb19aaa6d

Contents?: true

Size: 891 Bytes

Versions: 1

Compression:

Stored size: 891 Bytes

Contents

# encoding: utf-8
module Phare
  class Check
    class ScssLint < Check
      attr_reader :path

      def initialize(directory, options = {})
        @path = File.expand_path("#{directory}app/assets/stylesheets", __FILE__)
        @extensions = %w(.css .scss)
        @options = options
      end

      def command
        if tree_changed?
          "scss-lint #{tree_changes.join(' ')}"
        else
          "scss-lint #{@path}"
        end
      end

    protected

      def binary_exists?
        !Phare.system_output('which scss-lint').empty?
      end

      def arguments_exists?
        tree_changed? || Dir.exists?(@path)
      end

      def print_banner
        Phare.puts '------------------------------------------'
        Phare.puts 'Running SCSS-Lint to check for SCSS style…'
        Phare.puts '------------------------------------------'
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
phare-0.5 lib/phare/check/scss_lint.rb