Sha256: 06a70bce6313d6c1ed47258348a38c3f6d6d40d5c4e7525c101417dd27744a1b

Contents?: true

Size: 241 Bytes

Versions: 11

Compression:

Stored size: 241 Bytes

Contents

class String
  def colorize(pattern)
    self.split(/(#{pattern})/).map{|term|
      if term =~ /#{pattern}/
        term = Rainbow(term).color(Tw::App::Render.color_code term).bright.underline
      end
      term
    }.join('')
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tw-1.3.1 lib/tw/app/helper.rb
tw-1.3.0 lib/tw/app/helper.rb
tw-1.2.1 lib/tw/app/helper.rb
tw-1.2.0 lib/tw/app/helper.rb
tw-1.1.1 lib/tw/app/helper.rb
tw-1.1.0 lib/tw/app/helper.rb
tw-1.0.12 lib/tw/app/helper.rb
tw-1.0.11 lib/tw/app/helper.rb
tw-1.0.10 lib/tw/app/helper.rb
tw-1.0.9 lib/tw/app/helper.rb
tw-1.0.8 lib/tw/app/helper.rb