Module: Rerun::System
- Included in:
- Runner
- Defined in:
- lib/system.rb
Instance Method Summary collapse
- #app_name ⇒ Object
- #growl(title, body, background = true) ⇒ Object
-
#growl? ⇒ Boolean
do we have growl or not?.
- #growlcmd ⇒ Object
Instance Method Details
#app_name ⇒ Object
34 35 36 37 |
# File 'lib/system.rb', line 34 def app_name # todo: make sure this works in non-Mac and non-Unix environments File.(".").gsub(/^.*\//, '').capitalize end |
#growl(title, body, background = true) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/system.rb', line 39 def growl(title, body, background = true) if growl? s = "#{growlcmd} -n \"#{app_name}\" -m \"#{body}\" \"#{app_name} #{title}\"" s += " &" if background `#{s}` end end |
#growl? ⇒ Boolean
do we have growl or not?
26 27 28 |
# File 'lib/system.rb', line 26 def growl? mac? && (growlcmd != "") end |
#growlcmd ⇒ Object
30 31 32 |
# File 'lib/system.rb', line 30 def growlcmd `which growlnotify`.chomp end |