Class: Machines::Help

Inherits:
Object
  • Object
show all
Defined in:
lib/machines/help.rb

Instance Method Summary collapse

Constructor Details

#initializeHelp

Returns a new instance of Help.



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/machines/help.rb', line 3

def initialize
  @actions = {
    'htpasswd' => 'Generates basic auth in webserver/conf/htpasswd',
    'new <DIR>' => 'Generates an example machines project in DIR',
    'dryrun <machine>' => 'Logs commands but does not run them',
    'tasks' => 'Lists the available tasks',
    'build <machine> [task]' => 'Builds your chosen machine. Optionally, build just one task',
    'list' => 'Lists the available machines',
    'packages' => 'Lists the available packages',
    'override <PACKAGE>' => 'Copies the default package into project/packages so it can be edited/overidden'
  }
end

Instance Method Details

#actionsObject



16
17
18
# File 'lib/machines/help.rb', line 16

def actions
  @actions.keys.map{|key| key.gsub(/ .*/, '')}
end

#syntaxObject



20
21
22
23
24
25
26
27
# File 'lib/machines/help.rb', line 20

def syntax
  <<HELP
machines v#{Machines::VERSION} - Ubuntu/Ruby configuration tool.
machines COMMAND
COMMAND can be:
#{@actions.map{|action, help| "  %-25s#{help}" % action}.join("\n")}
HELP
end