module HamlLint::LinterRegistry

Stores all defined linters.

Attributes

linters[R]

List of all registered linters.

Public Class Methods

extract_linters_from(linter_names) click to toggle source

Return a list of {HamlLint::Linter} {Class}es corresponding to the specified list of names.

@param linter_names [Array<String>] @return [Array<Class>]

# File lib/haml_lint/linter_registry.rb, line 28
def extract_linters_from(linter_names)
  linter_names.map do |linter_name|
    begin
      HamlLint::Linter.const_get(linter_name)
    rescue NameError
      raise NoSuchLinter, "Linter #{linter_name} does not exist"
    end
  end
end
included(subclass) click to toggle source

Executed when a linter includes the {LinterRegistry} module.

This results in the linter being registered with the registry.

@param subclass [Class]

# File lib/haml_lint/linter_registry.rb, line 19
def included(subclass)
  @linters << subclass
end