Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Display "with native extensions" log output correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ivantsepp authored and indirect committed Jun 8, 2015
1 parent 5b14560 commit 1df3308
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions lib/bundler/endpoint_specification.rb
Expand Up @@ -70,6 +70,15 @@ def post_install_message
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|
Expand Down
4 changes: 3 additions & 1 deletion lib/bundler/source/rubygems.rb
Expand Up @@ -117,7 +117,9 @@ def install(spec, opts = {})
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?
Expand Down
2 changes: 1 addition & 1 deletion spec/install/gems/native_extensions_spec.rb
Expand Up @@ -40,8 +40,8 @@
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")
Expand Down

0 comments on commit 1df3308

Please sign in to comment.