2014-12-08 21:04:34 +00:00
|
|
|
(defvar ruby-packages
|
|
|
|
'(
|
|
|
|
;; package rubys go here
|
|
|
|
enh-ruby-mode
|
2014-12-23 03:51:44 +00:00
|
|
|
flycheck
|
2014-12-08 21:04:34 +00:00
|
|
|
ruby-test-mode
|
|
|
|
robe
|
|
|
|
yaml-mode
|
|
|
|
)
|
|
|
|
"List of all packages to install and/or initialize. Built-in packages
|
|
|
|
which require an initialization must be listed explicitly in the list.")
|
|
|
|
|
2015-01-11 16:47:26 +00:00
|
|
|
(when ruby-version-manager
|
|
|
|
(add-to-list 'ruby-packages ruby-version-manager))
|
|
|
|
|
2014-12-08 21:04:34 +00:00
|
|
|
(defvar ruby-excluded-packages '(ruby-mode))
|
|
|
|
|
|
|
|
(defun ruby/init-rbenv ()
|
|
|
|
"Initialize RBENV mode"
|
|
|
|
(use-package rbenv
|
|
|
|
:defer t
|
2014-12-10 05:20:14 +00:00
|
|
|
:init (global-rbenv-mode)
|
2014-12-08 21:04:34 +00:00
|
|
|
:config (add-hook 'enh-ruby-mode-hook
|
2015-01-11 16:47:26 +00:00
|
|
|
(lambda () (rbenv-use-corresponding)))))
|
|
|
|
|
|
|
|
(defun ruby/init-rvm ()
|
|
|
|
"Initialize RVM mode"
|
|
|
|
(use-package rvm
|
|
|
|
:defer t
|
|
|
|
:init (rvm-use-default)
|
|
|
|
:config (add-hook 'enh-ruby-mode-hook
|
|
|
|
(lambda () (rvm-activate-corresponding-ruby)))))
|
2014-12-08 21:04:34 +00:00
|
|
|
|
|
|
|
(defun ruby/init-enh-ruby-mode ()
|
|
|
|
"Initialize Enhanced Ruby Mode"
|
|
|
|
(use-package enh-ruby-mode
|
|
|
|
:defer t
|
|
|
|
:mode (("\\(rake\\|thor\\|guard\\|gem\\|cap\\|vagrant\\)file\\'" . enh-ruby-mode)
|
|
|
|
("\\.\\(rb\\|ru\\|builder\\|rake\\|thor\\|gemspec\\)\\'" . enh-ruby-mode))))
|
|
|
|
|
2014-12-23 03:51:44 +00:00
|
|
|
(defun ruby/init-flycheck ()
|
|
|
|
(add-hook 'enh-ruby-mode-hook 'flycheck-mode))
|
|
|
|
|
2014-12-08 21:04:34 +00:00
|
|
|
(defun ruby/init-robe ()
|
|
|
|
"Initialize Robe mode"
|
|
|
|
(use-package robe
|
|
|
|
:defer t
|
|
|
|
:init (add-hook 'enh-ruby-mode-hook 'robe-mode)
|
|
|
|
:config (progn (evil-leader/set-key-for-mode 'enh-ruby-mode "mg" 'robe-jump)
|
2014-12-22 03:52:57 +00:00
|
|
|
(evil-leader/set-key-for-mode 'enh-ruby-mode "mhd" 'robe-doc)
|
2014-12-08 21:04:34 +00:00
|
|
|
(evil-leader/set-key-for-mode 'enh-ruby-mode "mR" 'robe-rails-refresh)
|
|
|
|
(evil-leader/set-key-for-mode 'enh-ruby-mode "mi" 'robe-start))))
|
|
|
|
|
|
|
|
(defun ruby/init-yaml-mode ()
|
|
|
|
"Initialize YAML mode"
|
|
|
|
(use-package yaml-mode
|
2014-12-10 05:20:14 +00:00
|
|
|
:defer t
|
2014-12-08 21:04:34 +00:00
|
|
|
:config (add-hook 'yaml-mode-hook
|
|
|
|
'(lambda ()
|
|
|
|
(define-key yaml-mode-map "\C-m" 'newline-and-indent)))
|
|
|
|
:mode (("\\.\\(yml\\|yaml\\)\\'" . yaml-mode)
|
|
|
|
("Procfile\\'" . yaml-mode))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun ruby/init-ruby-test-mode ()
|
|
|
|
"Define keybindings for ruby test mode"
|
|
|
|
(use-package ruby-test-mode
|
2014-12-10 05:20:14 +00:00
|
|
|
:defer t
|
2014-12-10 04:40:26 +00:00
|
|
|
:config (progn (evil-leader/set-key "mtb" 'ruby-test-run)
|
|
|
|
(evil-leader/set-key "mtt" 'ruby-test-run-at-point))))
|