0
@@ -28,7 +28,7 @@ Config::CONFIG['libdir'] = GEM_DIR
0
Config::CONFIG['sitelibdir'] = SITE_LIB_DIR
0
-require 'rubygems/
installer'
0
+require 'rubygems/
dependency_installer'
0
class << Gem::Ext::ExtConfBuilder
0
alias_method :make__, :make
0
def self.make(dest_path, results)
0
@@ -41,12 +41,6 @@ class << Gem::Ext::ExtConfBuilder
0
make__(dest_path, results)
0
- alias_method :install__, :install
0
# STDIN.reopen("/dev/tty") if STDIN.eof?
0
class NotSupportedByShoes < Exception; end
0
@@ -68,18 +62,27 @@ def libdir(path)
0
puts "** Adding #{path} to the $LOAD_PATH..."
0
-def fetch_gem(name, version = nil, &blk)
0
- if Gem.source_index.find_name(name, version).empty?
0
- puts "** Fetching #{name} #{version}"
0
+def fetch_gems(gems, &blk)
0
+ ui = Gem::DefaultUserInteraction.ui
0
+ count, total = 0, gems.length
0
+ ui.progress count, total
0
- installer = Gem::Installer.new(:include_dependencies => true)
0
- installer.install(name, version || Gem::Requirement.default, true)
0
+ gems.each do |name, version|
0
+ ui.say "Looking for #{name}"
0
+ if Gem.source_index.find_name(name, version).empty?
0
+ ui.title "Installing #{name}"
0
+ installer = Gem::DependencyInstaller.new
0
+ installer.install(name, version || Gem::Requirement.default)
0
+ gem = Gem.source_index.find_name(name, version).first
0
+ Gem.activate(gem.name, true, "= #{gem.version}")
0
+ ui.say "Finished installing #{name}"
0
+ ui.progress count, total
0
- gem = Gem.source_index.find_name(name, version).first
0
- Gem.activate(gem.name, true, "= #{gem.version}")
0
- puts "** Entering #{gem.full_gem_path}..."
0
Dir.chdir(gem.full_gem_path, &blk)
0
@@ -197,6 +200,58 @@ def install_sources
0
Gem::Installer.new(sources_gem).install()
0
+ class ProgressReporter
0
+ def initialize(prog, size, initial_message,
0
+ terminal_message = "complete")
0
+ @prog.fraction = @count / @total.to_f
0
+ @title, @status, @prog, = app.contents[-1].contents
0
+ def progress count, total
0
+ @prog.fraction = count.to_f / total.to_f
0
+ def alert msg, quiz=nil
0
+ def progress_reporter(*args)
0
+ SilentProgressReporter.new(nil, *args)
0
+ # ProgressReporter.new(@prog, *args)
0
+ def method_missing(*args)
0
class << Gem; attr_accessor :loaded_specs end
Comments
No one has commented yet.