loading...
Cover image for The taco_tuesday gem, cause Tacos

The taco_tuesday gem, cause Tacos

drbragg profile image Drew Bragg ・1 min read

taco_tuesday gem (2 Part Series)

1) The taco_tuesday gem, cause Tacos 2) taco_tuesday gem, now with more tacos

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.

taco_tuesday gem (2 Part Series)

1) The taco_tuesday gem, cause Tacos 2) taco_tuesday gem, now with more tacos

Posted on Oct 4 '18 by:

drbragg profile

Drew Bragg

@drbragg

Full Stack Dev | Single Dad | Board Game Geek | Rucker

Discussion

markdown guide
 

Well...
Muffin Monday?
Schnitzel Wednesday?
Chicken Thursday?
Fishy Friday?

 

Schnitzel Wednesday

πŸ˜‚ πŸ˜‚ πŸ˜‚

 

Sometimes its Burger Wednesday instead of Schnitzel or Crispy Duck with Peanutbutter Sauce.
And it is never fishy Friday, but it sounded nice.