Sha256: b46a59f991cb6f22b9145aaa87b6c846db97329de905da62012ed9ac55bf87a2

Contents?: true

Size: 641 Bytes

Versions: 21

Compression:

Stored size: 641 Bytes

Contents

require_relative 'plugins/linter_gem'
require_relative 'plugins/linter_dir'

module SCSSLint
  # Loads external linter plugins.
  class Plugins
    def initialize(config)
      @config = config
    end

    def load
      all.map(&:load)
    end

  private

    def all
      [plugin_gems, plugin_directories].flatten
    end

    def plugin_gems
      Array(@config['plugin_gems']).map do |gem_name|
        LinterGem.new(gem_name)
      end
    end

    def plugin_directories
      Array(@config['plugin_directories']).map do |directory|
        LinterDir.new(File.join(File.dirname(@config.file), directory))
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
scss_lint-0.60.0 lib/scss_lint/plugins.rb
scss_lint-0.59.0 lib/scss_lint/plugins.rb
scss_lint-0.58.0 lib/scss_lint/plugins.rb
scss_lint-0.57.1 lib/scss_lint/plugins.rb
scss_lint-0.57.0 lib/scss_lint/plugins.rb
scss_lint-0.56.0 lib/scss_lint/plugins.rb
scss_lint-0.55.0 lib/scss_lint/plugins.rb
scss_lint-0.54.0 lib/scss_lint/plugins.rb
scss_lint-0.53.0 lib/scss_lint/plugins.rb
scss_lint-0.52.0 lib/scss_lint/plugins.rb
scss_lint-0.51.0 lib/scss_lint/plugins.rb
scss_lint-0.50.3 lib/scss_lint/plugins.rb
scss_lint-0.50.2 lib/scss_lint/plugins.rb
scss_lint-0.50.1 lib/scss_lint/plugins.rb
scss_lint-0.50.0 lib/scss_lint/plugins.rb
scss_lint-0.49.0 lib/scss_lint/plugins.rb
scss_lint-0.48.0 lib/scss_lint/plugins.rb
scss_lint-0.47.1 lib/scss_lint/plugins.rb
scss_lint-0.47.0 lib/scss_lint/plugins.rb
scss_lint-0.46.0 lib/scss_lint/plugins.rb