# This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this file, You can # obtain one at https://mozilla.org/MPL/2.0/. # frozen_string_literal: true require 'term/ansicolor' # Terminal UI helpers for build milestones, debug logging, and operational errors. module UI extend Term::ANSIColor def self.step(message) puts green(message) end def self.debug(message) puts "#{dark(' ->')} #{dark(message)}" if Rake.verbose end def self.fatal(message, hint: nil) output = red(message) output += "\n#{bold(cyan('Hint:'))} #{hint}" if hint abort output end end