/rails-refactor

Ruby on Rails script extensions for easier refactorings

Primary LanguageRuby

rails refactor

by Birkir A. Barkarson <birkirb@stoicviking.net>

Description

A plugin to assist in refactoring your rails application.

INSTALL

script/plugin install git://github.com/birkirb/rails-refactor.git

USAGE

Usage: script/refactor [OPTIONS] [COMMANDS]

OPTIONS:

-x, --[no-]execute               Execute supplied commands. Must be supplied to run otherwise it will just show what would have been done.
-h, --help                       This help message.
-s, --[no-]use-scm               Use SCM support.
-m, --[no-]migrations            Generate migrations.
-f, --command-file COMMAND_FILE  Read commands from file.

COMMANDS:

find   [FIND_OPTIONS]   [string]
rename [RENAME_OPTIONS] [old_class_name] [new_class_name]

FIND_OPTIONS:

--find-exclude REGEXP        Don't report strings in files that match this exlusion pattern.

RENAME_OPTIONS:

--rename-exclude REGEXP      Don't rename strings that match this exlusion pattern.
--[no-]rails-inflections     Use rails inflections for class and variable names. (default)

RENAME EXAMPLE:

script/refactor rename parasite user

Attribution

Inspired by Hiroshi Saito’s script-refactor

github.com/hiroshi/script-refactor