Module: Rerun::System
- Included in:
- Runner
- Defined in:
- lib/rerun/system.rb
Instance Method Summary collapse
- #growl(title, body, background = true) ⇒ Object
-
#growl_available? ⇒ Boolean
do we have growl or not?.
- #growlcmd ⇒ Object
- #icon ⇒ Object
- #linux? ⇒ Boolean
- #mac? ⇒ Boolean
- #windows? ⇒ Boolean
Instance Method Details
#growl(title, body, background = true) ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/rerun/system.rb', line 34 def growl(title, body, background = true) if growl_available? icon_str = ("--image \"#{icon}\"" if icon) s = "#{growlcmd} -n \"#{app_name}\" -m \"#{body}\" \"#{app_name} #{title}\" #{icon_str}" s += " &" if background `#{s}` end end |
#growl_available? ⇒ Boolean
do we have growl or not?
17 18 19 |
# File 'lib/rerun/system.rb', line 17 def growl_available? mac? && (growlcmd != "") end |
#growlcmd ⇒ Object
21 22 23 24 25 |
# File 'lib/rerun/system.rb', line 21 def growlcmd growlnotify = `which growlnotify`.chomp # todo: check version of growlnotify and warn if it's too old growlnotify end |
#icon ⇒ Object
27 28 29 30 31 32 |
# File 'lib/rerun/system.rb', line 27 def icon here = File.(File.dirname(__FILE__)) icondir = File.("#{here}/../../icons") rails_sig_file = File.(".")+"/config/boot.rb" "#{icondir}/rails_red_sml.png" if File.exists? rails_sig_file end |
#linux? ⇒ Boolean
12 13 14 |
# File 'lib/rerun/system.rb', line 12 def linux? RUBY_PLATFORM =~ /linux/i end |
#mac? ⇒ Boolean
4 5 6 |
# File 'lib/rerun/system.rb', line 4 def mac? RUBY_PLATFORM =~ /darwin/i end |
#windows? ⇒ Boolean
8 9 10 |
# File 'lib/rerun/system.rb', line 8 def windows? RUBY_PLATFORM =~ /mswin/i end |