Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit f6f24b71a41f21953cf4c934a9ece6e1ed76285c 1 parent 0d3c5f0
@jdhollis jdhollis authored Yehuda Katz + Carl Lerche committed
View
10 railties/lib/rails/gem_dependency.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
View
9 railties/test/gem_dependency_test.rb
@@ -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")
Please sign in to comment.
Something went wrong with that request. Please try again.