Sha256: 5659d4d5c3a9cdc352f0ed46d7b990559d5bd4589ce01e3cca3ce4196d618525

Contents?: true

Size: 510 Bytes

Versions: 7

Compression:

Stored size: 510 Bytes

Contents

module SCSSLint
  class NoSuchLinter < StandardError; end

  module LinterRegistry
    @linters = []

    class << self
      attr_reader :linters

      def included(base)
        @linters << base
      end

      def extract_linters_from(linter_names)
        linter_names.map do |linter_name|
          begin
            Linter.const_get(linter_name)
          rescue NameError
            raise NoSuchLinter.new("Linter #{linter_name} does not exist")
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
scss-lint-0.13.0 lib/scss_lint/linter_registry.rb
scss-lint-0.12.1 lib/scss_lint/linter_registry.rb
scss-lint-0.12.0 lib/scss_lint/linter_registry.rb
scss-lint-0.11.1 lib/scss_lint/linter_registry.rb
scss-lint-0.10.1 lib/scss_lint/linter_registry.rb
scss-lint-0.10.0 lib/scss_lint/linter_registry.rb
scss-lint-0.9.0 lib/scss_lint/linter_registry.rb