Module: Rerun::System

Included in:
Runner
Defined in:
lib/system.rb

Instance Method Summary collapse

Instance Method Details

#app_nameObject



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.expand_path(".").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?

Returns:

  • (Boolean)


26
27
28
# File 'lib/system.rb', line 26

def growl?
  mac? && (growlcmd != "")
end

#growlcmdObject



30
31
32
# File 'lib/system.rb', line 30

def growlcmd
  `which growlnotify`.chomp
end