Class: Bundler::UI::Shell
- Inherits:
-
Bundler::UI
- Object
- Bundler::UI
- Bundler::UI::Shell
- Defined in:
- lib/bundler/ui.rb
Instance Attribute Summary (collapse)
-
- (Object) shell
writeonly
Sets the attribute shell.
Instance Method Summary (collapse)
- - (Object) be_quiet!
- - (Object) confirm(msg)
- - (Object) debug(msg)
- - (Object) debug!
- - (Object) error(msg)
- - (Object) info(msg)
-
- (Shell) initialize(shell)
constructor
A new instance of Shell.
- - (Object) warn(msg)
Constructor Details
- (Shell) initialize(shell)
A new instance of Shell
23 24 25 26 27 |
# File 'lib/bundler/ui.rb', line 23 def initialize(shell) @shell = shell @quiet = false @debug = ENV['DEBUG'] end |
Instance Attribute Details
- (Object) shell=(value) (writeonly)
Sets the attribute shell
21 22 23 |
# File 'lib/bundler/ui.rb', line 21 def shell=(value) @shell = value end |
Instance Method Details
- (Object) be_quiet!
49 50 51 |
# File 'lib/bundler/ui.rb', line 49 def be_quiet! @quiet = true end |
- (Object) confirm(msg)
37 38 39 |
# File 'lib/bundler/ui.rb', line 37 def confirm(msg) @shell.say(msg, :green) if !@quiet end |
- (Object) debug(msg)
29 30 31 |
# File 'lib/bundler/ui.rb', line 29 def debug(msg) @shell.say(msg) if @debug && !@quiet end |
- (Object) debug!
53 54 55 |
# File 'lib/bundler/ui.rb', line 53 def debug! @debug = true end |
- (Object) error(msg)
45 46 47 |
# File 'lib/bundler/ui.rb', line 45 def error(msg) @shell.say(msg, :red) end |
- (Object) info(msg)
33 34 35 |
# File 'lib/bundler/ui.rb', line 33 def info(msg) @shell.say(msg) if !@quiet end |
- (Object) warn(msg)
41 42 43 |
# File 'lib/bundler/ui.rb', line 41 def warn(msg) @shell.say(msg, :yellow) end |