Module: Notifier::Tmux
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.which?(cmd) ⇒ Boolean
7 8 9 10 |
# File 'lib/git/background/notifier_ext/tmux.rb', line 7 def self.which? cmd dir = ENV['PATH'].split(':').find {|p| File.executable? File.join(p, cmd)} File.join(dir, cmd) unless dir.nil? end |
Instance Method Details
#notify(options) ⇒ Object
16 17 18 |
# File 'lib/git/background/notifier_ext/tmux.rb', line 16 def notify() `tmux display-message '[#{[:title]}] #{[:message]}'` end |
#supported? ⇒ Boolean
12 13 14 |
# File 'lib/git/background/notifier_ext/tmux.rb', line 12 def supported? self.which?('tmux') && ! `tmux ls 2>/dev/null`.empty? end |