Stateless Code | Codecast: Create a RubyGem 81: Refactor ConvenienceMethods - Part 3 @StatelessCode | Uploaded October 2021 | Updated October 2024, 2 hours ago.
This is the 81st video in the NerdDice create a RubyGem series. In this video Mike picks up where he left off in the previous video and finishes refactoring the ConvenienceMethods module.
This video covers:
00:00:12 Introduction
00:00:25 Continue troubleshooting of remaining failures caused by consolidating
00:07:46 Get regular expression case statement down to 2 when statements and an else
00:09:32 Consolidate total_ pattern like roll_ pattern
00:12:49 Finish regular expression case statement consolidation
00:13:32 Clean up puts statements and unused methods
00:14:39 Address basic Rubocop violations
00:16:21 Write private method to return sides, number_of_dice, and number_to_keep as an array and use destructuring to make variable assignment a one-liner
00:18:32 Split define_total_nndnn into a subroutine to determine whether to use total_dice or roll_dice
00:23:53 Refactor get_number_of_dice_from_method_name
00:26:00 Try to reduce remaining 2 lines of module length by eliminating get_bonus_from_method_name and get_penalty_from_method_name to get below RuboCop threshold. Creates Assignment Branch Condition size violation
00:28:24 Attempt to solve modifier problem a different way. It works and all RuboCop violations are cleared
00:32:37 Commit, push, update backlog
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.
This is the 81st video in the NerdDice create a RubyGem series. In this video Mike picks up where he left off in the previous video and finishes refactoring the ConvenienceMethods module.
This video covers:
00:00:12 Introduction
00:00:25 Continue troubleshooting of remaining failures caused by consolidating
00:07:46 Get regular expression case statement down to 2 when statements and an else
00:09:32 Consolidate total_ pattern like roll_ pattern
00:12:49 Finish regular expression case statement consolidation
00:13:32 Clean up puts statements and unused methods
00:14:39 Address basic Rubocop violations
00:16:21 Write private method to return sides, number_of_dice, and number_to_keep as an array and use destructuring to make variable assignment a one-liner
00:18:32 Split define_total_nndnn into a subroutine to determine whether to use total_dice or roll_dice
00:23:53 Refactor get_number_of_dice_from_method_name
00:26:00 Try to reduce remaining 2 lines of module length by eliminating get_bonus_from_method_name and get_penalty_from_method_name to get below RuboCop threshold. Creates Assignment Branch Condition size violation
00:28:24 Attempt to solve modifier problem a different way. It works and all RuboCop violations are cleared
00:32:37 Commit, push, update backlog
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.