class Releasinator::Printer
Public Class Methods
ask(msg)
click to toggle source
# File lib/printer.rb, line 21 def self.ask(msg) puts msg.yellow $stdin.gets.chomp.downcase end
ask_binary(msg)
click to toggle source
# File lib/printer.rb, line 26 def self.ask_binary(msg) answer = self.ask("#{msg} (Y/n)") while answer != "y" && answer != "n" do puts "Please answer y or n".red answer = self.ask("#{msg} (Y/n)") end return answer == "y" end
check_proceed(warning_msg, abort_msg)
click to toggle source
# File lib/printer.rb, line 13 def self.check_proceed(warning_msg, abort_msg) puts "#{warning_msg} Continue? (Y/n)".yellow if 'n' == $stdin.gets.strip self.fail(abort_msg) abort() end end
comment(msg)
click to toggle source
# File lib/printer.rb, line 37 def self.comment(msg) puts msg.yellow end
fail(msg)
click to toggle source
# File lib/printer.rb, line 9 def self.fail(msg) puts "\xE2\x9C\x98 FAILURE: #{msg}".red end
success(msg)
click to toggle source
# File lib/printer.rb, line 5 def self.success(msg) puts "\xE2\x9C\x94\xEF\xB8\x8E ".light_green + "SUCCESS: #{msg}".green end