method

ask_for_spec_from

ruby latest stable - Class: Bundler::CLI::Common

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

ask_for_spec_from(specs)
public

No documentation available.

# File lib/bundler/cli/common.rb, line 51
    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