Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/evilmartians/terraforming-rails

Terraforming legacy Rails applications guides and tools
https://github.com/evilmartians/terraforming-rails

legacy rails ruby tools

Last synced: 5 days ago
JSON representation

Terraforming legacy Rails applications guides and tools

Awesome Lists containing this project

README

        

# Terraforming Rails

A collection of tools and guides to help you turn legacy code into [legendary code](https://twitter.com/cackhanded/status/1019216124729352192?s=21).

Based on the RailsConf 2019 talk ["Terraforming legacy Rails applications"](https://railsconf.com/program/sessions#session-832) ([slides](https://speakerdeck.com/palkan/railsconf-2019-terraforming-legacy-rails-applications), [video](https://www.youtube.com/watch?v=-NKpMn6XSjU)).


Sponsored by Evil Martians

## Tools

### Unreleased scripts

These scripts have been created during the development of different Rails projects at [Evil Martians](http://evilmartians.com).

They're not universal enough to be extracted into libraries (some depend on particular Rails version or rely on project-specific assumptions), but they could be used a starting point for building tools for your project.

- [Lint/Env](./tools/lint_env) – RuboCop cop (restrict the usage of `ENV` and `Rails.env` in the app)
- [FactoryLinter](./tools/factory_linter) – lint factory definitions
- [TimecopLinter](./tools/timecop_linter) – make sure you always travel back in time when using Timecop
- [TemplatesTracker](./tools/templates_tracker) – track unused templates
- [GemTracker](./tools/gem_tracker) - track potentially unused gems.

### Gems

#### Tests

- [TestProf](http://test-prof.evilmartians.io) – analyze and improve test suite performance

#### Security

- [bundler-audit](https://github.com/rubysec/bundler-audit) – check dependencies for known CVEs
- [brakeman](https://brakemanscanner.org) – detect the app code's security issues

#### Database

- [database_validations](https://github.com/toptal/database_validations) – validations consistent with the DB constraints
- [database_consistency](https://github.com/djezzzl/database_consistency) - check the consistency of the DB constraints and models validations
- [isolator](https://github.com/palkan/isolator) – detect transactions with side-effects (_non-atomic_)

#### Dead code elimination

- [traceroute](https://github.com/amatsuda/traceroute) – detect unused routes/controller actions
- [factory_trace](https://github.com/djezzzl/factory_trace) – detect unused FactoryBot factories/traits

#### Configuration

- [anyway_config](https://github.com/palkan/anyway_config) – transparently use multiple sources of configuration at once

#### Analysis

- [attractor](https://github.com/julianrubisch/attractor) — churn/complexity analysis

### Automation Tools

- [lefthook](https://github.com/Arkweid/lefthook) – language-agnostic git hook manager
- [danger](./examples/danger) – code review automation helper
- [pronto](https://github.com/prontolabs/pronto) – linters runner to run checks only for the relevant changes

## Examples

- [CircleCI](./examples/circleci) — example CircleCI configuration files
- [Docker for Dev](https://github.com/evilmartians/ruby-on-whales) — example Docker for development configuration
- [Lefthook + Crystalball](./examples/lefthook+crystalball) — git hooks for convenient development environment

## Resources/Guides

- [Fight the flaky tests](./guides/flaky.md)

## License

The code is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).