Sha256: 246541501b1b3b933c91e2847cf911828fc1b60edfb6e4cb393af37ad7558034
Contents?: true
Size: 614 Bytes
Versions: 1
Compression:
Stored size: 614 Bytes
Contents
require 'wlog/domain/sys_config' module Wlog # Group text filters here, for any text processing you want to do # @author Simon Symeonidis module TextFilters # Use strmakers in order to color hyperlinks. This will look for a regex # pattern of a http(s) link, and color it. # @param string is the string we want to look into and color # @return the string with ansi colored links if ansi is set. def highlight_hyperlink_s(string) @strmaker = SysConfig.string_decorator regex = /http(s)?:\S*|www.\S*/ s = string.dup tmp = nil s.gsub!(regex) { @strmaker.blue($&) } s end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
wlog-1.2.2 | lib/wlog/tech/text_filters.rb |