Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created January 20, 2011 13:26
Show Gist options
  • Save rummelonp/787868 to your computer and use it in GitHub Desktop.
Save rummelonp/787868 to your computer and use it in GitHub Desktop.
Gemfileを保存した時にGrowlで"$ bundle install"しろという注意喚起
(setq growl-program (executable-find "growlnotify"))
(defun growl (title message &optional app)
(when growl-program
(unless app
(setq app ""))
(start-process "Growl" "*Growl*" growl-program
"-t" title
"-m" message
"-a" app)))
(require 'ruby-mode)
(add-to-list 'auto-mode-alist '("\\.rb$" . ruby-mode))
(add-to-list 'auto-mode-alist '("[Rr]akefile$" . ruby-mode))
(add-to-list 'auto-mode-alist '("[Gg]emfile$" . ruby-mode))
(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
(add-hook 'after-save-hook
'(lambda()
(when (string-match "[Gg]emfile$" buffer-file-name)
(growl "File has been modified" "Should be bundle install"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment