All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gems.scss_lint-0.57.0.lib.scss_lint.linter_registry.rb Maven / Gradle / Ivy

There is a newer version: 3.7.2
Show newest version
module SCSSLint
  class NoSuchLinter < StandardError; end

  # Stores all linters available to the application.
  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, "Linter #{linter_name} does not exist"
          end
        end
      end
    end
  end
end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy