Module: RuboCop::Chef

Defined in:
lib/rubocop/chef.rb,
lib/rubocop/chef/cookbook_only.rb,
lib/rubocop/chef/cookbook_helpers.rb,
lib/rubocop/chef/platform_helpers.rb,
lib/rubocop/chef/autocorrect_helpers.rb

Overview

RuboCop Chef project namespace

Defined Under Namespace

Modules: AutocorrectHelpers, CookbookHelpers, CookbookOnly, PlatformHelpers

Constant Summary collapse

PROJECT_ROOT =
Pathname.new(__dir__).parent.parent.expand_path.freeze
CONFIG_DEFAULT =
PROJECT_ROOT.join('config', 'cookstyle.yml').freeze
CONFIG =
YAML.load(CONFIG_DEFAULT.read).freeze

Class Method Summary collapse

Class Method Details

.CookbookOnly(segments) ⇒ Object



66
67
68
69
70
71
72
73
74
# File 'lib/rubocop/chef/cookbook_only.rb', line 66

def self.CookbookOnly(segments)
  Module.new do |mod|
    mod.define_singleton_method(:included) do |klass|
      super(klass)
      klass.include(CookbookOnly)
      klass.cookbook_only_segments = segments
    end
  end
end