Permalink
Browse files

Fix extra - on gem uninstall output. Bug #20746.

git-svn-id: http://rubygems.rubyforge.org/svn/trunk@1788 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information...
drbrain
drbrain committed Jun 20, 2008
1 parent bb0b6ca commit b0ffcb230cdeba198a9c97f1e3161f65a817841e
Showing with 15 additions and 9 deletions.
  1. +5 −0 ChangeLog
  2. +2 −1 Rakefile
  3. +8 −8 lib/rubygems/uninstaller.rb
View
@@ -1,3 +1,8 @@
+2008-06-20 Eric Hodel <drbrain@segment7.net>
+
+ * lib/rubygems/uninstaller.rb: Improve output when a gem to uninstall
+ isn't found. Bug #20746 reported by Chad Wooley.
+
2008-06-20 Luis Lavena <luislavena@gmail.com>
* setup.rb: Only prepend install_destdir when especified. Fixes
View
@@ -336,7 +336,8 @@ task :install do
svnversion = `svnversion`.split(':').last.sub(/[^\d]/, '').strip
unless svnversion.empty? then
- current_version = Gem::RubyGemsVersion.split '.', 4
+ File.read('lib/rubygems/rubygems_version.rb') =~ /RubyGemsVersion = '(.*)'/
+ current_version = $1.split '.', 4
rubygems_version = (current_version[0, 3] << svnversion).join '.'
rubygems_version_file = File.join Gem::ConfigMap[:sitelibdir], 'rubygems',
'rubygems_version.rb'
@@ -30,7 +30,7 @@ def initialize(gem, options = {})
@force_executables = options[:executables]
@force_all = options[:all]
@force_ignore = options[:ignore]
- @bin_dir = options[:bin_dir]
+ @bin_dir = options[:bin_dir]
end
##
@@ -41,17 +41,17 @@ def uninstall
list = Gem.source_index.search(/^#{@gem}$/, @version)
if list.empty? then
- raise Gem::InstallError, "Unknown gem #{@gem}-#{@version}"
+ raise Gem::InstallError, "Unknown gem #{@gem} #{@version}"
elsif list.size > 1 && @force_all
- remove_all(list.dup)
+ remove_all(list.dup)
remove_executables(list.last)
- elsif list.size > 1
- say
+ 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_all(list.dup)
remove_executables(list.last)
elsif index >= 0 && index < list.size
to_remove = list[index]
@@ -65,7 +65,7 @@ def uninstall
remove_executables(list.last)
end
end
-
+
##
# Removes installed executables and batch files (windows only) for
# +gemspec+.
@@ -111,7 +111,7 @@ def remove_executables(gemspec)
end
end
end
-
+
##
# Removes all gems in +list+.
#

0 comments on commit b0ffcb2

Please sign in to comment.