A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!
Find a file
Alex Dunae b6968ccdb3 Cleaned-up docs
Tests for ZA and AU
2007-11-30 00:49:33 +00:00
bin Added Boxing Day method and GB, US and CA observed holidays 2007-11-30 00:03:43 +00:00
data Cleaned-up docs 2007-11-30 00:49:33 +00:00
lib Cleaned-up docs 2007-11-30 00:49:33 +00:00
test Cleaned-up docs 2007-11-30 00:49:33 +00:00
LICENSE Added LICENSE and REFERENCES 2007-11-20 19:54:55 +00:00
rakefile.rb Cleaned-up docs 2007-11-30 00:49:33 +00:00
README Cleaned-up docs 2007-11-30 00:49:33 +00:00
REFERENCES Added basic mixin infrastructure 2007-11-21 21:08:34 +00:00

= Ruby Holidays Gem
  
A set of classes to deal with holidays in Ruby.

Extends Ruby's built-in Date class and supports custom holiday definition lists.

=== Examples

==== Using the Holidays class
  # Get all holidays on April 25, 2008 in Australia
  date = Date.civil(2008,4,25)
  Holidays.by_day(date, :au)
  => [{:name => 'ANZAC Day',...}]


  # Get all holidays in July, 2008 in Canada and the US
  from = Date.civil(2008,7,1)
  to   = Date.civil(2008,7,31)
  Holidays.between(from, to, :ca,:us)
  => [{:name => 'Canada Day',...}
      {:name => 'Independence Day',...}]


==== Extending Ruby's Date class
  # Lookup Canada Day in the :ca region
  Date.civil(2008,7,1).holiday?(:ca)
  => true
  
  # Lookup Canada Day in the :fr region
  Date.civil(2008,7,1).holiday?(:fr)
  => false

=== Installation

To install the gem from RubyForge:

  gem install holidays

Or, download the source <tt>.tgz</tt> file from http://rubyforge.org/holidays/ and 
extract it somewhere in your include path.

=== Credits and code

* Project page: http://code.dunae.ca/holidays
* Source: http://code.dunae.ca/svn/holidays
* Docs: http://code.dunae.ca/holidays/doc

By Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007.

Made on Vancouver Island.