@StatelessCode
  @StatelessCode
Stateless Code | Create a RubyGem 102: Winter 2024 Maintenance Part 1 - Update Bundle and Fix Rubocop Violations @StatelessCode | Uploaded April 2024 | Updated October 2024, 8 hours ago.
It's time for another round of periodic maintenance activities for the gem. In this video, we install Ruby 3.3 on the local machine and check its compatibility with the current state of the Gem.

The version of RuboCop we have installed errors out when we try to run it. Since we plan on updating all of the dependencies anyway, we do that next and see if that resolves the issue. RuboCop runs after the `bundle update`, but it introduces some new violations.

Most of them are auto-correctable and are related to replacing additional parameters like `*args, **kwargs, &block` with the more succinct `...` or using string interpolation for symbols when passing arguments to the :send method.

The first non-auto-correctable one is a new cop called Gemspec/DevelopmentDependencies. It has a default enforced style of wanting you to put your development dependencies in your Gemfile instead of your gemspec. For now, we decide to leave the development dependencies in the gemspec and make that the enforced style.

The second group of new violations we need to correct are RSpec/IndexedLet. This cop discourages you from using variables like :die1, :die2, :die3, :die4 in RSpec let declarations. This is a good practice and we set about providing more meaningful names for the violations.

Once the RuboCop violations are cleaned up and we double-check the specs are still passing, we add Ruby 3.3 to the GitHub Actions for the gem, commit, and push to GitHub.

With the new RuboCop violations the maintenance was too much to tackle in a single video. We'll finish up in the next one.

This video covers:
00:00:00 Introduction
00:02:05 Install Ruby 3.3.0 on the local machine
00:03:40 Install the bundle and try to run RuboCop and RSpec. RuboCop errors out in 3.3.
00:04:57 Look for newer versions of dependencies on RubyGems.org and update the versions in the Gemspec and update the bundle
00:09:17 Try to run RuboCop again. It executes with new violations. Autocorrect the auto-correctable ones and see if the changes are acceptable
00:12:32 Review the remaining RuboCop violations
00:13:13 Review the Gemspec/DevelopmentDependencies violations. Resolve by using EnforcedStyle: gemspec in .rubocop.yml
00:16:10 Resolve RSpec/IndexedLet by having more descriptive let variable names
00:21:38 Add Ruby 3.3 to GitHub Actions
00:22:51 Commit and push the changes. Review remaining items to do. Ensure the build succeeds.

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

See other related StatelessCode videos:
- Create a RubyGem 09: Fix RuboCop issues and release a patch version youtu.be/2tw6ozMgTpQ
- Create a RubyGem 89: Add Ruby 3.2 to GitHub Actions and Update RSpec to a compatible version youtu.be/kid7Cc2dzRk
- Create a RubyGem 93: Refactor RuboCop to Enable New Cops by Default for the Gem youtu.be/wyZTKXMx8lg
- Create a RubyGem 97: Update Bundle Before Performing Releases youtu.be/1hVpwRL3B98

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 102: Winter 2024 Maintenance Part 1 - Update Bundle and Fix Rubocop ViolationsCreate a RubyGem 103: Winter 2024 Maintenance Part 2 - Update Certs and Release Version 0.5.1Codecast: Getting Started with Rails 7 25: Set Up a Comments MailerGenerate a New Rails 7 Project With Tailwind and PostgreSQLMake Devise ParanoidCodecast: Create a RubyGem 60: Add Ability Scores Documentation and MergeCodecast: Create a RubyGem 72: Add Basic Highest and Lowest PatternsCodecast: Create a RubyGem 81: Refactor ConvenienceMethods - Part 3NerdDice.com Retrospective 4 - It is a Long Way DownCodecast: Create a RubyGem 54: Write roll_ability_scores Spec and MethodCreate a RubyGem 93: Refactor RuboCop to Enable New Cops by Default for the GemCodecast: Create a RubyGem 63: Create 0.3.x Stable Branch and Prune Old Branches

Create a RubyGem 102: Winter 2024 Maintenance Part 1 - Update Bundle and Fix Rubocop Violations @StatelessCode

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER