Class: Vagrant::Plugin::V2::Command
- Inherits:
-
Object
- Object
- Vagrant::Plugin::V2::Command
- Includes:
- Util::SafePuts
- Defined in:
- lib/vagrant/plugin/v2/command.rb
Overview
This is the base class for a CLI command.
Direct Known Subclasses
Class Method Summary collapse
-
.synopsis ⇒ String
This should return a brief (60 characters or less) synopsis of what this command does.
Instance Method Summary collapse
-
#execute ⇒ Object
This is what is called on the class to actually execute it.
-
#initialize(argv, env) ⇒ Command
constructor
A new instance of Command.
Methods included from Util::SafePuts
Constructor Details
#initialize(argv, env) ⇒ Command
Returns a new instance of Command.
22 23 24 25 26 |
# File 'lib/vagrant/plugin/v2/command.rb', line 22 def initialize(argv, env) @argv = argv @env = env @logger = Log4r::Logger.new("vagrant::command::#{self.class.to_s.downcase}") end |
Class Method Details
.synopsis ⇒ String
This should return a brief (60 characters or less) synopsis of what this command does. It will be used in the output of the help.
18 19 20 |
# File 'lib/vagrant/plugin/v2/command.rb', line 18 def self.synopsis "" end |
Instance Method Details
#execute ⇒ Object
This is what is called on the class to actually execute it. Any subclasses should implement this method and do any option parsing and validation here.
31 32 |
# File 'lib/vagrant/plugin/v2/command.rb', line 31 def execute end |