Class: Fauxpaas::Command
- Inherits:
-
Object
show all
- Defined in:
- lib/fauxpaas/command.rb
Overview
Represetns a command within Fauxpaas
Instance Method Summary
collapse
Constructor Details
#initialize(options) ⇒ Command
Returns a new instance of Command.
8
9
10
|
# File 'lib/fauxpaas/command.rb', line 8
def initialize(options)
@options = options
end
|
Instance Method Details
#bin ⇒ Object
12
13
14
|
# File 'lib/fauxpaas/command.rb', line 12
def bin
"help"
end
|
#default_keys ⇒ Object
20
21
22
|
# File 'lib/fauxpaas/command.rb', line 20
def default_keys
[:instance_name, :server]
end
|
#execute ⇒ Object
16
17
18
|
# File 'lib/fauxpaas/command.rb', line 16
def execute
Fauxpaas.system_runner.run(ssh_command)
end
|
24
25
26
|
# File 'lib/fauxpaas/command.rb', line 24
def
[]
end
|
#keys ⇒ Object
28
29
30
|
# File 'lib/fauxpaas/command.rb', line 28
def keys
default_keys |
end
|
#missing ⇒ Object
32
33
34
|
# File 'lib/fauxpaas/command.rb', line 32
def missing
keys.select {|k| options[k].nil? }
end
|
#valid? ⇒ Boolean
36
37
38
|
# File 'lib/fauxpaas/command.rb', line 36
def valid?
missing.empty?
end
|