Class: Bundler::UI::Shell

Inherits:
Bundler::UI show all
Defined in:
lib/bundler/ui.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

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

Parameters:

  • value

    the value to set the attribute shell to.



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