@StatelessCode
  @StatelessCode
Stateless Code | Create a RubyGem 97: Update Bundle Before Performing Releases @StatelessCode | Uploaded March 2023 | Updated October 2024, 3 hours ago.
We are nearing the end of our development for the maintenance releases for our gem. One of the final things to get in the habit of doing before a release is to review our dependencies and look for opportunities to upgrade them.

It's possible that dependency upgrades could contain breaking changes, so it's important to start with a clean working directory in Git. If things go south, we can always do a `git reset --hard HEAD`. The more likely situation is that you would have a subset of gems that need to be reverted. You can downgrade the offending gems explicitly or add more pessimistic version constraints. Then you can re-run your bundle commands.

We look through all the dependencies in our Gemfile and gemspec and check RubyGems.org to see if there are newer versions available for them. Most of them do have newer versions available, so we make the updates to our gemspec so that the latest version is captured.

After that we run `bundle update` to update all of our dependencies to the latest version allowed by our constraints.

After updating our bundle we get a little confused about an issue that occurred with the debug gem the last time we updated a bundle. After a couple minutes chasing our tails, we realize that the issue came up in our NerdDice.com Rails 7 project and debug isn't a dependency at all for this project.

We run our RSpec specs and everything looks good.

Back in video number 93, we updated RuboCop to enable new cops by default. We updated RuboCop in our bundle update, so we expect that there might be new violations to resolve. There are a lot of new violations (95), but they're all about preferring be to eq when making an expectation about a Boolean. We agree with the new standard and can autocorrect all of them.

We push to the remote and our GitHub actions pass on the first try. (Yay!)

This video covers:
00:00:12 Introduction
00:01:05 Look at Gemfile and gemspec, see whether there are new versions of gems available, and make updates
00:05:00 Review the changes made to the gemspec
00:05:22 Check out new branch and run `bundle update`
00:05:51 Try to find out what happened with the debug gem. Eventually realize that the issue was in the Rails project and not this one
00:08:27 Re-run bundle update and run RSpec
00:09:20 Run rubocop and auto-correct the new violations, preferring be over eq for Boolean expectations
00:11:30 Review changes
00:12:43 Commit, push, watch builds.
00:15:32 Pull request, prune some old branches, close issue

#ruby #rubygems #codecast #screencast #NerdDice #DnD #roleplaying #softwaredevelopment #github #opensource #dice #tlm #dependencies

See other related StatelessCode videos:
- Update Bundle to Clear Dependabot Alerts and Troubleshoot Build Dependency Failures (the debug gem issue I got confused with) youtu.be/rMlolATu73U
- Create a RubyGem 93: Refactor RuboCop to Enable New Cops by Default for the Gem youtu.be/wyZTKXMx8lg

Resources that we relied upon for this solution:
- RubyGems rubygems.org

This video is CC0 - No rights reserved. (YouTube doesn't allow this option when publishing.) All code is released under the UNLICENSE. Stateless Code denies the concept of "intellectual property". Copying is not stealing.
Create a RubyGem 97: Update Bundle Before Performing ReleasesCodecast: statelesscode.com WordPress 21: Resize Picture, Add Sidebar, Fix h1 TagsCodecast: Create a RubyGem 76: Fix Bonus and Penalty when Number of Dice Not SpecifiedCodecast: Getting Started with Rails 7 21: Upgrades, Bug Fixes, and TweaksCodecast: Create a RubyGem 06: Release the Gem!Mediocre Karaoke - Dont Stop Believin by JourneyUpdate Ruby then Add RuboCop to a Rails ProjectWrite System Tests for Devise Reconfirm Email and Refactor Shared Code into a Testing ConcernBroadcasting Comments from Conall and Donall #stpatricksday #rails #modalismCodecast: statelesscode.com WordPress 26: Retrospective for Release 2Inkscape 03: Install on Mac, rework SVG from previous videoCodecast: statelesscode.com WordPress 18: Use JavaScript to Add Elements for Tailwind Styling

Create a RubyGem 97: Update Bundle Before Performing Releases @StatelessCode

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER