Sha256: 9d2da785bba64becce0068d16293036abd711a7d3c101c343134625678490a55
Contents?: true
Size: 512 Bytes
Versions: 7
Compression:
Stored size: 512 Bytes
Contents
# Notifies via $HOME/bin/notify_redgreen (with notify-send) module RiotNotifier class RedgreenBinary < Base attr_reader :path PATH = ENV['HOME'] + "/bin/notify_redgreen" def initialize(path = PATH) super() @path = path end def notify(color, msg) msg.gsub!(/</, '<') msg.gsub!(/"/, "\\\"") exec "#{@path} #{color} \"#{msg}\"" end def exec(*args) Kernel.system(*args) end def self.usable? File.exist?(PATH) end end end
Version data entries
7 entries across 7 versions & 1 rubygems