module RGitFlow::Printing
Contains logic for printing messages to the console. Supports ANSI colors. Inspired by rubygems-tasks’ printing.rb
Constants
- DEBUG_PREFIX
String to prepend to any debug messages @return [String] prefix for debug messages
- ERROR_PREFIX
String to prepend to any error messages @return [String] prefix for error messages
- INPUT_PREFIX
- STATUS_PREFIX
String to prepend to any status messages @return [String] prefix for status messages
Protected Instance Methods
Prints a debug message to the console @param [String] message message to print to the console @return [void]
# File lib/rgitflow/printing.rb, line 52 def debug(message = '') if Rake.verbose STDERR.puts "#{DEBUG_PREFIX} #{message}" end nil end
Prints an error message to the console @param [String] message message to print to the console @return [void]
# File lib/rgitflow/printing.rb, line 62 def error(message = '') STDERR.puts "#{ERROR_PREFIX} #{message}" nil end
Prints a prompt message to the console @param [String] message message to print to the console @return [void]
# File lib/rgitflow/printing.rb, line 70 def prompt(message = '') status message STDOUT.print "#{INPUT_PREFIX} " nil end
Prints a status message to the console @param [String] message message to print to the console @return [void]
# File lib/rgitflow/printing.rb, line 42 def status(message = '') if Rake.verbose STDOUT.puts "#{STATUS_PREFIX} #{message}" end nil end