Questions tagged [ruby]
The ruby tag has no usage guidance.
30
questions
0
votes
0
answers
123
views
Ruby Eglot Tree-Sitter Configuration
Has anyone managed an eglot and tree-sitter configuration for ruby that has a reasonably full feature set. I have both activated, but here are some things that don't work:
xref jumping
code folding
...
0
votes
1
answer
79
views
Indentation in HEREDOC
I'm looking for a way to make the indentation in HEREDOCs better. In my case, it's specifically in Ruby, but maybe this is a general question. Basically, I have the following situation: in our tests, ...
0
votes
1
answer
61
views
Ruby+imenu not showing private methods
I'm a little surprised that I haven't found anything on the web about this, but I've got a Ruby file and its private methods aren't listed by imenu.
Given the following class:
class Blub
def hi
&...
0
votes
1
answer
308
views
Suppress "Ignoring <ruby gem>" messages on emacs startup
When I start emacs, I get a bunch of messages
Ignoring charlock_holmes-0.7.7 because its extensions are not built. Try: gem pristine charlock_holmes --version 0.7.7
Ignoring escape_utils-1.2.1 ...
0
votes
0
answers
197
views
Error (use-package): Cannot load ruby-test-mode
Installed Spacemacs and opened a ruby file. It got this error:
Error (use-package): Cannot load ruby-test-mode
I have researched on this issue: https://github.com/syl20bnr/spacemacs/commit/...
0
votes
0
answers
28
views
Has anyone worked out configuring objed for ruby?
I am interested in trying out objed, but I find that out of the box it gets blocks and expressions wrong in ruby mode. For example, I notice that in identifying a defun it includes any comments and ...
0
votes
1
answer
92
views
Autoloaded variable overrides the one from the init file
I added the following line to my init file to replace ruby-mode with enh-ruby-mode:
(setq auto-mode-alist
(mapcar
(lambda (x)
(if (eq (cdr x) 'ruby-mode)
(cons (car ...
1
vote
1
answer
225
views
How do I make emacs indent relative to the beginning of the previous line?
Here's how emacs indents e.g. Python code:
a = myfun(b,
c)
I'd like it to be this way:
a = myfun(b,
c)
Reasoning? If I later replace myfun with myfunction, in the first case it becomes:...
5
votes
1
answer
866
views
Using emacs for ruby development with asdf version manager
I have installed a (doom) emacs to start developing with Ruby. So far I have mainly used Sublime Text but because of reasons I want to give emacs a chance.
I tried Spacemacs too but uninstalled this ...
5
votes
2
answers
1k
views
How to make flycheck checker 'ruby-rubocop' use 'bundle exec rubocop' as executable?
I want ruby-rubocop Flycheck syntax checker to execute bundle exec rubocop instead of just rubocop.
What I've tried:
(setq flycheck-ruby-rubocop-executable "bundle exec rubocop")
Results in ...
-2
votes
1
answer
78
views
Can "kaz-yos/eval-in-repl" use the prexisting "inf-ruby" console started by robe mode
I've been using org babel to execute ruby code,
works well but
wrapping blocks with begin_src/end_src is cumbersome
no live output - i have to wait till the whole process finishes to see output
...
0
votes
2
answers
312
views
How to run a command in Emacs (rvm-use) against all current and future buffers?
I am very new to Emacs. In my case what I'm actually using is Spacemacs.
I have few versions of Ruby installed in my system and I use RVM for switching between them.
I'm trying to change current ...
2
votes
0
answers
185
views
Inconsistent hash indentation in ruby-mode
I've noticed that indent-region behaves this way in ruby-mode:
{
down_payment: 40.00,
payment_day: 10
}
{
"down_payment": 40.00,
"payment_day": 10
}
Both are valid Ruby ...
1
vote
1
answer
61
views
Add breakpoints to a source code file en masse
I'm editing a .rb file with about 3000 lines of code.
This file has about 30+ statements that does a .create(
create() appears in many ways:
as part of another expression: puts Foo.create(...)
or
...
1
vote
1
answer
1k
views
Problems with rvm and installed gems
I'm running emacs on Mac Os, I have settled RVM and a rails project. It works well on console:
rvm list ...
2
votes
1
answer
155
views
Can tangling embed code in external files? instead of recreating files
I'm building a web application using the literate programming style.
At least trying to.
I wanted to "hit the ground running", so I decided "make a copy" of one of the many "starter apps"
https://...
0
votes
2
answers
751
views
Robe mode: how to automatically require all submodules of the project?
After some fight, I was able to get some code completion and navigation from robe. Specifically, in the *pry* buffer I modified $LOAD_PATH to point at my project's source directories. However, now in ...
4
votes
1
answer
1k
views
Emacs robe mode for ruby, why does it need to start the server?
I've only gotten into the ruby world on emacs, and I'm looking for a lot of the good stuff I normally get with rubymine like code completion and jumping into modules. I'm attempting to use robe with ...
8
votes
3
answers
2k
views
Ruby always indent 2 spaces?
I would like to use 2-space indents all the time like:
sidekiq_options({
retry: true
})
I've tried setting .emacs.d/init.el to:
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(...
0
votes
1
answer
191
views
How to run rspec from the emacs shell?
I'm following an entry-level tutorial on rspec here, and I've created a very simple test at spec\lib\zombie_spec.rb:
require "spec_helper"
describe "A Zombie" do
#Your 'examples' (tests) go here.
...
5
votes
1
answer
2k
views
How to return an org mode table with headings and hline from Ruby
I have the same question as this question except that I don't see how to do so other than in elisp. I am using Ruby, but I suppose the question applies to other languages as well. If I return an ...
1
vote
1
answer
342
views
comint-mode + vagrant
Disclaimer: Pretty new to Emacs and running Spacemacs, have no idea what I'm doing with elisp.
We run all our projects under vagrant, so I'm interested in getting some things, such as inf-ruby-mode ...
0
votes
0
answers
353
views
ruby-mode not indenting correctly?
I am using emacs 24.4 in -nw terminal mode. I know ruby-mode is included but I cannot get the following snippet to indent correctly in a .rb file.
private
def
end
Instead I can only get
...
1
vote
1
answer
77
views
Running ruby files from $PATH in Eshell
I'm trying to find a way to run .rb files that are in the $PATH in Eshell by following the solution here. I added ".rb" to exec-suffixes, set eshell-force-execution to t and customized eshell-...
0
votes
1
answer
126
views
How do I configure emacs to stop adding an extra closing bracket when hitting space?
I'm using web-mode to edit my erb files. When I type <% emacs (or web-mode) adds a closing %> bracket. But when I type a space after the percent sign (i.e. %), an additional %> bracket is ...
0
votes
0
answers
50
views
Is there a way to colorize markdown coding partial
I want to colorize code snippet in markdown-mode.
# foo.rb
def foo
do_something
end
And javascript code.
// bar.js
function bar(){
do_something();
}
In markdown-mode the codes are colored by ...
0
votes
0
answers
376
views
Strange tabbing behaviour in .erb files
Note that I use spaces for tabs.
When I am working in erb files for rails such as example.js.erb or example2.html.erb, I am getting some very odd (and annoying) auto-tabbing behaviour, which I can't ...
0
votes
1
answer
168
views
Vagrant Integration in rspec-mode
I have a vagrant machine for my Rails project. I would like to integrate Emacs with rspec, currently done by hand on a terminal (inside the vagrant machine).
If I run rspec-verify-all Emacs will try ...
0
votes
1
answer
129
views
How to define a configurable variable in Elisp to be used in other program like Ruby?
I want to define a configurable variable in Emacs, but make it can be used in Ruby code.
The situation is like here:
https://github.com/zenspider/enhanced-ruby-mode/pull/68
I copy the content to ...
4
votes
2
answers
782
views
projectile-rails: run the current test
While it is easy to run the whole test suite with projectile-rails, this takes too much time. I'd like to be able to run the current test (i.e., the test point is located in) with a shortcut. Is this ...