Module: Vagrant::Easy

Defined in:
lib/vagrant/easy.rb,
lib/vagrant/easy/operations.rb,
lib/vagrant/easy/command_api.rb,
lib/vagrant/easy/command_base.rb

Defined Under Namespace

Classes: CommandAPI, CommandBase, Operations

Class Method Summary (collapse)

Class Method Details

+ (Object) create_command(name, &block)

This creates a new easy command. This typically is not called directly. Instead, the plugin interface's easy_command is used to create one of these.



10
11
12
13
14
15
# File 'lib/vagrant/easy.rb', line 10

def self.create_command(name, &block)
  # Create a new command class for this command, and return it
  command = Class.new(CommandBase)
  command.configure(name, &block)
  command
end

+ (Proc) create_hook(&block)

This creates a new easy hook. This should not be called by the general public. Instead, use the plugin interface.

Returns:

  • (Proc)


21
22
23
24
25
26
27
# File 'lib/vagrant/easy.rb', line 21

def self.create_hook(&block)
  # Create a lambda which simply calls the plugin with the operations
  lambda do |env|
    ops = Operations.new(env[:vm])
    block.call(ops)
  end
end