Stateless Code | Codecast: Create a RubyGem 78: Allow Advantage and Bonus Combinations @StatelessCode | Uploaded October 2021 | Updated October 2024, 4 hours ago.
This is the 78th video in the NerdDice create a RubyGem series. In this video Mike implements the functionality that allows the advantage/disadvantage mechanic to be combined with the bonus/penalty in the ConvenienceMethods module. After the specs pass the affected methods are refactored to reduce line length and repeated code.
This video covers:
00:00:12 Introduction and overview of approach
00:02:44 Start writing specs for the use cases
00:12:53 Adapt regular expressions in ConvenienceMethods
00:14:30 Write private get_modifier_from_method_name method
00:16:55 Adapt existing highest/lowest methods to include modifier
00:19:12 Run RSpec. All specs passing. Test drive in console.
00:21:25 Fix RuboCop offenses
00:28:16 Refactor methods covered in this episode to reduce method length
00:36:00 RuboCop is happy. 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 78th video in the NerdDice create a RubyGem series. In this video Mike implements the functionality that allows the advantage/disadvantage mechanic to be combined with the bonus/penalty in the ConvenienceMethods module. After the specs pass the affected methods are refactored to reduce line length and repeated code.
This video covers:
00:00:12 Introduction and overview of approach
00:02:44 Start writing specs for the use cases
00:12:53 Adapt regular expressions in ConvenienceMethods
00:14:30 Write private get_modifier_from_method_name method
00:16:55 Adapt existing highest/lowest methods to include modifier
00:19:12 Run RSpec. All specs passing. Test drive in console.
00:21:25 Fix RuboCop offenses
00:28:16 Refactor methods covered in this episode to reduce method length
00:36:00 RuboCop is happy. 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.