diff --git a/lib/shoes/cobbler.rb b/lib/shoes/cobbler.rb index a09611e0..fc85c395 100644 --- a/lib/shoes/cobbler.rb +++ b/lib/shoes/cobbler.rb @@ -1,28 +1,10 @@ # Cobbler - various Shoes maintenance things -# CJC: the gem handling is kind of ugly. Someone should make it pretty. +# TODO: the gem handling is kind of ugly. Someone should make it pretty, if possible. require 'rubygems' require 'rubygems/dependency_installer' require 'rubygems/uninstaller' require 'rubygems/package' - -module Gem - if Shoes::RELEASE_TYPE =~ /TIGHT/ - @ruby = (File.join(RbConfig::CONFIG['bindir'], 'shoes') + RbConfig::CONFIG['EXEEXT']). - sub(/.*\s.*/m, '"\&"') + " --ruby" - end -end -class << Gem::Ext::ExtConfBuilder - alias_method :make__, :make - def make(dest_path, results) - raise unless File.exist?('Makefile') - mf = File.read('Makefile') - mf = mf.gsub(/^INSTALL\s*=\s*.*$/, "INSTALL = $(RUBY) -run -e install -- -vp") - mf = mf.gsub(/^INSTALL_PROG\s*=\s*.*$/, "INSTALL_PROG = $(INSTALL) -m 0755") - mf = mf.gsub(/^INSTALL_DATA\s*=\s*.*$/, "INSTALL_DATA = $(INSTALL) -m 0644") - File.open('Makefile', 'wb') {|f| f.print mf} - make__(dest_path, results) - end -end +require 'shoes/setup' class Gem::CobblerFace class DownloadReporter #ProgressReporter @@ -451,7 +433,7 @@ def gem_install_one spec # setup Gem download ui ui = Gem::DefaultUserInteraction.ui = Gem::CobblerFace.new(@progbar, @status) ui.title "Installing #{spec.name} #{spec.version}" - installer = Gem::DependencyInstaller.new({:nodoc => true, :install_dir => GEM_DIR}) + installer = Gem::DependencyInstaller.new({:document => [], :install_dir => GEM_DIR}) begin #$stderr.puts "gem build setup: #{installer.options}" installer.install(spec.name, spec.version) @@ -478,7 +460,9 @@ def gemremove spec if confirm "Really delete gem #{spec.name}" begin Gem::DefaultUserInteraction.ui = Gem::CobblerDelFace.new() - del = Gem::Uninstaller.new(spec) + # TODO new(gem, options) not new(spec) + del = Gem::Uninstaller.new(spec.name) + #del.uninstall() # deep remove - del.remove(spec) rescue Exception => e alert e diff --git a/lib/shoes/setup.rb b/lib/shoes/setup.rb index 5324354e..f244dd9f 100644 --- a/lib/shoes/setup.rb +++ b/lib/shoes/setup.rb @@ -151,7 +151,7 @@ def start(app) name, version = arg.split(/\s+/, 2) count += 1 # need to handle multiple matching gemspecs - installer = Gem::DependencyInstaller.new + installer = Gem::DependencyInstaller.new(:document => []) poss_gems = installer.find_spec_by_name_and_version(name, version) #poss_gems.each_spec { |g| puts "#{g.name} #{g.version}"} this_one = nil