Class: VagrantPlugins::DevCommands::Command
- Inherits:
-
Object
- Object
- VagrantPlugins::DevCommands::Command
- Defined in:
- lib/vagrant/devcommands/command.rb
Overview
Defines the executable vagrant command
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(argv, env) ⇒ Command
constructor
A new instance of Command.
Constructor Details
Class Method Details
.synopsis ⇒ Object
5 6 7 |
# File 'lib/vagrant/devcommands/command.rb', line 5 def self.synopsis 'runs vagrant commands from a Commandfile' end |
Instance Method Details
#execute ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/vagrant/devcommands/command.rb', line 15 def execute command = @argv.last commandfile = Commandfile.new(@env) return display_error('Missing "Commandfile"') unless commandfile.exist? @registry.read_commandfile(commandfile) return display_help unless command unless @registry.valid_command?(command) return display_error("Invalid command \"#{command}\"\n") end run @registry.commands[command] end |