class Object

Constants

CUSTOMIZATIONS

Public Instance Methods

apply_color(line) click to toggle source
# File lib/stream_prettifier.rb, line 30
def apply_color(line)
    CUSTOMIZATIONS.each do |c|
        line = c.action.call(line) if line.match(c.regex)
    end
    line
end
if_seen(regex, &action) click to toggle source
# File lib/stream_prettifier.rb, line 21
def if_seen(regex, &action)
    CUSTOMIZATIONS << Customization.new(regex, action)
end
load_user_preferences() click to toggle source
# File lib/stream_prettifier.rb, line 25
def load_user_preferences
    user_pref = File.join(Etc.getpwuid.dir, ".stream_prettifier")
    load user_pref if File.exists?(user_pref)
end