← Back to context

Comment by square_usual

1 year ago

What's the difference between the new `script` directory/generator and using rake? I thought rake was meant for basically those things?

Also, is there a good reason to use thruster instead of caddy?

This will answer your question: https://github.com/rails/rails/pull/52335#issuecomment-22395...

> I think there can be some overlap between rake tasks and one-off scripts and opinions may vary. In the related discussion Okura Masafumi mentions that rake tasks are one way but they can be executed multiple times, and I tend to agree, leaving rake tasks for code that is intended to be run multiple times.

> So script/ can hold one-off scripts, for example Basecamp uses script/migrate which I am guessing they use for updating data, and we had a similar folder at my previous company.

> But script/ is not only for one-off scripts, it can hold more general scripts too, for example rails generate benchmark already generates benchmarks in script/benchmarks, and at my previous company we had script/ops which had a bunch of shell scripts and ruby scripts for various ops-related things.

So really not so clear description. It caters to those who feel like they have a script that doesn't really fit in the Rake file.

I really don't understand the NIH that the Rails team is bringing in with Kamal and Thruster. Not everything that HEY uses has to be pushed onto folks at other companies.

  • Nothing is pushed. You can upgrade your Rails 7 application to Rails 8 today and no Solid* nor Kamal nor Thruster will be used in your app. It's there for you to use it. If you don't want to use it, don't. They released these new tools and, if you want to use something else, you can. That's the whole idea of Rails.