Class: CodeKindly::Utils::OS

Inherits:
Object
  • Object
show all
Defined in:
lib/code_kindly/utils/o_s.rb

Class Method Summary collapse

Class Method Details

.notify(message) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/code_kindly/utils/o_s.rb', line 5

def notify (message)
  require "open3"
  stdin, stdout, stderr = Open3.popen3("which terminal-notifier")
  tn_path = stdout.gets
  if tn_path.present?
    Kernel.system("#{tn_path.chomp} -message \"#{message}\" -sound Submarine")
  end
end