Class: Machines::Help
- Inherits:
-
Object
- Object
- Machines::Help
- Defined in:
- lib/machines/help.rb
Instance Method Summary collapse
- #actions ⇒ Object
-
#initialize ⇒ Help
constructor
A new instance of Help.
- #machine_list ⇒ Object
- #syntax ⇒ Object
Constructor Details
#initialize ⇒ Help
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> [tasks]' => 'Display commands that would be run. Optionally, specify tasks to run', 'tasks <machine>' => 'Lists the available tasks for the specified machine', 'build <machine> [tasks]' => 'Builds your chosen machine. Optionally, specify tasks to run', '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
#actions ⇒ Object
16 17 18 |
# File 'lib/machines/help.rb', line 16 def actions @actions.keys.map{|key| key.gsub(/ .*/, '')} end |
#machine_list ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/machines/help.rb', line 20 def machine_list $conf.machines = AppConf.new $conf.load('machines.yml') <<-LIST Machines from machines.yml: #{$conf.machines.keys.map{|machine| " #{machine}" }.join("\n")} LIST end |