Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

holiday_tools

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

holiday_tools

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

HolidayTools

This is a wrapper around the alexdunae/holidays gem with a more intuitive API (at least IMO). It uses the region-id's of that gem to filter the results.

API Description

Class methods

  • show_regions
    Generates a list of region-id's and names of that region (country in Englich and sub-region in local name, e.g. Germany/Sachsen)

Instance methods

  • new(filter=[])
    You may supply an array of filter strings. This strings are region-id's (see above show_regions) or patterns, which will be expanded as regular expressions to match region-id's

  • show_holiday( date )
    Generates a list of all public holidays for date, which is a Date object (e.g. Date.today)

  • show_week( date )
    Generates the list of holidays for the week (sunday to saturday), which contains the date

  • show_month( date )
    Generates the list of holidays for the month, which contains the date

  • show_year( date )
    Generates the list of holidays for the year, which contains the date

Installation

Add this line to your application's Gemfile:

$ gem 'holiday_tools'

And then execute:

$ bundle

Or install it yourself as:

$ gem install holiday_tools

Usage

Included in the gem is an executable, which can be used as CLI command.
Examples:

$ holiday_tools 

shows all regions which observe today a public holiday

$ holiday_tools --date 2013-05-01 --mode m  

shows all holidays in all regions in May, 2013

$ holiday_tools --mode y at ge

shows all holidays in the current year in Austria and Germany

$ holiday_tools --date 2013-05-01 --mode m es_.    

shows all holidays in May, 2013 which are observed only in subregions of Spain

$ holiday_tools --help

shows the usage hints

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 08 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc