For years I've had to add:
class Date def taco_tuesday? tuesday? end end
to my ruby projects so I could easily check if it was Taco Tuesday.
But No More!
Introducing the taco_tuesday gem!
Simply add this line to your application's Gemfile:
gem 'taco_tuesday'
And then execute:
$ bundle install
Now you can easily check if it's taco tuesday.
With the Date class:
require 'taco_tuesday' # May 26th 2020 is a Tuesday tuesday = Date.new(2020, 5, 26) tuesday.taco_tuesday? #=> true # May 25th 2020 is a Monday monday = Date.new(2020, 5, 25) monday.taco_tuesday? #=> false # Check if today is Taco Tuesday Date.today.taco_tuesday? #=> Same result as Date.today.tuesday?
With the Time class:
require 'taco_tuesday' # May 26th 2020 is a Tuesday tuesday = Time.new(2020, 5, 26) tuesday.taco_tuesday? #=> true # May 25th 2020 is a Monday monday = Time.new(2020, 5, 25) monday.taco_tuesday? #=> false # Check if today is Taco Tuesday Time.now.taco_tuesday? #=> Same result as Time.now.tuesday?
Yes, this is a real gem and yes, you can contribute (though I'm not sure what we could add... ideas?).
I hope this post and gem gives you as good of a chuckle as it did for me.
Top comments (3)
Well...
Muffin Monday?
Schnitzel Wednesday?
Chicken Thursday?
Fishy Friday?
๐ ๐ ๐
Sometimes its Burger Wednesday instead of Schnitzel or Crispy Duck with Peanutbutter Sauce.
And it is never fishy Friday, but it sounded nice.