TIL: Ruby Methods Can Take Tuples
Filed in the interesting but don't use category of fun Ruby things, but method arguments can be tuples
TIL: Ruby 2.7's Enumerable#filter_map
The Enumerable module is a source of wonder and crammed with so many useful methods. Today I learned about the new filter_map method
TIL: How to Export .env Variables to the Current Shell
Everything is Docker with lots of .env variables I need exported into the current shell environment
TIL: Working with Long Element Ids with Capybara
I'm often finding that I'm testing web interfaces which have elements with extremely long identifiers. Hey,
TIL: Complex String Interpolation with Ruby
Another one I re-remembered recently and prefer for complex string interpolations
TIL: Ruby's Loop Automatically Breaks at the End of Iteration
Autobreaking loops with iterators
TIL: How to Prettify Ruby's inject Method
Using each_with_object over inject
TIL: How to Quickly Get Regex Matches in Ruby
I often want to get the string from a regex match. If I'm only bothered about getting the first match, this shorthand works
TIL: You Can Use Lambdas in Ruby Case Statements
Using lambdas inside Ruby case statements