Created
January 20, 2011 13:26
-
-
Save rummelonp/787868 to your computer and use it in GitHub Desktop.
Gemfileを保存した時にGrowlで"$ bundle install"しろという注意喚起
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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