You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by to...@apache.org on 2010/05/20 09:45:12 UTC

svn commit: r946555 - /buildr/trunk/spec/spec_helpers.rb

Author: toulmean
Date: Thu May 20 07:45:12 2010
New Revision: 946555

URL: http://svn.apache.org/viewvc?rev=946555&view=rev
Log:
correct way to call for requirement over dependencies

Modified:
    buildr/trunk/spec/spec_helpers.rb

Modified: buildr/trunk/spec/spec_helpers.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/spec_helpers.rb?rev=946555&r1=946554&r2=946555&view=diff
==============================================================================
--- buildr/trunk/spec/spec_helpers.rb (original)
+++ buildr/trunk/spec/spec_helpers.rb Thu May 20 07:45:12 2010
@@ -22,12 +22,9 @@ unless defined?(SpecHelpers)
 
   # For testing we use the gem requirements specified on the buildr.gemspec
   spec = Gem::Specification.load(File.expand_path('../buildr.gemspec', File.dirname(__FILE__)))
-  if (spec.respond_to? :requirement)
-    spec.dependencies.each { |dep| gem dep.name, dep.requirement.to_s }
-  else
-    # Dependency.version_requirements deprecated in rubygems 1.3.6
-    spec.dependencies.each { |dep| gem dep.name, dep.version_requirements.to_s }
-  end
+  # Dependency.version_requirements deprecated in rubygems 1.3.6
+  spec.dependencies.each { |dep| gem dep.name, (dep.respond_to?(:requirement) ? dep.requirement.to_s : dep.version_requirements.to_s) }
+  
   # Make sure to load from these paths first, we don't want to load any
   # code from Gem library.
   $LOAD_PATH.unshift File.expand_path('../lib', File.dirname(__FILE__)),