Questions tagged [ruby]

30 questions
8
votes
3 answers

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) (setq indent-line-function 'insert-tab) (setq…
zlotnika
  • 81
  • 4
5
votes
2 answers

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 following error: Error while checking syntax…
kolen
  • 221
  • 2
  • 6
5
votes
1 answer

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 array of arrays as the value result of some code, I…
Daniel Doherty
  • 418
  • 4
  • 12
4
votes
1 answer

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 because it was really slow) A problem I have now…
Gernot
  • 141
  • 3
4
votes
2 answers

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 possible?
ckruse
  • 457
  • 3
  • 12
4
votes
1 answer

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 autocomplete for the most part. Most robe stuff…
turntwo
  • 143
  • 5
2
votes
0 answers

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 hashes, so in principle they should behave the same…
2
votes
1 answer

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://github.com/RailsApps/rails-bootstrap So before I have…
american-ninja-warrior
  • 3,773
  • 2
  • 21
  • 40
1
vote
1 answer

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: a = myfunction(b, c) I can probably…
x-yuri
  • 281
  • 1
  • 8
1
vote
1 answer

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 multiline: Foo.create( baa: "baz" ) etc We…
american-ninja-warrior
  • 3,773
  • 2
  • 21
  • 40
1
vote
1 answer

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 …
anquegi
  • 739
  • 5
  • 21
1
vote
1 answer

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 consoles, to ssh into my vagrant box before running…
1
vote
1 answer

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-interpreter-alist like this: Regexp: \.rb String:…
Sum Proxy
  • 43
  • 6
0
votes
1 answer

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 here: here is the elisp code that want to define a…
stardiviner
  • 1,888
  • 26
  • 45
0
votes
0 answers

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 documentation I have tried both ruby-lsp and…
Daniel Doherty
  • 418
  • 4
  • 12
1
2