Class: Gem::Release::Context::Ui::Tty

Inherits:
Base
  • Object
show all
Includes:
Colors
Defined in:
lib/gem/release/context/ui.rb

Constant Summary

Constants included from Colors

Colors::COLORS

Instance Attribute Summary

Attributes inherited from Base

#opts, #stdout

Instance Method Summary collapse

Methods inherited from Base

#puts

Instance Method Details

#announce(msg, args = [], msgs = []) ⇒ Object


74
75
76
77
# File 'lib/gem/release/context/ui.rb', line 74

def announce(msg, args = [], msgs = [])
  msg = format_msg(msg, args, msgs)
  puts colored(:green, with_spacing(msg, true))
end

#cmd(msg) ⇒ Object


104
105
106
# File 'lib/gem/release/context/ui.rb', line 104

def cmd(msg)
  notice("$ #{msg}")
end

#error(msg, args = [], msgs = []) ⇒ Object


94
95
96
97
# File 'lib/gem/release/context/ui.rb', line 94

def error(msg, args = [], msgs = [])
  msg = format_msg(msg, args, msgs)
  puts colored(:red, with_spacing(msg, true))
end

#info(msg, args = [], msgs = []) ⇒ Object


79
80
81
82
# File 'lib/gem/release/context/ui.rb', line 79

def info(msg, args = [], msgs = [])
  msg = format_msg(msg, args, msgs)
  puts colored(:blue, with_spacing(msg, true))
end

#notice(msg, args = [], msgs = []) ⇒ Object


84
85
86
87
# File 'lib/gem/release/context/ui.rb', line 84

def notice(msg, args = [], msgs = [])
  msg = format_msg(msg, args, msgs)
  puts colored(:gray, with_spacing(msg, false))
end

#success(msg) ⇒ Object


99
100
101
102
# File 'lib/gem/release/context/ui.rb', line 99

def success(msg)
  announce(msg)
  puts
end

#warn(msg, args = [], msgs = []) ⇒ Object


89
90
91
92
# File 'lib/gem/release/context/ui.rb', line 89

def warn(msg, args = [], msgs = [])
  msg = format_msg(msg, args, msgs)
  puts colored(:yellow, with_spacing(msg, false))
end