class Bundler::Repository

def expand_gemfile(spec, options)

def expand_gemfile(spec, options)
  Bundler.logger.info "Installing #{spec.name} (#{spec.version})"
  gemfile = @path.join("cache", "#{spec.full_name}.gem").to_s
  if build_args = options[:build_options] && options[:build_options][spec.name]
    Gem::Command.build_args = build_args.map {|k,v| "--with-#{k}=#{v}"}
  end
  installer = Gem::Installer.new(gemfile, options.merge(
    :install_dir         => @path,
    :ignore_dependencies => true,
    :env_shebang         => true,
    :wrappers            => true,
    :bin_dir             => @bindir
  ))
  installer.install
ensure
  Gem::Command.build_args = []
end