ruby-win32/lib/ruby/site_ruby/1.8/rubygems/uninstaller.rb
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
##
# Performs the uninstall of the Gem.  This removes the spec, the
# Gem directory, and the cached .gem file,
#
Performs the uninstall of the Gem.  This removes the spec, the
Gem directory, and the cached .gem file.
Performs the uninstall of the Gem . This removes the spec the Gem directory and the cached . gem file .
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
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
Performs the uninstall of the Gem.
Performs the uninstall of the Gem .