Ruby Weekly Issue 596: March 24, 2022

0
42
Ruby Weekly Issue 596: March 24, 2022


gem-compare 1.0: A RubyGems Plugin to Compare Gem Versions — Josef created this to help vet new versions of gems he was forging (to see accidental changes, files erroneously added to the gem, license changes, etc.) but you could use it for any sort of cross-version curiosity. Once installed, give gem compare gem-compare 0.0.7 1.0.0 a try to see it working on itself.

Josef Strzibny

IN BRIEF:

Ruby on Rails Developer — Remote-first RoR Consulting & Development firm working with entrepreneurs and startups to build modern and scalable applications.

Saeloun

📕 Articles & Tutorials

Changing Critical Code Paths with Scientist — GitHub’s Scientist is one of those gems that, when paired with the right use case, can really reduce anxiety, increase confidence, and make change easy, just like it did here for HEY.

Jorge Manrubia (Basecamp)

Hotrails: Learn Modern Rails with Hotwire — This is one of the best tutorials on Hotwire (and Rails, too) we’ve seen in quite some time. It’s in eleven parts and really demonstrates how the pieces of Hotwire function.

Alexandre Ruban

DSL Factory: A DSL to Create.. DSLs! — At the risk of getting a bit meta, DSL Factory aims to abstract away the task of defining a DSL into a DSL of its own. It does validation too.

Tom Rothe

JRuby 9.3.4.0 Released — The 9.3 branch remains compatible with CRuby 2.6. 9.3.4.0 adds improvements to Java integration, aarch64 and M1 support.

JRuby Core Team

Getting clean with gem pristine

Last week, we discussed using bundle open to edit a local version of a gem. Once I’ve finished debugging an issue using bundle open, I’m often left with miscellaneous remnants of that debugging process: various puts statements or binding.irb calls which I no longer need.

Thankfully, gem pristine <gem_name> can resolve this problem by restoring a gem to its cached (or ‘pristine’) version. In other words, the gem will no longer have the extraneous lines of code that were added during debugging.

If we’re interested in restoring more than just a single gem, we can run gem pristine --all to restore all gems for our current Ruby version.

This might mean, though, that we clear more gems than our current application is using. The last helpful command for restoring gems is bundle pristine which will restore all gems which are in our repo’s Gemfile.lock – so all gems that a repo is using, but not necessarily all gems for our current version of Ruby.

This week’s tip was written by Jemma Issroff.



Source link

Leave a reply

Please enter your comment!
Please enter your name here