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.
68 69 70 71 72 |
# File 'lib/rubygems/tasks/printing.rb', line 68 def debug() if (Rake.verbose && Rake.application..trace) $stderr.puts "#{DEBUG_PREFIX} #{message}" end end |
#error(message) ⇒ Object (protected)
Prints an error message and exits.
80 81 82 |
# File 'lib/rubygems/tasks/printing.rb', line 80 def error() $stderr.puts "#{ERROR_PREFIX} #{message}" end |
#status(message) ⇒ Object (protected)
Prints a status message.
56 57 58 59 60 |
# File 'lib/rubygems/tasks/printing.rb', line 56 def status() if Rake.verbose $stdout.puts "#{STATUS_PREFIX} #{message}" end end |