Sha256: c9face1f20ca6d74b9b5d3584cca1724090e12daf55c3098f481555048efb620

Contents?: true

Size: 378 Bytes

Versions: 13

Compression:

Stored size: 378 Bytes

Contents

# frozen_string_literal: true

module Massa
  class CLI
    class << self
      def colorize(*args)
        print "\n"
        args.each_slice(2) { |color, string| print "\e[#{code(color)}m#{string}\e[0m" }
        print "\n"
      end

      def code(color)
        { red: 31, green: 32, yellow: 33, blue: 34, pink: 35, light_blue: 36 }[color] || 0
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
massa-0.6.0 lib/massa/cli.rb
massa-0.5.0 lib/massa/cli.rb
massa-0.4.0 lib/massa/cli.rb
massa-0.3.2 lib/massa/cli.rb
massa-0.3.1 lib/massa/cli.rb
massa-0.3.0 lib/massa/cli.rb
massa-0.2.1 lib/massa/cli.rb
massa-0.2.0 lib/massa/cli.rb
massa-0.2.0.rc2 lib/massa/cli.rb
massa-0.2.0.rc1 lib/massa/cli.rb
massa-0.1.5 lib/massa/cli.rb
massa-0.1.4 lib/massa/cli.rb
massa-0.1.3 lib/massa/cli.rb