0.0
The project is in a healthy, maintained state
ruby-reforge is a gem that scans a Ruby or Rails project, detects incompatible code for a target Ruby version, and automatically rewrites or suggests fixes. It updates version files, fixes deprecated syntax, rewrites code for new Ruby syntax, and suggests Rails-level incompatibilities.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 2.0
~> 13.0
~> 3.12
~> 1.50

Runtime

~> 3.3
~> 0.24
~> 3.1
~> 1.0
~> 0.23
~> 0.6
 Project Readme

Ruby Reforge

🚀 Automatically upgrade Ruby projects to newer versions and fix deprecated code.

Overview

ruby-reforge is a gem that scans a Ruby or Rails project, detects incompatible code for a target Ruby version (e.g., upgrading from 3.1 → 3.3), and automatically rewrites or suggests fixes.

Features

  • ✅ Updates .ruby-version, Gemfile, and gemspec files
  • ✅ Fixes deprecated Ruby syntax automatically
  • ✅ Detects and fixes removed features
  • ✅ Rewrites code for new Ruby syntax
  • ✅ Generates detailed upgrade reports
  • ✅ Interactive mode for reviewing changes
  • ✅ Git integration (creates branches, commits changes)

Installation

gem install ruby-reforge

Or add it to your Gemfile:

gem 'ruby-reforge', group: :development

Usage

Upgrade to a new Ruby version

ruby-reforge upgrade 3.3

This will:

  1. Update version files (.ruby-version, Gemfile, gemspec)
  2. Scan your codebase for deprecated patterns
  3. Automatically fix issues
  4. Create a git branch and commit changes

Generate a report

ruby-reforge report

Shows what needs to be fixed without making changes.

Interactive mode

ruby-reforge upgrade 3.3 --interactive

Prompts before making each change.

Dry run

ruby-reforge upgrade 3.3 --dry-run

Shows what would be changed without making any changes.

What It Fixes

Deprecated Methods

  • File.exists? → File.exist?
  • Dir.exists? → Dir.exist?
  • URI.escape → CGI.escape
  • And more...

Version Files

  • Updates .ruby-version
  • Updates Gemfile ruby version
  • Updates gemspec required_ruby_version

Ruby 3.0+ Keyword Arguments

Detects and suggests fixes for keyword argument changes.

Examples

# Upgrade to Ruby 3.3
ruby-reforge upgrade 3.3

# Generate report for Ruby 3.2
ruby-reforge report --target 3.2

# Interactive upgrade
ruby-reforge upgrade 3.3 --interactive

Roadmap

  • Rails-specific deprecations
  • Gem dependency compatibility checker
  • AI-assisted fixes for complex code
  • Test framework updates
  • Performance improvement suggestions

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

The gem is available as open source under the terms of the MIT License.