lang/ruby: add +chruby (#2667)

Co-authored-by: Henrik Lissner <accounts@v0.io>
This commit is contained in:
Otávio Schwanck dos Santos 2020-03-09 18:04:10 +00:00 committed by GitHub
parent 503c6d878e
commit 992f4b76f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 5 deletions

View File

@ -131,7 +131,7 @@ Modules that bring support for a language or group of languages to Emacs.
+ qt - TODO
+ racket - TODO
+ [[file:../modules/lang/rest/README.org][rest]] - TODO
+ [[file:../modules/lang/ruby/README.org][ruby]] =+lsp +rvm +rbenv +rails=
+ [[file:../modules/lang/ruby/README.org][ruby]] =+lsp +rvm +rbenv +rails +chruby=
+ [[file:../modules/lang/rust/README.org][rust]] =+lsp= - TODO
+ scala =+lsp= - TODO
+ [[file:../modules/lang/scheme/README.org][scheme]] - TODO

View File

@ -5,7 +5,7 @@
* Table of contents :TOC:
- [[#description][Description]]
- [[#module-flags][Module Flags...]]
- [[#module-flags][Module Flags]]
- [[#packages][Packages]]
- [[#prerequisites][Prerequisites]]
- [[#ubuntu][Ubuntu]]
@ -23,12 +23,13 @@ This module add Ruby and optional Ruby on Rails support to Emacs.
+ Bundler
+ Rubocop integration (flycheck)
** Module Flags...
** Module Flags
+ =+lsp= Enables LangServer support for ruby. You must have =:tools lsp= enabled
for this to work, as well as the langserver (solargraph) installed on your
system.
+ =+rvm= Enables RVM (Ruby Version Manager) integration.
+ =+rbenv= Eanbles rbenv integration.
+ =+rbenv= Enables rbenv integration.
+ =+chruby= Enables chruby integration.
+ =+rails= Enables rails navigational commands, plus server+console integration.
** Packages
@ -45,6 +46,7 @@ This module add Ruby and optional Ruby on Rails support to Emacs.
+ [[https://github.com/arthurnn/minitest-emacs][minitest]]
+ [[https://github.com/asok/projectile-rails][projectile-rails]]
+ [[https://github.com/eschulte/jump.el/tree/e4f1372cf22e811faca52fc86bdd5d817498a4d8][inflections]]
+ [[https://github.com/plexus/chruby.el][chruby]]
* Prerequisites
Many of this modules plugins require ruby with some version manager (RVM or
@ -62,7 +64,7 @@ You can follow [[https://gorails.com/setup/windows/10][this guide]]. After ruby
*** robe
| command | key / ex command | description |
|----------------------+------------------+--------------------------------------------------------------------|
| ~robe-start~ | =SPC m '= | Open ruby lang server for auto-completions and jump to definitions |
| ~robe-start~ | =SPC m \'= | Open ruby lang server for auto-completions and jump to definitions |
| ~robe-rails-refresh~ | =SPC m R= | Refresh the lang server. |
*** projectile-rails

View File

@ -119,6 +119,14 @@
"e" #'bundle-exec
"o" #'bundle-open))
(use-package! chruby
:when (featurep! +chruby)
:hook (enh-ruby-mode . chruby-use-corresponding)
:hook (ruby-mode . chruby-use-corresponding)
:config
(setq rspec-use-rvm nil
rspec-use-chruby t))
(after! rbenv
(setq rspec-use-rvm nil)
(add-to-list 'exec-path (expand-file-name "shims" rbenv-installation-dir)))

View File

@ -10,3 +10,7 @@
(when (and (executable-find "rbenv") (featurep! +rbenv))
(unless (split-string (shell-command-to-string "rbenv versions --bare") "\n" t)
(warn! "No versions of ruby are available via rbenv, did you forget to install one?")))
(when (and (executable-find "chruby") (featurep! +chruby))
(unless (split-string (shell-command-to-string "chruby") "\n" t)
(warn! "No versions of ruby are available via chruby, did you forget to install one?")))

View File

@ -23,6 +23,8 @@
(package! rbenv :pin "2ea1a5bdc1"))
(when (featurep! +rvm)
(package! rvm :pin "134497bc46"))
(when (featurep! +chruby)
(package! chruby :pin "42bc6d521f"))
;; Testing frameworks
(package! rspec-mode :pin "c4353a1bff")