Module: Gem::Tasks::Printing
- Included in:
- Task
- Defined in:
- lib/rubygems/tasks/printing.rb
Overview
Provides helper methods for printing messages.
Constant Summary collapse
- ANSI_BRIGHT =
ANSI 'bright' color code
"\e[1m"
- ANSI_CLEAR =
ANSI 'clear' color code
"\e[0m"
- ANSI_GREEN =
ANSI 'green' color code
"\e[32m"
- ANSI_YELLOW =
ANSI 'yellow' color code
"\e[33m"
- ANSI_RED =
ANSI 'red' color code
"\e[31m"
- STATUS_PREFIX =
Prefix for all status messages
if $stdout.tty? "#{ANSI_GREEN}#{ANSI_BRIGHT}>>>#{ANSI_CLEAR}" else ">>>" end
- DEBUG_PREFIX =
Prefix for all debugging messages
if $stderr.tty? "#{ANSI_YELLOW}#{ANSI_BRIGHT}>>>#{ANSI_CLEAR}" else ">>>" end
- ERROR_PREFIX =
Prefix for all error messages
if $stderr.tty? "#{ANSI_RED}#{ANSI_BRIGHT}!!!#{ANSI_CLEAR}" else "!!!" end
Instance Method Summary collapse
-
#debug(message) ⇒ Object
protected
Prints a debugging message.
-
#error(message) ⇒ Object
protected
Prints an error message and exits.
-
#status(message) ⇒ Object
protected
Prints a status message.
Instance Method Details
#debug(message) ⇒ Object (protected)
Prints a debugging message.
66 67 68 69 70 |
# File 'lib/rubygems/tasks/printing.rb', line 66 def debug() if (Rake.verbose && Rake.application..trace) $stderr.puts "#{DEBUG_PREFIX} #{}" end end |
#error(message) ⇒ Object (protected)
Prints an error message and exits.
78 79 80 |
# File 'lib/rubygems/tasks/printing.rb', line 78 def error() $stderr.puts "#{ERROR_PREFIX} #{}" end |
#status(message) ⇒ Object (protected)
Prints a status message.
54 55 56 57 58 |
# File 'lib/rubygems/tasks/printing.rb', line 54 def status() if Rake.verbose $stdout.puts "#{STATUS_PREFIX} #{}" end end |