Class: Vagrant::Command::Base

Inherits:
Object
  • Object
show all
Includes:
Util::SafePuts
Defined in:
lib/vagrant/command/base.rb

Overview

Base class for any CLI commands.

This class provides documentation on the interface as well as helper functions that a command has.

Instance Method Summary collapse

Methods included from Util::SafePuts

#safe_puts

Constructor Details

#initialize(argv, env) ⇒ Base

Returns a new instance of Base.



14
15
16
17
18
# File 'lib/vagrant/command/base.rb', line 14

def initialize(argv, env)
  @argv = argv
  @env  = env
  @logger = Log4r::Logger.new("vagrant::command::#{self.class.to_s.downcase}")
end

Instance Method Details

#executeObject

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.



23
# File 'lib/vagrant/command/base.rb', line 23

def execute; end