Skip to main content

React is Dead. Long live Reactive Rails! Long live StimulusReflex and ViewComponent!

React is Dead. Long live Reactive Rails! Long live StimulusReflex and ViewComponent!

Link

Integrate Swagger UI – API only ruby on rails course (chapter 8)

Integrate Swagger UI – API only ruby on rails course (chapter 8)

Link

API documentation with Swagger – API only ruby on rails course (chapter 7)

API documentation with Swagger – API only ruby on rails course (chapter 7)

Link

Rails 6.1 adds support for where with a comparison operator

Rails 6.1 adds support for where with a comparison operator

Link

Triggering a command line on file change

1 min read

Today I was migrating a somewhat old codebase to Ruby on Rails 6.0.0. As per usual, this can be a very tidious job requiring a bunch of depencies to be updated as well. In this case, the Gemfile contains around 150 lines.

When I have to do that kind of job, the first thing I do is commenting out every single gem except for rails itself, then bundle update, then I re-add the other gems to the Gemfile.

It rarely goes smoothly, since every gem has it's own dependencies and sometime the bundle command has trouble to find a way to update everything in one go, so I usually re-add 2-5 gems at once then run bundle update on my modified Gemfile, until all the dependencies have been re-added.

The whole process of going back and forth to editing, saving, running the bundle command is somewhat exhausting, so today I decided to have a look at a more productive way to do this : the following command uses inotifywait to detect whenever I save the Gemfile then run bundle update automagically.

while inotifywait -e close_write Gemfile; do bundle update; done

 

Rails 6.0: Action Mailbox, Action Text, Multiple DBs, Parallel Testing, Webpacker by default, and Zeitwerk | Riding Rails