Sha256: 32dc25185acca2ab20e629c45af2a37a3adfbf927dd738794685ad6763b3327b

Contents?: true

Size: 909 Bytes

Versions: 2

Compression:

Stored size: 909 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

        super
      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

2 entries across 2 versions & 1 rubygems

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