Sha256: 9813999c9df822b1d065d5ac1d451d3c97cea050a7c1135a5d3fc4cc557bab4b

Contents?: true

Size: 564 Bytes

Versions: 5

Compression:

Stored size: 564 Bytes

Contents

module Wordmove
  class Logger < ::Logger
    MAX_LINE = 70

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

      puts "\n" + prefix + title.green + 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

5 entries across 5 versions & 1 rubygems

Version Path
wordmove-1.4.0.pre4 lib/wordmove/logger.rb
wordmove-1.4.0.pre3 lib/wordmove/logger.rb
wordmove-1.4.0.pre2 lib/wordmove/logger.rb
wordmove-1.4.0.pre lib/wordmove/logger.rb
wordmove-1.3.0 lib/wordmove/logger.rb