From e50c7812070381a11f580aa835263dcdea5749fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Schwanck=20dos=20Santos?= Date: Mon, 9 Mar 2020 02:34:02 +0000 Subject: [PATCH] Add :lang ruby documentation #1166 #2681 Co-authored-by: Henrik Lissner --- docs/modules.org | 2 +- modules/lang/ruby/README.org | 90 ++++++++++++++++++++++++++++++++++++ 2 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 modules/lang/ruby/README.org diff --git a/docs/modules.org b/docs/modules.org index 4ee6e9104..d7430a14a 100644 --- a/docs/modules.org +++ b/docs/modules.org @@ -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 -+ ruby =+lsp +rvm +rbenv +rails= - TODO ++ [[file:../modules/lang/ruby/README.org][ruby]] =+lsp +rvm +rbenv +rails= + [[file:../modules/lang/rust/README.org][rust]] =+lsp= - TODO + scala =+lsp= - TODO + [[file:../modules/lang/scheme/README.org][scheme]] - TODO diff --git a/modules/lang/ruby/README.org b/modules/lang/ruby/README.org new file mode 100644 index 000000000..0b76464fe --- /dev/null +++ b/modules/lang/ruby/README.org @@ -0,0 +1,90 @@ +#+TITLE: lang/ruby +#+DATE: January 16, 2007 +#+SINCE: v1.3 +#+STARTUP: inlineimages + +* Table of contents :TOC: +- [[#description][Description]] + - [[#module-flags][Module Flags...]] + - [[#packages][Packages]] +- [[#prerequisites][Prerequisites]] + - [[#ubuntu][Ubuntu]] + - [[#macos][MacOS]] + - [[#windows][Windows]] +- [[#appendix][Appendix]] + - [[#commands][Commands]] + +* Description +This module add Ruby and optional Ruby on Rails support to Emacs. + ++ Code completion (robe) ++ Syntax checking (flycheck) ++ Jump-to-definitions (robe) ++ Bundler ++ Rubocop integration (flycheck) + +** 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. ++ =+rails= Enables rails navigational commands, plus server+console integration. + +** Packages ++ [[https://github.com/zenspider/enhanced-ruby-mode][enh-ruby-mode]] ++ [[https://github.com/nonsequitur/inf-ruby][inf-ruby]] ++ [[https://github.com/company-mode/company-inf-ruby][company-inf-ruby]] ++ [[https://github.com/rubocop-hq/rubocop-emacs][rubocop]] ++ [[https://github.com/dgutov/robe][robe]] ++ [[https://github.com/endofunky/bundler.el/tree/43efb6be4ed118b06d787ce7fbcffd68a31732a7][bundler]] ++ [[https://github.com/asok/rake][rake]] ++ [[https://github.com/senny/rbenv.el][rbenv]] ++ [[https://github.com/senny/rvm.el][rvm]] ++ [[https://github.com/pezra/rspec-mode][rspec-mode]] ++ [[https://github.com/arthurnn/minitest-emacs][minitest]] ++ [[https://github.com/asok/projectile-rails][projectile-rails]] ++ [[https://github.com/eschulte/jump.el/tree/e4f1372cf22e811faca52fc86bdd5d817498a4d8][inflections]] + +* Prerequisites +Many of this modules plugins require ruby with some version manager (RVM or +Rbenv) and the rubocop gem. + +** Ubuntu +You can follow [[https://gorails.com/setup/ubuntu/18.04][this guide]]. After ruby installation, run ~gem install rubocop~. +** MacOS +You can follow [[https://gorails.com/setup/osx/10.15-catalina][this guide]]. After ruby installation, run ~gem install rubocop~. +** Windows +You can follow [[https://gorails.com/setup/windows/10][this guide]]. After ruby installation, run ~gem install rubocop~. + +* Appendix +** Commands +*** robe +| command | key / ex command | description | +|----------------------+------------------+--------------------------------------------------------------------| +| ~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 +The projectile-rails prefix is =SPC m r=. Here is some examples: + +| command | key / ex command | description | +|-------------------------------+------------------+---------------------------------------------------| +| ~projectile-rails-console~ | =SPC m r r= | Open Rails console | +| ~projectile-rails-server~ | =SPC m r R= | Open Rails server | +| ~projectile-rails-find-model~ | =SPC m r m= | Find any model of the project | +| ~projectile-rails-find-model~ | =SPC m r M= | Find the model related of currently open resource | +*** bundler +The bundler prefix is =SPC m b=. Here is some examples: + +| command | key / ex command | description | +|------------------+------------------+---------------------| +| ~bundle-install~ | =SPC m b i= | Runs bundle install | +| ~bundle-update~ | =SPC m b u= | Runs bundle update | +*** rspec-mode +The rspec-mode prefix is =SPC m t=. Here is some examples: +| | | | +| command | key / ex command | description | +|-----------------------+------------------+-----------------------------------| +| ~rspec-verify~ | =SPC m t v= | Runs rspec on current file | +| ~rspec-verify-method~ | =SPC m t f= | Runs rspec for the item on cursor |