Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8014799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:03:24+00:00 2026-06-04T20:03:24+00:00

I am looking for a refactoring tool for rails application in Mac. After researching

  • 0

I am looking for a refactoring tool for rails application in Mac. After researching for whole week I am kind of surprised that there is no good tool available to refactor namespace/controller/model/view/routes in one go. I am bit new to Mac paradigm so may be I am missing something.

I can see few couple of gems developed for Rails which can do some rename/replace but still it requires “manual adjustments” after refactor.

To provide my requirement, here is standard Rails projects

# routes
map.namespace :admin do |admin|
  admin.resources :items
end
match "/admin/items/:id/enable" => "admin/items#enable"

# model
/app/models/items.rb
class item < ActiveRecord::Base

end

# views
/app/views/admin/items/
/app/views/admin/items/index.html.erb
/app/views/admin/items/show.html.erb
/app/views/admin/items/new.html.erb
/app/views/admin/items/edit.html.erb


# controller
/app/controllers/admin/items_controller.rb

class Admin::ItemsController < ApplicationController
  def index
    #
  end

  def show
    #
  end

  def enable
    #
  end
end

My requirement for this tool is very basic:

Refactoring: “item” to “product” – with case match

  1. Tool should rename any file contains “item” to “product”
  2. Tool should rename any folder contains “item” to “product”
  3. Tool should find and replace “item” and to “product” in all files in current or sub directory.

With above feature:

I can simply reactor whole project by:

> refactor "item" "product"
> refactor "Item" "Product"
> refactor "admin" "shop"
> refactor "Admin" "Shop"

Greatly appreciate if you can help me to provide link of any Mac tool or any script which can fulfill my above requirement.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T20:03:27+00:00Added an answer on June 4, 2026 at 8:03 pm

    Well I decided this sounded neat so I wrote a tool which seams to pull off what you want and I’ve decided to call it refacto.

    Here’s your quick read-me:

    Proper Usage is: refacto findString changeString <file extensions> <options>

    File extensions are not optional. In order for any files to be renamed or refactored, you must list at least one file extension. Folders will be renamed by default, if you don’t want to rename them, use -nf.

    Options:
    -a : Ask for confirmation to refactor or rename each file/folder.
    -nf : Do not rename folders or subfolders
    -ci : Case Insenitive. Will change all versions of findString

    Get the source code here: https://github.com/bpo217/refacto

    A couple things to note:

    Refacto changes ALL instances of findString in a file, not just a class name or anything like that.

    Refacto will touch all subfolders and the files in those subfolders.

    Since it’s a tool after you compile it just put it into /usr/local/bin and whatever else you need to do so you can just type refacto anywhere in terminal to run it. It will always work with the current working directory.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a visual regression testing tool for CSS refactoring and see whether
I've been looking for the Eclipse JDT refactoring tool which allows me to quickly
I was looking at some code that I am refactoring and notices the try
I'm in the process of refactoring some logic built into a Rails application into
I am looking for a refactoring plugin which specifically has the ability to take
Looking for a good set of base objects to start a website up in
Looking for advice on framework and approach for building a modular web application. Primary
I'm looking for an SVN diff tool which can ignore comments as changes, as
I've been working on a tool that creates a UI for authoring wxs files.
I am currently refactoring some old code. I am looking for directions on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.