buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vbo...@apache.org
Subject svn commit: r632105 - /incubator/buildr/trunk/Rakefile
Date Thu, 28 Feb 2008 20:02:37 GMT
Author: vborja
Date: Thu Feb 28 12:02:33 2008
New Revision: 632105

URL: http://svn.apache.org/viewvc?rev=632105&view=rev
Log:
Use Gem::RemoteInstaller when Gem::DependencyInstaller not available. (pre rubygems 1.0.1
versions)

Modified:
    incubator/buildr/trunk/Rakefile

Modified: incubator/buildr/trunk/Rakefile
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/Rakefile?rev=632105&r1=632104&r2=632105&view=diff
==============================================================================
--- incubator/buildr/trunk/Rakefile (original)
+++ incubator/buildr/trunk/Rakefile Thu Feb 28 12:02:33 2008
@@ -67,10 +67,15 @@
 task 'install-dependencies' do
   gems = Gem::SourceIndex.from_installed_gems
   specify(RUBY_PLATFORM).dependencies.each do |dep|
-    if gems.search(dep).empty?
-      puts "Installing gem: #{dep}"
-      require 'rubygems/dependency_installer'
-      Gem::DependencyInstaller.new(dep.name, dep.version_requirements).install
+    if gems.search(dep.name, dep.version_requirements).empty?
+      puts "Installing dependency: #{dep}"
+      begin
+        require 'rubygems/dependency_installer'
+        Gem::DependencyInstaller.new(dep.name, dep.version_requirements).install
+      rescue LoadError # < rubygems 1.0.1
+        require 'rubygems/remote_installer'
+        Gem::RemoteInstaller.new.install(dep.name, dep.version_requirements)
+      end
     end
   end
 end



Mime
View raw message