2014-12-08 21:04:34 +00:00
|
|
|
# Ruby contribution layer for Spacemacs
|
|
|
|
|
2014-12-24 06:03:49 +00:00
|
|
|
![logo](img/ruby.gif)
|
2014-12-10 04:39:09 +00:00
|
|
|
|
|
|
|
<!-- markdown-toc start - Don't edit this section. Run M-x markdown-toc/generate-toc again -->
|
|
|
|
**Table of Contents**
|
|
|
|
|
|
|
|
- [Ruby contribution layer for Spacemacs](#ruby-contribution-layer-for-spacemacs)
|
|
|
|
- [Description](#description)
|
|
|
|
- [Install](#install)
|
2015-01-12 04:13:16 +00:00
|
|
|
- [Ruby version manager](#ruby-version-manager)
|
2014-12-10 04:39:09 +00:00
|
|
|
- [Key bindings](#key-bindings)
|
|
|
|
- [enh-ruby-mode](#enh-ruby-mode)
|
|
|
|
- [ruby-test-mode](#ruby-test-mode)
|
|
|
|
|
|
|
|
<!-- markdown-toc end -->
|
|
|
|
|
2014-12-08 21:04:34 +00:00
|
|
|
## Description
|
|
|
|
|
|
|
|
This layer aims at providing support for the Ruby language using
|
|
|
|
[enh-ruby-mode][] and [robe-mode][].
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
|
|
|
To use this contribution add it to your `~/.spacemacs`
|
|
|
|
|
|
|
|
```elisp
|
2014-12-10 04:50:48 +00:00
|
|
|
(setq-default dotspacemacs-configuration-layers '(ruby)
|
2014-12-08 21:04:34 +00:00
|
|
|
"List of contribution to load."
|
|
|
|
)
|
|
|
|
```
|
|
|
|
|
|
|
|
In order to take advantage of `robe-mode` you will probably need to
|
|
|
|
install the `pry` gem.
|
|
|
|
You can do that via your Gemfile:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
gem 'pry'
|
|
|
|
```
|
|
|
|
|
|
|
|
or on the command line:
|
|
|
|
|
|
|
|
```shell
|
|
|
|
$ gem install pry
|
|
|
|
```
|
|
|
|
|
2015-01-12 04:13:16 +00:00
|
|
|
### Ruby version manager
|
2015-01-11 16:47:26 +00:00
|
|
|
|
|
|
|
This layer supports the use of [RVM][] and [Rbenv][].
|
|
|
|
To enable it, set the `ruby-version-manager` var in your `~/.spacemacs`:
|
|
|
|
|
|
|
|
```elisp
|
|
|
|
(defun dotspacemacs/init ()
|
|
|
|
(setq-default ruby-version-manager 'rbenv)
|
|
|
|
)
|
|
|
|
```
|
|
|
|
|
2015-01-12 04:13:16 +00:00
|
|
|
Possible values are `rbenv` and `rvm`.
|
|
|
|
|
2014-12-08 21:04:34 +00:00
|
|
|
## Key bindings
|
|
|
|
|
|
|
|
### enh-ruby-mode
|
|
|
|
|
|
|
|
<kbd>SPC m i</kbd> start REPL
|
|
|
|
<kbd>SPC m g</kbd> go to definition (robe-jump)
|
|
|
|
<kbd>SPC m d</kbd> go to Documentation
|
|
|
|
<kbd>SPC m R</kbd> reload environment (Rails)
|
|
|
|
|
|
|
|
### ruby-test-mode
|
|
|
|
|
|
|
|
ruby-test-mode comes bundled with spacemacs, but this contribution adds
|
|
|
|
a couple of useful keybindings:
|
|
|
|
|
2014-12-10 04:39:09 +00:00
|
|
|
<kbd>SPC m t b</kbd> run test file
|
|
|
|
<kbd>SPC m t t</kbd> run test at pointer
|
2014-12-08 21:04:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
[enh-ruby-mode]: https://github.com/zenspider/enhanced-ruby-mode
|
|
|
|
[robe-mode]: https://github.com/dgutov/robe
|
2015-01-11 16:47:26 +00:00
|
|
|
[Rbenv]: https://github.com/sstephenson/rbenv
|
|
|
|
[RVM]: https://rvm.io/
|