module Rerun::System

Public Instance Methods

growl(title, body, background = true) click to toggle source
# 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?() click to toggle source

do we have growl or not?

# File lib/rerun/system.rb, line 17
def growl_available?
  mac? && (growlcmd != "")
end
growlcmd() click to toggle source
# 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() click to toggle source
# File lib/rerun/system.rb, line 27
def icon
  here = File.expand_path(File.dirname(__FILE__))
  icondir = File.expand_path("#{here}/../../icons")
  rails_sig_file = File.expand_path(".")+"/config/boot.rb"
  "#{icondir}/rails_red_sml.png" if File.exists? rails_sig_file
end
linux?() click to toggle source
# File lib/rerun/system.rb, line 12
def linux?
   RUBY_PLATFORM =~ /linux/i
end
mac?() click to toggle source
# File lib/rerun/system.rb, line 4
def mac?
  RUBY_PLATFORM =~ /darwin/i
end
windows?() click to toggle source
# File lib/rerun/system.rb, line 8
def windows?
   RUBY_PLATFORM =~ /mswin/i
end