Module: RuboCop::Chef

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

Overview

RuboCop Chef project namespace

Defined Under Namespace

Modules: CookbookHelpers, CookbookOnly

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

rubocop: disable Naming/MethodName



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

def self.CookbookOnly(segments) # rubocop: disable Naming/MethodName
  Module.new do |mod|
    mod.define_singleton_method(:included) do |klass|
      super(klass)
      klass.include(CookbookOnly)
      klass.cookbook_only_segments = segments
    end
  end
end