Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 2.68 KB

README.md

File metadata and controls

79 lines (52 loc) · 2.68 KB

TacoTuesday

Gem Version Maintainability Build Status

Adds a taco_tuesday? method to Ruby's Date and Times classes. Cause, well, tacos.

Installation

Add this line to your application's Gemfile:

gem 'taco_tuesday'

And then execute:

$ bundle install

Usage

With the Date class:

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?

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?

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/drbragg/taco_tuesday. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the TacoTuesday project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.