Because making use of a live process has been easier to implement than writing a static indexer. And because Ruby's metaprogramming abilities make almost any external indexer necessarily imprecise. With Ruby's introspection capabilities, a dynamic indexer can access very accurate information about of the set of defined methods and their source ...
The two main options are:
Pass the value as an argument, or via standard input. Take a look at how erm-ruby-get-process passes through the value of enh-ruby-extra-keywords.
Use an environment variable or several, and set them where you're calling the Ruby process. Maybe let-bind process-environment to itself around that code so it's unchanged in the end (...
For others who may want to know the answer, I finally figured it out. In the case of ruby, you should insert a nil where you want the hline to appear. Org represents a table as an array of arrays.
Here is what I used to discover the right incantation for ruby:
| Ref | Value |
| 0001 | blue |
| 0002 | red |
I'll let someone else clear that issue up for Flycheck.
But for completeness' sake: if you install a recent snapshot of Emacs 27 (to be released soon-ish) and enable flymake-mode in Ruby buffers, Rubocop integration is there, and it appends "bundle exec" when appropriate.
we want to add a line containing the word "byebug" to the preceding line of any line containing create(
Here's a replace-regexp approach:
M-x query-replace-regexp RET ^.*create( RET byebug C-qC-j \& RET
On OS X, running Emacs GUI does not get the environment variables, I would guess that your RVM is of no use in such environment without the $PATH set properly.
Steve Purcell made a Elisp library that enables Emacs GUI to get the environment variables: exec-path-from-shell
To install it (from melpa):
Search for exec-path-from-...
There are two options you could use, but I imagine that none are exactly what you want:
1) Create derived classes from the template classes
#+begin_src ruby :tangle ./app/models/appuser.rb
class AppUser < User
Braintree.api_key = "bk-54cfa45"
self.id = Braintree::...
That depends on what kind of project you're working on.
If it's a gem, it most likely require-s all modules in the top-level file (the one under lib). M-x inf-ruby-console-gem will load it and in turn, all modules.
If it's a Rails project, M-x inf-ruby-console-rails will load Rails console. Most modules use autoloads, but C-x C-k should load them all using ...
I use next function to run rails console on remote host.
It seems that run-ruby doesn't care how REPL is started, so I pass it an ssh command. Most important part is the command itself:
-t for pseudo-terminal mode, without it repl won't work;
bash --login to get usual shell (for rbenv, rvm or other stuff that initialised on shell startup). If you use zsh, ...
I had to change eshell-interpreter-alist to
And provide the following function to make it work
(defun eshell-run-ruby-command-from-path (args)
(eshell-named-command "ruby.exe" (list (eshell-search-path args))))