Sha256: 7866708c7afb6ee27774296ebbc27e55e64d80408ae5a4bca8be947fee83c878

Contents?: true

Size: 738 Bytes

Versions: 10

Compression:

Stored size: 738 Bytes

Contents

module Vagrant
  # This class handles commands from the command line program `vagrant`
  # and redirects them to the proper sub-command, setting up the environment
  # and executing.
  class Command
    attr_reader :env

    class <<self
      # Executes a given subcommand within the current environment (from the
      # current working directory).
      def execute(*args)
        env = Environment.load!
        env.commands.subcommand(*args)
      end
    end

    def initialize(env)
      @env = env
    end

    # Execute a subcommand with the given name and args. This method properly
    # finds the subcommand, instantiates it, and executes.
    def subcommand(*args)
      Commands::Base.dispatch(env, *args)
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
vagrantup-0.3.4 lib/vagrant/command.rb
vagrantup-0.3.3 lib/vagrant/command.rb
vagrantup-0.3.2 lib/vagrant/command.rb
vagrantup-0.3.1 lib/vagrant/command.rb
vagrantup-0.3.0 lib/vagrant/command.rb
vagrant-0.3.4 lib/vagrant/command.rb
vagrant-0.3.3 lib/vagrant/command.rb
vagrant-0.3.2 lib/vagrant/command.rb
vagrant-0.3.1 lib/vagrant/command.rb
vagrant-0.3.0 lib/vagrant/command.rb