Add `rake` package to the ruby layer

This commit is contained in:
Adam Sokolnicki 2016-02-29 20:24:52 +01:00 committed by Eivind Fonn
parent be2c471397
commit c2ec8e57c9
2 changed files with 24 additions and 0 deletions

View File

@ -16,12 +16,14 @@
- [[Tests][Tests]]
- [[RSpec-mode][RSpec-mode]]
- [[Ruby-test-mode][Ruby-test-mode]]
- [[Rake][Rake]]
* Description
This layer provides support for the Ruby language with the following feature:
- version manager (rbenv, rvm or chruby)
- integration with bundler
- test runner (ruby-test and rspec)
- rake runner
- linter (rubocop)
- interactive REPL and code navigation (robe)
@ -162,3 +164,11 @@ When =ruby-test-runner= equals =ruby-test=.
|-------------+---------------------|
| ~SPC m t b~ | run test file |
| ~SPC m t t~ | run test at pointer |
** Rake
| Key binding | Description |
|-------------+---------------------------------|
| ~SPC m k k~ | Runs rake |
| ~SPC m k r~ | Re-runs the last rake task |
| ~SPC m k R~ | Regenerates the rake cache |
| ~SPC m k f~ | Finds definition of a rake task |

View File

@ -25,6 +25,7 @@
ruby-tools
rvm
smartparens
rake
))
(if ruby-enable-enh-ruby-mode
(add-to-list 'ruby-packages 'enh-ruby-mode)
@ -257,3 +258,16 @@
:post-handlers '(sp-ruby-post-handler
(spacemacs/smartparens-pair-newline-and-indent "RET"))
:suffix ""))))
(defun ruby/init-rake ()
(use-package rake
:defer t
:config
(progn
(setq rake-cache-file (concat spacemacs-cache-directory "rake.cache"))
(dolist (mode '(ruby-mode enh-ruby-mode))
(spacemacs/set-leader-keys-for-major-mode mode
"kk" 'rake
"kr" 'rake-rerun
"kR" 'rake-regenerate-cache
"kf" 'rake-find-task)))))