You may or may not know that Ruby has a pessimistic operator:
~>
It's actually a pretty cool little thing used in Gemfiles to specify a version range.
gem 'rails', '~> 5.2.1'
gem 'devise', '~> 4.6'
gem 'puma', '~> 3'
is the same as specifying:
gem 'rails', '>= 5.2.1', '< 5.3.0'
gem 'devise', '>= 4.6.0', '< 5.0'
gem 'puma', '>= 3.0', '< 4.0'
But what is even better about it is it's name. ~>
is called a twiddle-wakka
I hope you laughed as much at this as I did.
Happy Friday!
Top comments (3)
This ranks right up there IMO with Python calling it's new
:=
operator the 'walrus operator'.😂😂😂
alerner1st.medium.com/the-strange-...