Sha256: 8770eac50c1956c83932fae0776a73543cb08b35b65d3c5d931d7719059ccd01

Contents?: true

Size: 606 Bytes

Versions: 1

Compression:

Stored size: 606 Bytes

Contents

# encoding: utf-8

require 'colored'
require 'logger'

module Wordmove
  class Logger < ::Logger
    MAX_LINE = 70

    def task(title)
      prefix = "▬" * 2
      title = " ✓ #{title} "
      padding = "▬" * padding_length

      puts "\n" + prefix + title + padding
    end

    def task_step(local_step, title)
      if local_step
        puts "    local".cyan + " | ".black + title
      else
        puts "   remote".yellow + " | ".black + title
      end
    end

    private

    def padding_length(line)
      result = MAX_LINE - line.length
      result > 0 ? result : 0
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wordmove-1.0.15 lib/wordmove/logger.rb