Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Holiday is a gem that lets you configure holidays for multiple countries with YAML.
First setup path to a YAML file and set the country code.
Holiday.yaml_file = "/path/to/yaml/holiday.yml"
Holiday.country = "US"
You can query for dates
# Defaults to current year
Holiday.find("christmas")
Holiday.find("labour day")
Or supply a year
# Can supply the year as optional argument
Holiday.find(:christmas, 2005)
Holiday.find(:thanksgiving, 1999)
The YAML format for Holiday is as follows
holiday:
US:
christmas:
when: december 25th
as: christmas
halloween:
when: october 31st
as: halloween, all hallows eve
labor_day:
when: 1st monday in september
as: labor day, labour day
thanksgiving:
when: 4th thursday in november
as: thanksgiving, turkey day
Holidays are scoped by country code. Each holiday needs both "when" and "as" keys. The "when" key can either be an exact month and day, or the occurrence of the holiday in the given month. E.g., "1st monday in september".
The "as" key is used to identify holidays by alternate names and spellings. For instance, "thanksgiving" and "turkey day" should both point to the 4th thursday in november.
Holiday.find("turkey day")
Holiday.find(:thanksgiving)
There are a few other methods that may be useful
Holiday.all # array containing all keys and alternate names of holidays from yaml file
Holiday.scan("a string containing a holiday by name, like christmas") # => christmas
Holiday::Query.find("all hallows eve") # => october 31st
FAQs
Unknown package
We found that holiday demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.