Sha256: 26abcd17b017d1a1c03f14b92243eaa792d230d6c74f804836d52b0366c87d4d

Contents?: true

Size: 418 Bytes

Versions: 24

Compression:

Stored size: 418 Bytes

Contents

# frozen_string_literal: true

module StimulusReflex
  module Utils
    module Colorize
      COLORS = {
        red: "31",
        green: "32",
        yellow: "33",
        blue: "34",
        magenta: "35",
        cyan: "36",
        white: "37"
      }

      refine String do
        COLORS.each do |name, code|
          define_method(name) { "\e[#{code}m#{self}\e[0m" }
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
stimulus_reflex-3.5.0.rc4 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.4.2 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.rc3 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.rc2 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.rc1 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre10 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre9 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre8 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre7 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre6 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre5 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre4 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre3 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre2 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre1 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.5.0.pre0 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.4.1 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.4.0 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.4.0.pre9 lib/stimulus_reflex/utils/colorize.rb
stimulus_reflex-3.4.0.pre8 lib/stimulus_reflex/utils/colorize.rb