Skip to content

JavierGelatti/RubyRefactorings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icon

RubyRefactorings

Build Downloads

A RubyMine plugin that provides additional refactorings for the Ruby language, implemented using code intentions.

Some refactorings that are available when installing the plugin:

  • Replace singleton method by opening singleton class:

    Replace singleton method by opening singleton class example

  • Remove unnecessary braces from hash argument:

    Remove unnecessary braces from hash argument example

  • Introduce string interpolation:

    Introduce interpolation example

  • Convert single-quoted string to double-quoted string:

    Change a single-quoted string literal to have double quotes example

  • Replace conditional with guard clause:

    Simplify if chain by introducing guard clauses

    Introduce guard clause in conditional spanning a whole method

    Introduce guard clase in block

    Introduce guard clase replacing elsifs that include exceptions

  • Extract method object (a.k.a. Replace Function with Command):

    Extract method object example

  • Convert string/symbol word list (using %w/%i syntax) to array (using [] syntax):

    Convert %w and %i literals to square bracket array

  • Split map/collect/each by introducing chained map:

    Split map in two different ways

    Split each, and collect with brace block

  • Remove useless conditional statement

    Replace if statement with true condition by its then block

    Replace if expression with false condition by its else block

    Replace if expression with false condition and no else block by nil

    Replace unless expression with multiple statements by block

  • Move into conditional above

    Move a statement into all branches of a conditional that is just before it

  • Use self-assignment

    Replace assignment to increment numeric variable by self-assignment

    Replace short-circuit or to memoize result of computation by self-assignment

    Replace hash access to increment value by self-assignment

About

A RubyMine plugin that provides additional refactorings for Ruby

Resources

License

Stars

Watchers

Forks

Packages

No packages published