module PhilColumns::Output
Public Class Methods
included( base )
click to toggle source
# File lib/phil_columns/output.rb, line 4 def self.included( base ) base.send( :include, Thor::Shell ) end
Public Instance Methods
confirm( msg, color=:white, &block )
click to toggle source
# File lib/phil_columns/output.rb, line 28 def confirm( msg, color=:white, &block ) write msg, color block.call say_ok rescue say_error raise end
say( msg, color=:white )
click to toggle source
# File lib/phil_columns/output.rb, line 12 def say( msg, color=:white ) $stdout.puts( Rainbow( msg ).color( color )) end
say_error()
click to toggle source
# File lib/phil_columns/output.rb, line 20 def say_error say 'ERROR', :red end
say_ok()
click to toggle source
# File lib/phil_columns/output.rb, line 16 def say_ok say 'OK', :green end
say_skipping()
click to toggle source
# File lib/phil_columns/output.rb, line 24 def say_skipping say 'SKIPPING', :yellow end
write( msg, color=:white )
click to toggle source
# File lib/phil_columns/output.rb, line 8 def write( msg, color=:white ) $stdout.write( Rainbow( msg ).color( color )) end