uninstall (Gem::Uninstaller)

    # File lib/rubygems/uninstaller.rb, line 37
      def uninstall
        list = Gem.source_index.search(/^#{@gem}$/, @version)

        if list.empty? then
          raise Gem::InstallError, "Unknown gem #{@gem}-#{@version}"
        elsif list.size > 1 && @force_all
          remove_all(list.dup)
          remove_executables(list.last)
        elsif list.size > 1
          say
          gem_names = list.collect {|gem| gem.full_name} + ["All versions"]
          gem_name, index =
            choose_from_list("Select gem to uninstall:", gem_names)
          if index == list.size
            remove_all(list.dup)
            remove_executables(list.last)
          elsif index >= 0 && index < list.size
            to_remove = list[index]
            remove(to_remove, list)
            remove_executables(to_remove)
          else
            say "Error: must enter a number [1-#{list.size+1}]"
          end
        else
          remove(list[0], list.dup)
          remove_executables(list.last)
        end
      end