Class: LaunchPad::Host

Inherits:
Command show all
Defined in:
lib/launch-pad/command/host.rb

Instance Attribute Summary

Attributes inherited from Command

#options

Instance Method Summary collapse

Methods inherited from Command

#initialize, #sets_activity?

Constructor Details

This class inherits a constructor from LaunchPad::Command

Instance Method Details

#activateObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/launch-pad/command/host.rb', line 4

def activate
  response = true
  
  if !options[:register].nil?
    puts "New host: #{options[:name]}"
    node = Node.new :name => options[:name], :role => options[:role]
    response = node.save      
  elsif !options[:unregister].nil?
    puts "Unregistering host: #{options[:name]}"
    node = Node.find_by_name options[:name]
    unless node.nil?
      response = node.delete
    end
  end
  
  response
end

#invalidates_config?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/launch-pad/command/host.rb', line 22

def invalidates_config?
  true
end