Is there any tool or mode for refactoring ruby ​​code in emacs?

I am looking for some tool that supports me in refactoring ruby ​​code.

I know that it’s very difficult to implement tools for a dynamic language like ruby, but I also know that there are various solutions for RubyMine and Vim to help with basic materials such as the “extraction method” and “renaming method”.

It doesn't seem like multiple editors / IDEs are open, so I'm looking for something specifically for emacs.

+4
source share
2 answers

There is a project called ruby-refactor with recent activity. It can be installed through MELPA. This was inspired by a plugin for Vim called vim-refactoring-ruby . This seems to have had a good effect on my first impression.

+2
source

I don’t know if this will be exactly what you are looking for, but maybe you can take a look at Rdefs

Rdefs is a tiny Ruby script that extracts a class, module, method, attribute definitions from the given Ruby source code.

Use Rdefs with Emacs

You might want to install etc / rdefs.el in your elisp directory and add something similar to your dot.emacs:

(require 'rvm)

(rvm-use-default)

(require 'rdefs)

Hope this helps a bit ... but either way, it seems there are currently no alternatives.

You can also try rsense status:

RSense are Ruby development tools that specialize in high functional text editors such as Emacs, Vim, etc. Following the UNIX philosophy, RSense is highly transparent and easily learns, expands and patches users. By adopting a copyleft license, it also retains being free software.

In the future, the following features will be available:

 Static code checking Caller jump Refactoring 

But there was no activity on the github page project for 1 year ( new branch for v 2.0 )

Perhaps you could try contacting the author ...

+2
source

Source: https://habr.com/ru/post/1444400/


All Articles