summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Tse <ivan.tse1@gmail.com>2015-06-03 03:18:54 -0400
committerAndre Arko <andre@arko.net>2015-06-08 00:10:22 -0700
commit1df3308a1e94e37d5266e478854be360bb467f41 (patch)
tree168c7ec410f04b93146d05e8b952e7cbf83e6e0c
parent5b14560e1cbe70a376290bdb2aa33414421ecafa (diff)
downloadbundler-1df3308a1e94e37d5266e478854be360bb467f41.tar.gz
Display "with native extensions" log output correctly
-rw-r--r--lib/bundler/endpoint_specification.rb9
-rw-r--r--lib/bundler/source/rubygems.rb4
-rw-r--r--spec/install/gems/native_extensions_spec.rb2
3 files changed, 13 insertions, 2 deletions
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb
index b27b0f5040..21a6c85c5a 100644
--- a/lib/bundler/endpoint_specification.rb
+++ b/lib/bundler/endpoint_specification.rb
@@ -70,6 +70,15 @@ module Bundler
end
end
+ # needed for "with native extensions" during install
+ def extensions
+ if @remote_specification
+ @remote_specification.extensions
+ elsif _local_specification
+ _local_specification.extensions
+ end
+ end
+
def _local_specification
if @loaded_from && File.exist?(local_specification_path)
eval(File.read(local_specification_path)).tap do |spec|
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index c066e898a5..7b40860db9 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -117,7 +117,9 @@ module Bundler
end
unless Bundler.settings[:no_install]
- Bundler.ui.confirm "Installing #{version_message(spec)} "
+ message = "Installing #{version_message(spec)}"
+ message << " with native extensions" if spec.extensions.any?
+ Bundler.ui.confirm message
path = cached_gem(spec)
if Bundler.requires_sudo?
diff --git a/spec/install/gems/native_extensions_spec.rb b/spec/install/gems/native_extensions_spec.rb
index 5982afcc4a..8d14acf5f3 100644
--- a/spec/install/gems/native_extensions_spec.rb
+++ b/spec/install/gems/native_extensions_spec.rb
@@ -40,8 +40,8 @@ describe "installing a gem with native extensions" do
bundle "config build.c_extension --with-c_extension=hello"
bundle "install"
- expect(out).to include("Installing c_extension 1.0 with native extensions")
expect(out).not_to include("extconf.rb failed")
+ expect(out).to include("Installing c_extension 1.0 with native extensions")
run "Bundler.require; puts CExtension.new.its_true"
expect(out).to eq("true")