Sha256: 203d8ce34b4355ea614f1e959f54f842eb4d9337fa7af625891ac9cfbaf35b5f

Contents?: true

Size: 668 Bytes

Versions: 10

Compression:

Stored size: 668 Bytes

Contents

module Orats
  # print out various messages to the terminal
  module UI
    include Thor::Shell

    def task(message, color = :blue)
      puts
      log 'task', message, color, true
    end

    def results(results, tag, message)
      puts
      log 'results', results, :magenta, true
      log tag, message, :white
    end

    def error(error, message)
      puts
      log 'error', error, :red, :bold
      log 'from', message, :yellow
    end

    def log(tag, message, ansi_color, bold = false)
      if bold
        msg = set_color(message, :bold)
      else
        msg = set_color(message)
      end

      say_status tag, msg, ansi_color
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
orats-0.9.7 lib/orats/ui.rb
orats-0.9.6 lib/orats/ui.rb
orats-0.9.5 lib/orats/ui.rb
orats-0.9.4 lib/orats/ui.rb
orats-0.9.3 lib/orats/ui.rb
orats-0.9.2 lib/orats/ui.rb
orats-0.9.1 lib/orats/ui.rb
orats-0.9.0 lib/orats/ui.rb
orats-0.8.1 lib/orats/ui.rb
orats-0.8.0 lib/orats/ui.rb