Class: Gem::Commands::ExecCommand

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

Instance Method Summary collapse

Constructor Details

#initializeExecCommand

Returns a new instance of ExecCommand.



13
14
15
16
17
18
19
# File 'lib/bundler08/commands/exec_command.rb', line 13

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:



25
26
27
# File 'lib/bundler08/commands/exec_command.rb', line 25

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

#descriptionObject

:nodoc:



29
30
31
32
33
# File 'lib/bundler08/commands/exec_command.rb', line 29

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

#executeObject



35
36
37
38
39
# File 'lib/bundler08/commands/exec_command.rb', line 35

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

#usageObject



21
22
23
# File 'lib/bundler08/commands/exec_command.rb', line 21

def usage
  "#{program_name} COMMAND"
end