Class: MotherBrain::Bootstrap::Routine::Task Private
- Inherits:
-
Object
- Object
- MotherBrain::Bootstrap::Routine::Task
- Defined in:
- lib/mb/bootstrap/routine.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Container for a bootstrap task defined in a bootstrap routine
Instance Attribute Summary collapse
- #chef_attributes ⇒ Hashie::Mash readonly private
- #group_name ⇒ String readonly private
- #run_list ⇒ Array readonly private
Class Method Summary collapse
- .from_group(group_path, group) ⇒ Routine::Task private
-
.from_group_path(plugin, group_path) ⇒ Routine::Task
private
Create a new bootstrap routine task from a group path.
Instance Method Summary collapse
-
#initialize(group_name, options = {}) ⇒ Task
constructor
private
A new instance of Task.
Constructor Details
#initialize(group_name, options = {}) ⇒ Task
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Task.
45 46 47 48 49 |
# File 'lib/mb/bootstrap/routine.rb', line 45 def initialize(group_name, = {}) @group_name = group_name @run_list = [:run_list] || Array.new @chef_attributes = [:chef_attributes] || Hashie::Mash.new end |
Instance Attribute Details
#chef_attributes ⇒ Hashie::Mash (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/mb/bootstrap/routine.rb', line 42 def chef_attributes @chef_attributes end |
#group_name ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
38 39 40 |
# File 'lib/mb/bootstrap/routine.rb', line 38 def group_name @group_name end |
#run_list ⇒ Array (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
40 41 42 |
# File 'lib/mb/bootstrap/routine.rb', line 40 def run_list @run_list end |
Class Method Details
.from_group(group_path, group) ⇒ Routine::Task
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
32 33 34 |
# File 'lib/mb/bootstrap/routine.rb', line 32 def from_group(group_path, group) new(group_path, run_list: group.run_list, chef_attributes: group.chef_attributes) end |
.from_group_path(plugin, group_path) ⇒ Routine::Task
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create a new bootstrap routine task from a group path
19 20 21 22 23 24 25 |
# File 'lib/mb/bootstrap/routine.rb', line 19 def from_group_path(plugin, group_path) component_id, group_id = group_path.to_s.split('::') group = plugin.component!(component_id).group!(group_id) from_group(group_path, group) rescue ComponentNotFound, GroupNotFound => ex raise PluginSyntaxError, ex end |