holidays 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/LICENSE +21 -0
- data/README +76 -0
- data/REFERENCES +16 -0
- data/data/SYNTAX +111 -0
- data/data/au.yaml +106 -0
- data/data/build_defs.rb +152 -0
- data/data/ca.yaml +141 -0
- data/data/de.yaml +115 -0
- data/data/dk.yaml +117 -0
- data/data/es.yaml +161 -0
- data/data/fr.yaml +70 -0
- data/data/gb.yaml +106 -0
- data/data/ie.yaml +58 -0
- data/data/index.yaml +21 -0
- data/data/is.yaml +136 -0
- data/data/it.yaml +66 -0
- data/data/mx.yaml +106 -0
- data/data/nl.yaml +67 -0
- data/data/north_america_informal.yaml +49 -0
- data/data/pt.yaml +85 -0
- data/data/se.yaml +91 -0
- data/data/united_nations.yaml +188 -0
- data/data/us.yaml +81 -0
- data/data/za.yaml +78 -0
- data/lib/holidays.rb +404 -0
- data/lib/holidays/MANIFEST +23 -0
- data/lib/holidays/au.rb +41 -0
- data/lib/holidays/ca.rb +68 -0
- data/lib/holidays/de.rb +52 -0
- data/lib/holidays/dk.rb +47 -0
- data/lib/holidays/es.rb +52 -0
- data/lib/holidays/europe.rb +215 -0
- data/lib/holidays/fr.rb +36 -0
- data/lib/holidays/gb.rb +40 -0
- data/lib/holidays/ie.rb +32 -0
- data/lib/holidays/is.rb +61 -0
- data/lib/holidays/it.rb +35 -0
- data/lib/holidays/mx.rb +51 -0
- data/lib/holidays/nl.rb +36 -0
- data/lib/holidays/north_america.rb +107 -0
- data/lib/holidays/pt.rb +52 -0
- data/lib/holidays/scandinavia.rb +114 -0
- data/lib/holidays/se.rb +52 -0
- data/lib/holidays/united_nations.rb +24 -0
- data/lib/holidays/us.rb +48 -0
- data/lib/holidays/za.rb +35 -0
- data/test/defs/test_defs_au.rb +36 -0
- data/test/defs/test_defs_ca.rb +29 -0
- data/test/defs/test_defs_de.rb +46 -0
- data/test/defs/test_defs_dk.rb +30 -0
- data/test/defs/test_defs_es.rb +57 -0
- data/test/defs/test_defs_europe.rb +240 -0
- data/test/defs/test_defs_fr.rb +26 -0
- data/test/defs/test_defs_gb.rb +36 -0
- data/test/defs/test_defs_ie.rb +21 -0
- data/test/defs/test_defs_is.rb +33 -0
- data/test/defs/test_defs_it.rb +25 -0
- data/test/defs/test_defs_mx.rb +22 -0
- data/test/defs/test_defs_nl.rb +24 -0
- data/test/defs/test_defs_north_america.rb +54 -0
- data/test/defs/test_defs_pt.rb +32 -0
- data/test/defs/test_defs_scandinavia.rb +75 -0
- data/test/defs/test_defs_se.rb +32 -0
- data/test/defs/test_defs_us.rb +36 -0
- data/test/defs/test_defs_za.rb +25 -0
- metadata +118 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require 'holidays/pt'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/se.yaml
|
7
|
+
class PtDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_pt
|
10
|
+
{Date.civil(2008,1,1) => 'Nyårsdagen',
|
11
|
+
Date.civil(2008,1,6) => 'Trettondedag jul',
|
12
|
+
Date.civil(2008,3,21) => 'Långfredagen',
|
13
|
+
Date.civil(2008,3,23) => 'Påskdagen',
|
14
|
+
Date.civil(2008,3,24) => 'Annandag påsk',
|
15
|
+
Date.civil(2008,5,1) => 'Första maj',
|
16
|
+
Date.civil(2008,5,1) => 'Kristi himmelsfärdsdag',
|
17
|
+
Date.civil(2008,5,11) => 'Pingstdagen',
|
18
|
+
Date.civil(2008,6,6) => 'Nationaldagen',
|
19
|
+
Date.civil(2005,6,25) => 'Midsommardagen',
|
20
|
+
Date.civil(2006,6,24) => 'Midsommardagen',
|
21
|
+
Date.civil(2007,6,23) => 'Midsommardagen',
|
22
|
+
Date.civil(2008,6,21) => 'Midsommardagen',
|
23
|
+
Date.civil(2005,11,5) => 'Alla helgons dag',
|
24
|
+
Date.civil(2006,11,4) => 'Alla helgons dag',
|
25
|
+
Date.civil(2007,11,3) => 'Alla helgons dag',
|
26
|
+
Date.civil(2008,11,1) => 'Alla helgons dag',
|
27
|
+
Date.civil(2008,12,25) => 'Juldagen',
|
28
|
+
Date.civil(2008,12,26) => 'Annandag jul'}.each do |date, name|
|
29
|
+
assert_equal name, Holidays.on(date, :se, :informal)[0][:name]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require 'holidays/scandinavia'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/dk.yaml, data/is.yaml, data/se.yaml
|
7
|
+
class ScandinaviaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_scandinavia
|
10
|
+
{Date.civil(2007,1,1) => 'Nytårsdag',
|
11
|
+
Date.civil(2007,2,18) => 'Fastelavn',
|
12
|
+
Date.civil(2007,4,9) => 'Danmarks besættelse',
|
13
|
+
Date.civil(2007,4,16) => 'Dronningens fødselsdag',
|
14
|
+
Date.civil(2007,4,5) => 'Skærtorsdag',
|
15
|
+
Date.civil(2007,4,6) => 'Langfredag',
|
16
|
+
Date.civil(2007,4,8) => 'Påskedag',
|
17
|
+
Date.civil(2007,4,9) => '2. påskedag',
|
18
|
+
Date.civil(2007,5,1) => 'Arbejdernes kampdag',
|
19
|
+
Date.civil(2007,5,4) => 'Store Bededag',
|
20
|
+
Date.civil(2007,5,17) => 'Kristi Himmelfartsdag',
|
21
|
+
Date.civil(2007,5,27) => 'Pinsedag',
|
22
|
+
Date.civil(2007,5,28) => '2. Pinsedag',
|
23
|
+
Date.civil(2007,6,5) => 'Grundlovsdag',
|
24
|
+
Date.civil(2007,12,24) => 'Juleaftensdag',
|
25
|
+
Date.civil(2007,12,25) => '1. juledag',
|
26
|
+
Date.civil(2007,12,26) => '2. juledag'}.each do |date, name|
|
27
|
+
assert_equal name, Holidays.on(date, :dk, :informal)[0][:name]
|
28
|
+
end
|
29
|
+
|
30
|
+
{Date.civil(2007,1,1) => 'Nýársdagur',
|
31
|
+
Date.civil(2007,1,6) => 'Þrettándinn',
|
32
|
+
Date.civil(2007,1,19) => 'Bóndadagur',
|
33
|
+
Date.civil(2007,2,18) => 'Konudagur',
|
34
|
+
Date.civil(2007,4,5) => 'Skírdagur',
|
35
|
+
Date.civil(2007,4,6) => 'Föstudaginn langi',
|
36
|
+
Date.civil(2007,4,8) => 'Páskadagur',
|
37
|
+
Date.civil(2007,4,9) => 'Annar í páskum',
|
38
|
+
Date.civil(2007,4,19) => 'Sumardagurinn fyrsti',
|
39
|
+
Date.civil(2007,5,1) => 'Verkalýðsdagurinn',
|
40
|
+
Date.civil(2007,5,17) => 'Uppstigningardagur',
|
41
|
+
Date.civil(2007,5,27) => 'Hvítasunnudagur',
|
42
|
+
Date.civil(2007,5,28) => 'Annar í hvítasunnu',
|
43
|
+
Date.civil(2007,6,3) => 'Sjómannadagurinn',
|
44
|
+
Date.civil(2007,6,17) => 'Lýðveldisdagurinn',
|
45
|
+
Date.civil(2007,8,6) => 'Frídagur verslunarmanna',
|
46
|
+
Date.civil(2007,12,24) => 'Jól',
|
47
|
+
Date.civil(2007,12,25) => 'Jól',
|
48
|
+
Date.civil(2007,12,26) => 'Jól',
|
49
|
+
Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name|
|
50
|
+
assert_equal name, Holidays.on(date, :is, :informal)[0][:name]
|
51
|
+
end
|
52
|
+
|
53
|
+
{Date.civil(2008,1,1) => 'Nyårsdagen',
|
54
|
+
Date.civil(2008,1,6) => 'Trettondedag jul',
|
55
|
+
Date.civil(2008,3,21) => 'Långfredagen',
|
56
|
+
Date.civil(2008,3,23) => 'Påskdagen',
|
57
|
+
Date.civil(2008,3,24) => 'Annandag påsk',
|
58
|
+
Date.civil(2008,5,1) => 'Första maj',
|
59
|
+
Date.civil(2008,5,1) => 'Kristi himmelsfärdsdag',
|
60
|
+
Date.civil(2008,5,11) => 'Pingstdagen',
|
61
|
+
Date.civil(2008,6,6) => 'Nationaldagen',
|
62
|
+
Date.civil(2005,6,25) => 'Midsommardagen',
|
63
|
+
Date.civil(2006,6,24) => 'Midsommardagen',
|
64
|
+
Date.civil(2007,6,23) => 'Midsommardagen',
|
65
|
+
Date.civil(2008,6,21) => 'Midsommardagen',
|
66
|
+
Date.civil(2005,11,5) => 'Alla helgons dag',
|
67
|
+
Date.civil(2006,11,4) => 'Alla helgons dag',
|
68
|
+
Date.civil(2007,11,3) => 'Alla helgons dag',
|
69
|
+
Date.civil(2008,11,1) => 'Alla helgons dag',
|
70
|
+
Date.civil(2008,12,25) => 'Juldagen',
|
71
|
+
Date.civil(2008,12,26) => 'Annandag jul'}.each do |date, name|
|
72
|
+
assert_equal name, Holidays.on(date, :se, :informal)[0][:name]
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require 'holidays/se'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/se.yaml
|
7
|
+
class SeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_se
|
10
|
+
{Date.civil(2008,1,1) => 'Nyårsdagen',
|
11
|
+
Date.civil(2008,1,6) => 'Trettondedag jul',
|
12
|
+
Date.civil(2008,3,21) => 'Långfredagen',
|
13
|
+
Date.civil(2008,3,23) => 'Påskdagen',
|
14
|
+
Date.civil(2008,3,24) => 'Annandag påsk',
|
15
|
+
Date.civil(2008,5,1) => 'Första maj',
|
16
|
+
Date.civil(2008,5,1) => 'Kristi himmelsfärdsdag',
|
17
|
+
Date.civil(2008,5,11) => 'Pingstdagen',
|
18
|
+
Date.civil(2008,6,6) => 'Nationaldagen',
|
19
|
+
Date.civil(2005,6,25) => 'Midsommardagen',
|
20
|
+
Date.civil(2006,6,24) => 'Midsommardagen',
|
21
|
+
Date.civil(2007,6,23) => 'Midsommardagen',
|
22
|
+
Date.civil(2008,6,21) => 'Midsommardagen',
|
23
|
+
Date.civil(2005,11,5) => 'Alla helgons dag',
|
24
|
+
Date.civil(2006,11,4) => 'Alla helgons dag',
|
25
|
+
Date.civil(2007,11,3) => 'Alla helgons dag',
|
26
|
+
Date.civil(2008,11,1) => 'Alla helgons dag',
|
27
|
+
Date.civil(2008,12,25) => 'Juldagen',
|
28
|
+
Date.civil(2008,12,26) => 'Annandag jul'}.each do |date, name|
|
29
|
+
assert_equal name, Holidays.on(date, :se, :informal)[0][:name]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require 'holidays/us'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/au.yaml, data/north_america_informal.yaml
|
7
|
+
class UsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_us
|
10
|
+
{Date.civil(2007,1,1) => 'New Year\'s Day',
|
11
|
+
Date.civil(2007,1,26) => 'Australia Day',
|
12
|
+
Date.civil(2007,4,6) => 'Good Friday',
|
13
|
+
Date.civil(2007,4,9) => 'Easter Monday',
|
14
|
+
Date.civil(2007,4,25) => 'ANZAC Day',
|
15
|
+
Date.civil(2007,12,25) => 'Christmas Day',
|
16
|
+
Date.civil(2007,12,26) => 'Boxing Day'}.each do |date, name|
|
17
|
+
assert_equal name, Holidays.on(date, :au, :informal)[0][:name]
|
18
|
+
end
|
19
|
+
|
20
|
+
[:au_sa, :au_act, :au_nsw, :au_].each do |r|
|
21
|
+
assert_equal 'Labour Day', Date.civil(2007,10,1).holidays(r)[0][:name]
|
22
|
+
end
|
23
|
+
|
24
|
+
[:au_sa, :au_act, :au_nsw, :au_vic, :au_tas, :au_qld, :au_nt, :au_].each do |r|
|
25
|
+
assert_equal 'Queen\'s Birthday', Date.civil(2007,6,11).holidays(r)[0][:name]
|
26
|
+
end
|
27
|
+
|
28
|
+
assert_equal 'Labour Day', Date.civil(2007,3,5).holidays(:au_wa)[0][:name]
|
29
|
+
assert_equal 'Labour Day', Date.civil(2007,3,12).holidays(:au_vic)[0][:name]
|
30
|
+
assert_equal 'Labour Day', Date.civil(2007,5,7).holidays(:au_qld)[0][:name]
|
31
|
+
|
32
|
+
assert_equal 'May Day', Date.civil(2007,5,7).holidays(:au_nt)[0][:name]
|
33
|
+
|
34
|
+
assert_equal 'Eight Hours Day', Date.civil(2007,3,12).holidays(:au_tas)[0][:name]
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
require 'holidays/za'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/za.yaml
|
7
|
+
class ZaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_za
|
10
|
+
{Date.civil(2007,1,1) => 'New Year\'s Day',
|
11
|
+
Date.civil(2007,3,21) => 'Human Rights Day',
|
12
|
+
Date.civil(2007,4,6) => 'Good Friday',
|
13
|
+
Date.civil(2007,4,9) => 'Family Day',
|
14
|
+
Date.civil(2007,4,27) => 'Freedom Day',
|
15
|
+
Date.civil(2007,5,1) => 'Workers Day',
|
16
|
+
Date.civil(2007,6,16) => 'Youth Day',
|
17
|
+
Date.civil(2007,8,9) => 'National Women\'s Day',
|
18
|
+
Date.civil(2007,9,24) => 'Heritage Day',
|
19
|
+
Date.civil(2007,12,16) => 'Day of Reconciliation',
|
20
|
+
Date.civil(2007,12,25) => 'Christmas Day',
|
21
|
+
Date.civil(2007,12,26) => 'Day of Goodwill'}.each do |date, name|
|
22
|
+
assert_equal name, Holidays.on(date, :za, :informal)[0][:name]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,118 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
rubygems_version: 0.9.0
|
3
|
+
specification_version: 1
|
4
|
+
name: holidays
|
5
|
+
version: !ruby/object:Gem::Version
|
6
|
+
version: 0.9.0
|
7
|
+
date: 2007-12-19 00:00:00 -08:00
|
8
|
+
summary: A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!
|
9
|
+
require_paths:
|
10
|
+
- lib
|
11
|
+
email:
|
12
|
+
homepage: http://code.dunae.ca/holidays
|
13
|
+
rubyforge_project:
|
14
|
+
description: A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!
|
15
|
+
autorequire:
|
16
|
+
default_executable:
|
17
|
+
bindir: bin
|
18
|
+
has_rdoc: true
|
19
|
+
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
24
|
+
version:
|
25
|
+
platform: ruby
|
26
|
+
signing_key:
|
27
|
+
cert_chain:
|
28
|
+
post_install_message:
|
29
|
+
authors:
|
30
|
+
- Alex Dunae
|
31
|
+
files:
|
32
|
+
- lib/holidays
|
33
|
+
- lib/holidays.rb
|
34
|
+
- lib/holidays/au.rb
|
35
|
+
- lib/holidays/ca.rb
|
36
|
+
- lib/holidays/de.rb
|
37
|
+
- lib/holidays/dk.rb
|
38
|
+
- lib/holidays/es.rb
|
39
|
+
- lib/holidays/europe.rb
|
40
|
+
- lib/holidays/fr.rb
|
41
|
+
- lib/holidays/gb.rb
|
42
|
+
- lib/holidays/ie.rb
|
43
|
+
- lib/holidays/is.rb
|
44
|
+
- lib/holidays/it.rb
|
45
|
+
- lib/holidays/MANIFEST
|
46
|
+
- lib/holidays/mx.rb
|
47
|
+
- lib/holidays/nl.rb
|
48
|
+
- lib/holidays/north_america.rb
|
49
|
+
- lib/holidays/pt.rb
|
50
|
+
- lib/holidays/scandinavia.rb
|
51
|
+
- lib/holidays/se.rb
|
52
|
+
- lib/holidays/united_nations.rb
|
53
|
+
- lib/holidays/us.rb
|
54
|
+
- lib/holidays/za.rb
|
55
|
+
- data/au.yaml
|
56
|
+
- data/build_defs.rb
|
57
|
+
- data/ca.yaml
|
58
|
+
- data/de.yaml
|
59
|
+
- data/dk.yaml
|
60
|
+
- data/es.yaml
|
61
|
+
- data/fr.yaml
|
62
|
+
- data/gb.yaml
|
63
|
+
- data/ie.yaml
|
64
|
+
- data/index.yaml
|
65
|
+
- data/is.yaml
|
66
|
+
- data/it.yaml
|
67
|
+
- data/mx.yaml
|
68
|
+
- data/nl.yaml
|
69
|
+
- data/north_america_informal.yaml
|
70
|
+
- data/pt.yaml
|
71
|
+
- data/se.yaml
|
72
|
+
- data/SYNTAX
|
73
|
+
- data/united_nations.yaml
|
74
|
+
- data/us.yaml
|
75
|
+
- data/za.yaml
|
76
|
+
- README
|
77
|
+
- REFERENCES
|
78
|
+
- LICENSE
|
79
|
+
test_files:
|
80
|
+
- test/defs/test_defs_au.rb
|
81
|
+
- test/defs/test_defs_ca.rb
|
82
|
+
- test/defs/test_defs_de.rb
|
83
|
+
- test/defs/test_defs_dk.rb
|
84
|
+
- test/defs/test_defs_es.rb
|
85
|
+
- test/defs/test_defs_europe.rb
|
86
|
+
- test/defs/test_defs_fr.rb
|
87
|
+
- test/defs/test_defs_gb.rb
|
88
|
+
- test/defs/test_defs_ie.rb
|
89
|
+
- test/defs/test_defs_is.rb
|
90
|
+
- test/defs/test_defs_it.rb
|
91
|
+
- test/defs/test_defs_mx.rb
|
92
|
+
- test/defs/test_defs_nl.rb
|
93
|
+
- test/defs/test_defs_north_america.rb
|
94
|
+
- test/defs/test_defs_pt.rb
|
95
|
+
- test/defs/test_defs_scandinavia.rb
|
96
|
+
- test/defs/test_defs_se.rb
|
97
|
+
- test/defs/test_defs_us.rb
|
98
|
+
- test/defs/test_defs_za.rb
|
99
|
+
rdoc_options:
|
100
|
+
- --all
|
101
|
+
- --inline-source
|
102
|
+
- --line-numbers
|
103
|
+
- --charset
|
104
|
+
- utf-8
|
105
|
+
extra_rdoc_files:
|
106
|
+
- README
|
107
|
+
- data/SYNTAX
|
108
|
+
- lib/holidays/MANIFEST
|
109
|
+
- REFERENCES
|
110
|
+
- LICENSE
|
111
|
+
executables: []
|
112
|
+
|
113
|
+
extensions: []
|
114
|
+
|
115
|
+
requirements: []
|
116
|
+
|
117
|
+
dependencies: []
|
118
|
+
|