Class: Dapp::Config::Chef
- Inherits:
-
Object
- Object
- Dapp::Config::Chef
- Defined in:
- lib/dapp/config/chef.rb
Overview
Chef
Instance Attribute Summary collapse
-
#_modules ⇒ Object
readonly
Returns the value of attribute _modules.
-
#_recipes ⇒ Object
readonly
Returns the value of attribute _recipes.
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize ⇒ Chef
constructor
A new instance of Chef.
- #module(*args) ⇒ Object
- #recipe(*args) ⇒ Object
- #remove_recipe(*args) ⇒ Object
- #reset_all ⇒ Object
- #reset_modules ⇒ Object
- #reset_recipes ⇒ Object
- #skip_module(*args) ⇒ Object
Constructor Details
#initialize ⇒ Chef
Returns a new instance of Chef.
8 9 10 11 |
# File 'lib/dapp/config/chef.rb', line 8 def initialize @_modules = [] @_recipes = [] end |
Instance Attribute Details
#_modules ⇒ Object (readonly)
Returns the value of attribute _modules.
5 6 7 |
# File 'lib/dapp/config/chef.rb', line 5 def _modules @_modules end |
#_recipes ⇒ Object (readonly)
Returns the value of attribute _recipes.
6 7 8 |
# File 'lib/dapp/config/chef.rb', line 6 def _recipes @_recipes end |
Instance Method Details
#clone ⇒ Object
42 43 44 |
# File 'lib/dapp/config/chef.rb', line 42 def clone Marshal.load(Marshal.dump(self)) end |
#module(*args) ⇒ Object
13 14 15 |
# File 'lib/dapp/config/chef.rb', line 13 def module(*args) @_modules.concat(args) end |
#recipe(*args) ⇒ Object
25 26 27 |
# File 'lib/dapp/config/chef.rb', line 25 def recipe(*args) @_recipes.concat(args) end |
#remove_recipe(*args) ⇒ Object
29 30 31 |
# File 'lib/dapp/config/chef.rb', line 29 def remove_recipe(*args) @_recipes.reject! { |recipe| args.include? recipe } end |
#reset_all ⇒ Object
37 38 39 40 |
# File 'lib/dapp/config/chef.rb', line 37 def reset_all reset_modules reset_recipes end |
#reset_modules ⇒ Object
17 18 19 |
# File 'lib/dapp/config/chef.rb', line 17 def reset_modules @_modules.clear end |
#reset_recipes ⇒ Object
33 34 35 |
# File 'lib/dapp/config/chef.rb', line 33 def reset_recipes @_recipes.clear end |
#skip_module(*args) ⇒ Object
21 22 23 |
# File 'lib/dapp/config/chef.rb', line 21 def skip_module(*args) @_modules.reject! { |mod| args.include? mod } end |