Sha256: 2291e781abdd116e9d1d45cba9fdadddd1d72f8386e99453f1bb987d767f01f9

Contents?: true

Size: 490 Bytes

Versions: 39

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

module Karafka
  module Helpers
    # Simple wrapper for adding colors to strings
    module Colorize
      # @param string [String] string we want to have in green
      # @return [String] green string
      def green(string)
        "\033[0;32m#{string}\033[0m"
      end

      # @param string [String] string we want to have in red
      # @return [String] red string
      def red(string)
        "\033[0;31m#{string}\033[0m"
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
karafka-2.0.34 lib/karafka/helpers/colorize.rb
karafka-2.0.33 lib/karafka/helpers/colorize.rb
karafka-2.0.32 lib/karafka/helpers/colorize.rb
karafka-2.0.31 lib/karafka/helpers/colorize.rb
karafka-2.0.30 lib/karafka/helpers/colorize.rb
karafka-2.0.29 lib/karafka/helpers/colorize.rb
karafka-2.0.28 lib/karafka/helpers/colorize.rb
karafka-2.0.27 lib/karafka/helpers/colorize.rb
karafka-2.0.26 lib/karafka/helpers/colorize.rb
karafka-2.0.24 lib/karafka/helpers/colorize.rb
karafka-2.0.23 lib/karafka/helpers/colorize.rb
karafka-2.0.22 lib/karafka/helpers/colorize.rb
karafka-2.0.21 lib/karafka/helpers/colorize.rb
karafka-2.0.20 lib/karafka/helpers/colorize.rb
karafka-2.0.19 lib/karafka/helpers/colorize.rb
karafka-2.0.18 lib/karafka/helpers/colorize.rb
karafka-2.0.17 lib/karafka/helpers/colorize.rb
karafka-2.0.16 lib/karafka/helpers/colorize.rb
karafka-2.0.15 lib/karafka/helpers/colorize.rb
karafka-2.0.14 lib/karafka/helpers/colorize.rb