fastruby / next_rails

A toolkit to upgrade your next Rails application
https://www.fastruby.io/blog/upgrade-rails/dual-boot/dual-boot-with-rails-6-0-beta.html?utm_source=github&utm_medium=description&utm_campaign=github&utm_term=next-rails
MIT License
466 stars 28 forks source link

[REQUEST] Add a `dual-run` command to run a single command with both versions #111

Open arielj opened 9 months ago

arielj commented 9 months ago

Description

When using next rails, we can dual boot the app and run different commands either in the current or in the next version of gems.

This is fine but it's really common to need to run the same command in both versions to compare results and currently we have 2 options:

The cons of these 2 approaches are:

This feature request is about having a binary that would run one single command in the 2 versions in parallel in the same terminal and then print the output of both.

The benefits would be:

Possible Implementation

What I imagine is a script that starts 2 threads. The output of the next version can be streamed back to the main process, so the user can see that things are working. The output of the current version can be captured and printed at the end when both threads finished so the outputs are not mixed.

I don't know what's the best command name, I said dual-run but happy to change it to anything else.

Resources:

We have to be sure to use Ruby 2.0.0 features by default since we want to support that version. https://ruby-doc.org/core-2.0.0/Thread.html

And only use newer features if required for specific Ruby versions.

I will abide by the code of conduct