This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/contrib/!lang/ruby
2015-08-10 08:45:21 -04:00
..
img Split ruby layer into !lang/ruby and !framework/ruby-on-rails 2015-07-03 23:51:34 -04:00
config.el Split ruby layer into !lang/ruby and !framework/ruby-on-rails 2015-07-03 23:51:34 -04:00
packages.el New layer yaml 2015-08-10 08:45:21 -04:00
README.org Setup some ruby tools bindings 2015-08-04 23:15:29 -04:00

Ruby contribution layer for Spacemacs

/TakeV/spacemacs/media/commit/a156e7c48eebc8cba0b9e50e01b598de14767226/contrib/!lang/ruby/img/ruby.png

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

  (setq-default dotspacemacs-configuration-layers '(ruby))

Prerequisites

Some of the advanced features supported by this layer depend on external gems that need to be installed in the context of your project (see below for guidance based on your version manager):

  • pry and pry-doc are required for jump to definition and code documentation (robe-mode)
  • ruby_parser is required for goto-step_definition in feature-mode

You can install the gems in the context of your current project by adding them to the Gemfile, e.g.:

  gem 'pry'

or on the command line (please refer to your ruby version manager specific documentation for details and caveats):

  gem install pry

Ruby version management

This layer supports the use of RVM and Rbenv. To enable it, set the ruby-version-manager var in your ~/.spacemacs:

  (defun dotspacemacs/init ()
    (setq-default ruby-version-manager 'rbenv)
  )

Possible values are rbenv and rvm.

Key bindings

Ruby (enh-ruby-mode, robe, inf-ruby, ruby-tools)

Key binding Description
SPC m g g go to definition (robe-jump)
SPC m h d go to Documentation
SPC m s f send function definition
SPC m s F send function definition and switch to REPL
SPC m s i start REPL
SPC m s r send region
SPC m s R send region and switch to REPL
SPC m s s switch to REPL
SPC m x ' Change symbol or " string to '
SPC m x " Change symbol or ' string to "
SPC m x : Change string to symbol

ruby-test-mode

ruby-test-mode comes bundled with spacemacs, but this contribution adds a couple of useful keybindings:

Key binding Description
SPC m t b run test file
SPC m t t run test at pointer