Class: Proctor::Command::RenderGroupCmd
- Inherits:
-
Object
- Object
- Proctor::Command::RenderGroupCmd
- Includes:
- Helpers::Command, Resource::Erb, Resource::Lookup
- Defined in:
- lib/proctor/command/render_group_cmd.rb
Instance Method Summary collapse
- #group ⇒ Object
-
#initialize(global, options, args) ⇒ RenderGroupCmd
constructor
A new instance of RenderGroupCmd.
- #render ⇒ Object
- #render_string ⇒ Object
Methods included from Resource::Lookup
#lookup_valid_group_template, #lookup_valid_manager, #lookup_valid_node, #lookup_valid_service, #lookup_valid_service_template, #lookup_valid_services, #lookup_valid_services_hash
Methods included from Resource::Erb
#erb_ify, #erb_ify_hash, #erb_ify_services, #generate_group_erb, #generate_group_header, #generate_service_erb, #generate_service_header, #render_group_template, #render_service_template
Methods included from Helpers::Command
#check_number_of_args, #options_msg
Constructor Details
#initialize(global, options, args) ⇒ RenderGroupCmd
Returns a new instance of RenderGroupCmd.
13 14 15 16 17 18 19 |
# File 'lib/proctor/command/render_group_cmd.rb', line 13 def initialize(global, , args) @manager = args[0] @node = args[1] @env = ['env'] opts = {'MANAGERS' => @env.managers.names, 'NODES' => @env.nodes.names} check_number_of_args(args, 2, 'render_group MANAGER NODE', opts) end |
Instance Method Details
#group ⇒ Object
29 30 31 |
# File 'lib/proctor/command/render_group_cmd.rb', line 29 def group puts render_string end |
#render ⇒ Object
33 34 35 |
# File 'lib/proctor/command/render_group_cmd.rb', line 33 def render puts render_string end |
#render_string ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/proctor/command/render_group_cmd.rb', line 21 def render_string manager = lookup_valid_manager(@manager, @env) node = lookup_valid_node(@node, @env) template = lookup_valid_group_template(@manager, @node, @env) services = lookup_valid_services_hash(@node, @env) render_group_template(manager, node, services, template, @env) end |