Method: Bundler::CLI::Common.ask_for_spec_from

Defined in:
lib/bundler/cli/common.rb

.ask_for_spec_from(specs) ⇒ Object



86
87
88
89
90
91
92
93
94
# File 'lib/bundler/cli/common.rb', line 86

def self.ask_for_spec_from(specs)
  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