Class: Gem::Commands::ExecCommand

Inherits:
Gem::Command
  • Object
show all
Defined in:
lib/bundler/commands/exec_command.rb

Instance Method Summary collapse

Constructor Details

#initializeExecCommand

Returns a new instance of ExecCommand.



8
9
10
11
12
13
14
# File 'lib/bundler/commands/exec_command.rb', line 8

def initialize
  super('exec', 'Run a command in context of a gem bundle', {:manifest => nil})

  add_option('-m', '--manifest MANIFEST', "Specify the path to the manifest file") do |manifest, options|
    options[:manifest] = manifest
  end
end

Instance Method Details

#argumentsObject

:nodoc:



20
21
22
# File 'lib/bundler/commands/exec_command.rb', line 20

def arguments # :nodoc:
  "COMMAND  command to run in context of the gem bundle"
end

#descriptionObject

:nodoc:



24
25
26
27
28
# File 'lib/bundler/commands/exec_command.rb', line 24

def description # :nodoc:
  <<-EOF.gsub('      ', '')
    Run in context of a bundle
  EOF
end

#executeObject



30
31
32
33
34
# File 'lib/bundler/commands/exec_command.rb', line 30

def execute
  # Prevent the bundler from getting required unless it is actually being used
  require 'bundler'
  Bundler::CLI.run(:exec, options)
end

#usageObject



16
17
18
# File 'lib/bundler/commands/exec_command.rb', line 16

def usage
  "#{program_name} COMMAND"
end