summaryrefslogtreecommitdiff
path: root/lib/bundler/inline.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-01-27 14:01:11 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-01-27 14:01:11 -0800
commitce84bf9ef456b965c4af9c052fc828e089e6cde1 (patch)
treebef1b3af49111badc9fb9f8cf145e3fc1ac4ef93 /lib/bundler/inline.rb
parent033fc4eda64916b02956fafa627faf68f2aa3a37 (diff)
downloadbundler-ce84bf9ef456b965c4af9c052fc828e089e6cde1.tar.gz
Allow passing UI object into bundler/inline
Added an argument to the gemfile method to allow overriding the UI object. Useful to override the default output format and send those log events to a logfile or decorate them (timestamps, severity, etc) before emitting them.
Diffstat (limited to 'lib/bundler/inline.rb')
-rw-r--r--lib/bundler/inline.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb
index 9df19b02ad..4de025a5a4 100644
--- a/lib/bundler/inline.rb
+++ b/lib/bundler/inline.rb
@@ -27,7 +27,7 @@
#
# puts Pod::VERSION # => "0.34.4"
#
-def gemfile(install = false, &gemfile)
+def gemfile(install = false, ui = nil, &gemfile)
require "bundler"
old_root = Bundler.method(:root)
def Bundler.root
@@ -43,7 +43,7 @@ def gemfile(install = false, &gemfile)
definition.validate_ruby!
if install
- Bundler.ui = Bundler::UI::Shell.new
+ Bundler.ui = ui || Bundler::UI::Shell.new
Bundler::Installer.install(Bundler.root, definition, :system => true)
Bundler::Installer.post_install_messages.each do |name, message|
Bundler.ui.info "Post-install message from #{name}:\n#{message}"