PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/rejeep-ruby.el

http://github.com/rejeep/emacs
Lisp | 38 lines | 27 code | 10 blank | 1 comment | 1 complexity | 6d19b24854e931169ad7dbce0ec2667e MD5 | raw file
 1;;; rejeep-ruby.el --- Ruby specific settings
 2
 3(setenv "JRUBY_OPTS" "--1.9")
 4(setenv "JAVA_OPTS" "-d32")
 5
 6(require 'rvm)
 7(require 'ruby-end)
 8(require 'ruby-tools)
 9(require 'ruby-block)
10(require 'rspec-mode)
11
12(defadvice rspec-compile (around rspec-compile-around)
13  "Use BASH shell for running the specs because of ZSH issues."
14  (let ((shell-file-name "/bin/bash"))
15    ad-do-it))
16(ad-activate 'rspec-compile)
17
18(setq rspec-use-rvm t)
19(setq rspec-use-rake-flag nil)
20
21(add-hook 'ruby-mode-hook 'rspec-mode)
22(add-hook 'ruby-mode-hook 'flymake-ruby-load)
23(add-hook 'ruby-mode-hook 'rvm-activate-corresponding-ruby)
24(add-hook 'ruby-mode-hook
25          (lambda()
26            (setq ruby-deep-indent-paren nil)
27            (setq ruby-end-check-statement-modifiers t)
28
29            (define-key ruby-mode-map (kbd "C-M-h") nil)
30
31            (define-key ruby-mode-map (kbd "C-M-n") 'scroll-up-five)
32            (define-key ruby-mode-map (kbd "C-M-p") 'scroll-down-five)))
33
34
35(dolist (regex '("\\.rake$" "\\.gemspec$" "\\.ru$" "Rakefile$" "Gemfile$" "Capfile$"))
36  (add-to-list 'auto-mode-alist `(,regex . ruby-mode)))
37
38(provide 'rejeep-ruby)