module Bundler::CLI::Common
def self.gem_not_found_message(missing_gem_name, alternatives)
def self.gem_not_found_message(missing_gem_name, alternatives) require_relative "../similarity_detector" message = "Could not find gem '#{missing_gem_name}'." alternate_names = alternatives.map {|a| a.respond_to?(:name) ? a.name : a } suggestions = SimilarityDetector.new(alternate_names).similar_word_list(missing_gem_name) message += "\nDid you mean #{suggestions}?" if suggestions message end