module Bundler::CLI::Common

def self.ask_for_spec_from(specs)

def self.ask_for_spec_from(specs)
  if !$stdout.tty? && ENV['BUNDLE_SPEC_RUN'].nil?
    raise GemNotFound, gem_not_found_message(name, Bundler.definition.dependencies)
  end
  specs.each_with_index do |spec, index|
    Bundler.ui.info "#{index.succ} : #{spec.name}", true
  end
  Bundler.ui.info '0 : - exit -', true
  num = Bundler.ui.ask('> ').to_i
  num > 0 ? specs[num - 1] : nil
end