Permalink
Browse files

Only check for built extensions on gem dependencies that are in vendo…

…r/gems. [#2825 state:resolved]

Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
  • Loading branch information...
1 parent 0d3c5f0 commit f6f24b71a41f21953cf4c934a9ece6e1ed76285c @jdhollis jdhollis committed with Yehuda Katz + Carl Lerche Jun 30, 2009
Showing with 16 additions and 3 deletions.
  1. +7 −3 railties/lib/rails/gem_dependency.rb
  2. +9 −0 railties/test/gem_dependency_test.rb
@@ -122,10 +122,14 @@ def requirement
def built?
return false unless frozen?
- specification.extensions.each do |ext|
- makefile = File.join(unpacked_gem_directory, File.dirname(ext), 'Makefile')
- return false unless File.exists?(makefile)
+
+ if vendor_gem?
+ specification.extensions.each do |ext|
+ makefile = File.join(unpacked_gem_directory, File.dirname(ext), 'Makefile')
+ return false unless File.exists?(makefile)
+ end
end
+
true
end
@@ -198,6 +198,15 @@ def test_gem_determines_build_status
assert_equal true, Rails::GemDependency.new("dummy-gem-i").built?
assert_equal false, Rails::GemDependency.new("dummy-gem-j").built?
end
+
+ def test_gem_determines_build_status_only_on_vendor_gems
+ framework_gem = Rails::GemDependency.new('dummy-framework-gem')
+ framework_gem.stubs(:framework_gem?).returns(true) # already loaded
+ framework_gem.stubs(:vendor_rails?).returns(false) # but not in vendor/rails
+ framework_gem.stubs(:vendor_gem?).returns(false) # and not in vendor/gems
+ framework_gem.add_load_paths # freeze framework gem early
+ assert framework_gem.built?
+ end
def test_gem_build_passes_options_to_dependencies
start_gem = Rails::GemDependency.new("dummy-gem-g")

0 comments on commit f6f24b7

Please sign in to comment.