Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Show Rails growl icon when launching from a rails app folder. Use -H …

…localhost option.

Growl Icons - rails_red_sml.png, rails_red_grn.png. This is a quick hack.
-H localhost switch - see Autotest::Growl::remote_notification for an explanation.
  • Loading branch information...
commit f04a1467b5f41e1ae8cf7ce712868b3c3d7f2bfa 1 parent fc02dde
@dreamcat4 dreamcat4 authored
View
BIN  icons/rails_grn_sml.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  icons/rails_red_sml.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
13 lib/system.rb
@@ -36,9 +36,20 @@ def app_name
File.expand_path(".").gsub(/^.*\//, '').capitalize
end
+ def icon
+ libdir = "#{File.expand_path(File.dirname(File.dirname(__FILE__)))}/lib"
+ $LOAD_PATH.unshift libdir unless $LOAD_PATH.include?(libdir)
+
+ rails_sig_file = File.expand_path(".")+"/config/boot.rb"
+ puts rails_sig_file
+ return "#{libdir}/../icons/rails_red_sml.png" if File.exists? rails_sig_file
+ return nil
+ end
+
def growl(title, body, background = true)
if growl?
- s = "#{growlcmd} -n \"#{app_name}\" -m \"#{body}\" \"#{app_name} #{title}\""
+ icon ? icon_str = "--image \"#{icon}\"" : icon_str = ""
+ s = "#{growlcmd} -H localhost -n \"#{app_name}\" -m \"#{body}\" \"#{app_name} #{title}\" #{icon_str}"
s += " &" if background
`#{s}`
end
View
2  rerun.gemspec
@@ -3,7 +3,7 @@ $spec = Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.name = 'rerun'
- s.version = '0.3'
+ s.version = '0.3.1'
s.date = '2009-06-16'
s.description = "Restarts your app when a file changes"
Please sign in to comment.
Something went wrong with that request. Please try again.