Method: PuppetLint::Configuration.add_check

Defined in:
lib/puppet-lint/configuration.rb

.add_check(check) ⇒ Object

Internal: Add helper methods for a new check to the PuppetLint::Configuration object.

check - The String name of the check.

Returns nothing.

Signature

<check>_enabled?
disable_<check>
enable_<check>


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/puppet-lint/configuration.rb', line 17

def self.add_check(check)
  # Public: Determine if the named check is enabled.
  #
  # Returns true if the check is enabled, otherwise return false.
  define_method("#{check}_enabled?") do
    settings["#{check}_disabled"] == true ? false : true
  end

  # Public: Disable the named check.
  #
  # Returns nothing.
  define_method("disable_#{check}") do
    settings["#{check}_disabled"] = true
  end

  # Public: Enable the named check.
  #
  # Returns nothing.
  define_method("enable_#{check}") do
    settings["#{check}_disabled"] = false
  end
end