Sha256: a41af99cc8a1bc93595afca2c1d5f2017637ae9a945bc83db64323e6dc890759

Contents?: true

Size: 994 Bytes

Versions: 2

Compression:

Stored size: 994 Bytes

Contents

require 'find'

module SCSSLint
  autoload :CLI, 'scss_lint/cli'
  autoload :Engine, 'scss_lint/engine'
  autoload :Lint, 'scss_lint/lint'
  autoload :LinterRegistry, 'scss_lint/linter_registry'
  autoload :Linter, 'scss_lint/linter'
  autoload :Reporter, 'scss_lint/reporter'
  autoload :Runner, 'scss_lint/runner'

  # Load all linters
  Dir[File.expand_path('scss_lint/linter/*.rb', File.dirname(__FILE__))].each do |file|
    require file
  end

  # Load all reporters
  Dir[File.expand_path('scss_lint/reporter/*.rb', File.dirname(__FILE__))].each do |file|
    require file
  end

  class << self
    def extract_files_from(list)
      files = []
      list.each do |file|
        Find.find(file) do |f|
          files << f if scssish_file?(f)
        end
      end
      files.uniq
    end

  private

    VALID_EXTENSIONS = %w[.css .scss]
    def scssish_file?(file)
      return false unless FileTest.file?(file)

      VALID_EXTENSIONS.include?(File.extname(file))
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
scss-lint-0.6.5 lib/scss_lint.rb
scss-lint-0.6 lib/scss_lint.rb