rakelib/setup.rake in buildrdeb-0.0.3 vs rakelib/setup.rake in buildrdeb-1.0.0
- old
+ new
@@ -15,11 +15,11 @@
require 'jruby' if RUBY_PLATFORM[/java/]
require 'rubygems/source_info_cache'
-RAKE_SUDO = case (ENV['RAKE_SUDO'] or 'yes').strip.downcase
+RAKE_SUDO = case (ENV['RAKE_SUDO'] or 'false').strip.downcase
when 'yes', 'true'
true
else
false
end
@@ -33,11 +33,18 @@
puts "Installing #{name} ..."
rb_bin = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
args = []
args << 'sudo' << 'env' << "JAVA_HOME=#{ENV['JAVA_HOME']}" if sudo_needed? and RAKE_SUDO
args << rb_bin << '-S' << 'gem' << 'install' << name
- args << '--version' << dep.version_requirements.to_s
+
+ if (spec.respond_to? :requirement)
+ args << '--version' << dep.requirement.to_s
+ else
+ # Dependency.version_requirements deprecated in rubygems 1.3.6
+ args << '--version' << dep.version_requirements.to_s
+ end
+
args << '--source' << options[:source] if options[:source]
args << '--source' << 'http://gems.rubyforge.org'
args << '--install-dir' << ENV['GEM_HOME'] if ENV['GEM_HOME']
sh *args
end
@@ -47,8 +54,13 @@
# Setup environment for running this Rakefile (RSpec, Jekyll, etc).
desc "If you're building from sources, run this task first to setup the necessary dependencies."
task :setup do
missing = spec.dependencies.select { |dep| Gem::SourceIndex.from_installed_gems.search(dep).empty? }
missing.each do |dep|
- install_gem dep.name, :version=>dep.version_requirements
+ if (spec.respond_to? :requirement)
+ install_gem dep.name, :version=>dep.requirement
+ else
+ # Dependency.version_requirements deprecated in rubygems 1.3.6
+ install_gem dep.name, :version=>dep.version_requirements
+ end
end
end