summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTerence Lee <hone02@gmail.com>2013-08-26 22:57:15 -0400
committerTerence Lee <hone02@gmail.com>2013-08-27 18:00:14 -0400
commit47af7f14335446a0410e3ad76592bc605a6b54fe (patch)
tree148c5c42b5d138b01ebb532fc316cf2235f976d2
parent3f1a085440cbb3b72bf4764677338e2bb25ed656 (diff)
downloadbundler-47af7f14335446a0410e3ad76592bc605a6b54fe.tar.gz
move ui messaging out of sources
-rw-r--r--lib/bundler/installer.rb12
-rw-r--r--lib/bundler/source/git.rb6
-rw-r--r--lib/bundler/source/path.rb3
-rw-r--r--lib/bundler/source/rubygems.rb7
4 files changed, 15 insertions, 13 deletions
diff --git a/lib/bundler/installer.rb b/lib/bundler/installer.rb
index 39bf6c7e2c..1fc92441c8 100644
--- a/lib/bundler/installer.rb
+++ b/lib/bundler/installer.rb
@@ -107,10 +107,14 @@ module Bundler
Bundler::Fetcher.fetch(spec) if spec.source.is_a?(Bundler::Source::Rubygems)
# Fetch the build settings, if there are any
- settings = Bundler.settings["build.#{spec.name}"]
- message = nil
+ settings = Bundler.settings["build.#{spec.name}"]
+ install_message = nil
+ post_install_message = nil
+ debug_message = nil
Bundler.rubygems.with_build_args [settings] do
- message = spec.source.install(spec)
+ install_message, post_install_message, debug_message = spec.source.install(spec)
+ Bundler.ui.info install_message
+ Bundler.ui.debug debug_message if debug_message
Bundler.ui.debug " #{spec.name} (#{spec.version}) from #{spec.loaded_from}"
end
@@ -121,7 +125,7 @@ module Bundler
end
FileUtils.rm_rf(Bundler.tmp)
- message
+ post_install_message
rescue Exception => e
# if install hook failed or gem signature is bad, just die
raise e if e.is_a?(Bundler::InstallHookError) || e.is_a?(Bundler::SecurityError)
diff --git a/lib/bundler/source/git.rb b/lib/bundler/source/git.rb
index 9f308881e7..0480428c3f 100644
--- a/lib/bundler/source/git.rb
+++ b/lib/bundler/source/git.rb
@@ -151,15 +151,15 @@ module Bundler
end
def install(spec)
- Bundler.ui.info "Using #{spec.name} (#{spec.version}) from #{to_s}"
+ debug = nil
if requires_checkout? && !@copied
- Bundler.ui.debug " * Checking out revision: #{ref}"
+ debug = " * Checking out revision: #{ref}"
git_proxy.copy_to(install_path, submodules)
serialize_gemspecs_in(install_path)
@copied = true
end
generate_bin(spec)
- nil
+ ["Using #{spec.name} (#{spec.version}) from #{to_s}", nil, debug]
end
def cache(spec)
diff --git a/lib/bundler/source/path.rb b/lib/bundler/source/path.rb
index e0a818b5ab..b95192fb9a 100644
--- a/lib/bundler/source/path.rb
+++ b/lib/bundler/source/path.rb
@@ -70,9 +70,8 @@ module Bundler
end
def install(spec)
- Bundler.ui.info "Using #{spec.name} (#{spec.version}) from #{to_s}"
generate_bin(spec, :disable_extensions)
- nil
+ ["Using #{spec.name} (#{spec.version}) from #{to_s}", nil]
end
def cache(spec)
diff --git a/lib/bundler/source/rubygems.rb b/lib/bundler/source/rubygems.rb
index cbf3b83fbd..b7fdbd2c7b 100644
--- a/lib/bundler/source/rubygems.rb
+++ b/lib/bundler/source/rubygems.rb
@@ -69,11 +69,10 @@ module Bundler
def install(spec)
if installed_specs[spec].any?
- Bundler.ui.info "Using #{spec.name} (#{spec.version})"
- return
+ return ["Using #{spec.name} (#{spec.version})", nil]
end
- Bundler.ui.info "Installing #{spec.name} (#{spec.version})"
+ install_message = "Installing #{spec.name} (#{spec.version})"
path = cached_gem(spec)
if Bundler.requires_sudo?
install_path = Bundler.tmp
@@ -107,7 +106,7 @@ module Bundler
end
installed_spec.loaded_from = "#{Bundler.rubygems.gem_dir}/specifications/#{spec.full_name}.gemspec"
spec.loaded_from = "#{Bundler.rubygems.gem_dir}/specifications/#{spec.full_name}.gemspec"
- spec.post_install_message
+ [install_message, spec.post_install_message]
end
def cache(spec)