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 + qt - TODO
+ racket - TODO + racket - TODO
+ [[file:../modules/lang/rest/README.org][rest]] - 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 + [[file:../modules/lang/rust/README.org][rust]] =+lsp= - TODO
+ scala =+lsp= - TODO + scala =+lsp= - TODO
+ [[file:../modules/lang/scheme/README.org][scheme]] - TODO + [[file:../modules/lang/scheme/README.org][scheme]] - TODO

View file

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

View file

@ -119,6 +119,14 @@
"e" #'bundle-exec "e" #'bundle-exec
"o" #'bundle-open)) "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 (after! rbenv
(setq rspec-use-rvm nil) (setq rspec-use-rvm nil)
(add-to-list 'exec-path (expand-file-name "shims" rbenv-installation-dir))) (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)) (when (and (executable-find "rbenv") (featurep! +rbenv))
(unless (split-string (shell-command-to-string "rbenv versions --bare") "\n" t) (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?"))) (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")) (package! rbenv :pin "2ea1a5bdc1"))
(when (featurep! +rvm) (when (featurep! +rvm)
(package! rvm :pin "134497bc46")) (package! rvm :pin "134497bc46"))
(when (featurep! +chruby)
(package! chruby :pin "42bc6d521f"))
;; Testing frameworks ;; Testing frameworks
(package! rspec-mode :pin "c4353a1bff") (package! rspec-mode :pin "c4353a1bff")