Module: Wlog::TextFilters
- Included in:
- LogEntry
- Defined in:
- lib/wlog/tech/text_filters.rb
Overview
Instance Method Summary collapse
-
#highlight_hyperlink_s(string) ⇒ Object
Use strmakers in order to color hyperlinks.
Instance Method Details
#highlight_hyperlink_s(string) ⇒ Object
Use strmakers in order to color hyperlinks. This will look for a regex pattern of a http(s) link, and color it.
10 11 12 13 14 15 16 17 |
# File 'lib/wlog/tech/text_filters.rb', line 10 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 |