class Appraisal::Command

Executes commands with a clean environment

Constants

BUNDLER_ENV_VARS

Public Class Methods

from_args(gemfile) click to toggle source
# File lib/appraisal/command.rb, line 6
def self.from_args(gemfile)
  command = ([$0] + ARGV.slice(1, ARGV.size)).join(' ')
  new(command, gemfile)
end
new(command, gemfile = nil) click to toggle source
# File lib/appraisal/command.rb, line 11
def initialize(command, gemfile = nil)
  @original_env = {}
  @gemfile = gemfile
  if command =~ %r^bundle/
    @command = command
  else
    @command = "bundle exec #{command}"
  end
end

Public Instance Methods

exec() click to toggle source
# File lib/appraisal/command.rb, line 30
def exec
  announce
  with_clean_env { Kernel.exec(@command) }
end
run() click to toggle source
# File lib/appraisal/command.rb, line 21
def run
  announce
  with_clean_env do
    unless Kernel.system(@command)
      exit(1)
    end
  end
end