Sha256: 9102497cb424bc742ae12719039b80027c4c913aa2295837358fbdb391361ed8

Contents?: true

Size: 686 Bytes

Versions: 10

Compression:

Stored size: 686 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)
      msg = if bold
              set_color(message, :bold)
            else
              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-5.2.3 lib/orats/ui.rb
orats-5.2.2 lib/orats/ui.rb
orats-5.2.1 lib/orats/ui.rb
orats-5.2.0 lib/orats/ui.rb
orats-5.1.2 lib/orats/ui.rb
orats-5.1.1 lib/orats/ui.rb
orats-5.0.3 lib/orats/ui.rb
orats-5.0.2 lib/orats/ui.rb
orats-5.0.1 lib/orats/ui.rb
orats-5.0.0 lib/orats/ui.rb