<commit_before>
Examples of Ruby Blocks in Action


MILK

1.  Replace loop with collection closure method (based on Refactoring Ruby by Martin Fowler).
    Source: https://github.com/mycargus/autobots-can-read-too/blob/master/chapter-4/replace_loop_with_collection_closure_method.rb

2.  Extract surrounding method (also based on the book Refactoring Ruby)
    Source: https://github.com/mycargus/autobots-can-read-too/blob/master/chapter-4/extract_surrounding_method.rb


MEAT

Source code examples!

1.  Procedural example: https://gerrit.instructure.com/#/c/66874/7
2.  Object-oriented example: ./selective-release<commit_msg>clarify source<commit_after>
Examples of Ruby Blocks in Action


MILK

1.  Replace loop with collection closure method (based on Refactoring Ruby by Martin Fowler).
    Source: https://github.com/mycargus/autobots-can-read-too/blob/master/chapter-4/replace_loop_with_collection_closure_method.rb

2.  Extract surrounding method (also based on the book Refactoring Ruby)
    Source: https://github.com/mycargus/autobots-can-read-too/blob/master/chapter-4/extract_surrounding_method.rb


MEAT

Source code examples!

1.  Procedural example: (https://gerrit.instructure.com/#/c/66874/7) /spec/selenium/quizzes/quizzes_take_quiz_student_spec.rb
2.  Object-oriented example: ./selective-release
{'fraction_non_alphanumeric': 0.09787556904400607, 'fraction_numerical': 0.018209408194233688, 'mean_word_length': 4.636752136752137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4103551', 'n_tokens_mistral': 459, 'n_tokens_neox': 431, 'n_words': 99}