Class: Chef::Cookbook::GemInstaller::ChefBundlerUI
- Inherits:
-
Bundler::UI::Silent
- Object
- Bundler::UI::Silent
- Chef::Cookbook::GemInstaller::ChefBundlerUI
- Defined in:
- lib/chef/cookbook/gem_installer.rb
Overview
Bundler::UI object so that we can intercept and log the output of the in-memory bundle install that we are going to do.
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
Instance Method Summary collapse
- #confirm(msg, newline = nil) ⇒ Object
- #debug(msg, newline = nil) ⇒ Object
- #error(msg, newline = nil) ⇒ Object
- #info(msg, newline = nil) ⇒ Object
-
#initialize(events) ⇒ ChefBundlerUI
constructor
A new instance of ChefBundlerUI.
- #warn(msg, newline = nil) ⇒ Object
Constructor Details
#initialize(events) ⇒ ChefBundlerUI
Returns a new instance of ChefBundlerUI.
69 70 71 72 |
# File 'lib/chef/cookbook/gem_installer.rb', line 69 def initialize(events) @events = events super() end |
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events.
67 68 69 |
# File 'lib/chef/cookbook/gem_installer.rb', line 67 def events @events end |
Instance Method Details
#confirm(msg, newline = nil) ⇒ Object
74 75 76 77 78 79 80 |
# File 'lib/chef/cookbook/gem_installer.rb', line 74 def confirm(msg, newline = nil) # looks like "Installing time_ago_in_words 0.1.1" when installing if msg =~ /Installing\s+(\S+)\s+(\S+)/ events.cookbook_gem_installing($1, $2) end Chef::Log.info(msg) end |
#debug(msg, newline = nil) ⇒ Object
86 87 88 |
# File 'lib/chef/cookbook/gem_installer.rb', line 86 def debug(msg, newline = nil) Chef::Log.debug(msg) end |
#error(msg, newline = nil) ⇒ Object
82 83 84 |
# File 'lib/chef/cookbook/gem_installer.rb', line 82 def error(msg, newline = nil) Chef::Log.error(msg) end |
#info(msg, newline = nil) ⇒ Object
90 91 92 93 94 95 96 |
# File 'lib/chef/cookbook/gem_installer.rb', line 90 def info(msg, newline = nil) # looks like "Using time_ago_in_words 0.1.1" when using, plus other misc output if msg =~ /Using\s+(\S+)\s+(\S+)/ events.cookbook_gem_using($1, $2) end Chef::Log.info(msg) end |