Class: Standup::Scripts::Node
Instance Attribute Summary collapse
-
#node ⇒ Object
Returns the value of attribute node.
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(node) ⇒ Node
constructor
A new instance of Node.
- #put_title ⇒ Object
Methods inherited from Base
#name, #script_file, #with_processed_file
Constructor Details
#initialize(node) ⇒ Node
Returns a new instance of Node.
4 5 6 7 8 9 |
# File 'lib/standup/scripts/node.rb', line 4 def initialize node super merge_params node.params[name] @node = node @remoting = nil end |
Instance Attribute Details
#node ⇒ Object
Returns the value of attribute node.
18 19 20 |
# File 'lib/standup/scripts/node.rb', line 18 def node @node end |
Class Method Details
.execute ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/standup/scripts/node.rb', line 24 def self.execute all_nodes = Settings.nodes.keys nodes = if all_nodes.length > 1 node_args = argument('<node[,node]>', 'node', ['all'] + all_nodes).strip.split(',') if node_args.include? 'all' all_nodes else node_args end else all_nodes end run_on_nodes nodes end |
.run_on_nodes(nodes) ⇒ Object
42 43 44 |
# File 'lib/standup/scripts/node.rb', line 42 def self.run_on_nodes nodes nodes.each {|node| Standup::Node.new(node).run_script name} end |
Instance Method Details
#put_title ⇒ Object
20 21 22 |
# File 'lib/standup/scripts/node.rb', line 20 def put_title bright_p "#{@node.name}:#{name}", HighLine::CYAN end |