DEV Community

Cover image for taco_tuesday gem, now with more tacos
Drew Bragg
Drew Bragg

Posted on

3 1

taco_tuesday gem, now with more tacos

Thanks to Colin Bartlett's awesome contribution to the taco_tuesday gem version 0.2.0 has been released!

In 0.2.0 you can now run 🌮? on Date and Time classes to know if it's a Taco Tuesday.

require 'taco_tuesday'

# May 26th 2020 is a Tuesday
tuesday = Date.new(2020, 5, 26)
tuesday.taco_tuesday? #=> true
tuesday.🌮? #=> true

# May 25th 2020 is a Monday
monday = Date.new(2020, 5, 25)
monday.taco_tuesday? #=> false
monday.🌮? #=> false

# Check if today is Taco Tuesday
Date.today.taco_tuesday? #=> Same result as Date.today.tuesday?
Date.today.🌮? #=> Same result as Date.today.taco_tuesday?
Enter fullscreen mode Exit fullscreen mode

Or with the Time class:

require 'taco_tuesday'

# May 26th 2020 is a Tuesday
tuesday = Time.new(2020, 5, 26)
tuesday.taco_tuesday? #=> true
tuesday.🌮? #=> true

# May 25th 2020 is a Monday
monday = Time.new(2020, 5, 25)
monday.taco_tuesday? #=> false
monday.🌮? #=> false

# Check if today is Taco Tuesday
Time.now.taco_tuesday? #=> Same result as Time.now.tuesday?
Time.now.🌮? #=> Same result as Time.now.taco_tuesday?
Enter fullscreen mode Exit fullscreen mode

With the power of both taco_tuesday? AND 🌮? you and your ruby apps are sure to never miss another Taco Tuesday!

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay