holidays 1.0.6 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +77 -0
  3. data/Gemfile +2 -6
  4. data/{README.rdoc → README.md} +46 -39
  5. data/Rakefile +62 -0
  6. data/data/au.yaml +11 -1
  7. data/data/cl.yaml +92 -0
  8. data/data/de.yaml +24 -0
  9. data/data/dk.yaml +3 -1
  10. data/data/ecb_target.yaml +42 -0
  11. data/data/es.yaml +44 -16
  12. data/data/fr.yaml +15 -10
  13. data/data/gb.yaml +14 -1
  14. data/data/index.yaml +7 -1
  15. data/data/lt.yaml +88 -0
  16. data/data/nl.yaml +10 -10
  17. data/data/se.yaml +26 -3
  18. data/data/sg.yaml +55 -0
  19. data/data/si.yaml +84 -0
  20. data/data/vi.yaml +29 -0
  21. data/holidays.gemspec +17 -187
  22. data/lib/holidays.rb +24 -14
  23. data/lib/holidays/MANIFEST +7 -0
  24. data/lib/holidays/au.rb +9 -9
  25. data/lib/holidays/cl.rb +43 -0
  26. data/lib/holidays/de.rb +1 -1
  27. data/lib/holidays/dk.rb +2 -2
  28. data/lib/holidays/ecb_target.rb +34 -0
  29. data/lib/holidays/es.rb +27 -27
  30. data/lib/holidays/europe.rb +72 -44
  31. data/lib/holidays/fr.rb +2 -2
  32. data/lib/holidays/gb.rb +3 -2
  33. data/lib/holidays/lt.rb +41 -0
  34. data/lib/holidays/nl.rb +1 -1
  35. data/lib/holidays/scandinavia.rb +6 -2
  36. data/lib/holidays/se.rb +7 -3
  37. data/lib/holidays/sg.rb +35 -0
  38. data/lib/holidays/si.rb +42 -0
  39. data/lib/holidays/version.rb +3 -0
  40. data/lib/holidays/vi.rb +32 -0
  41. data/test/defs/test_defs_au.rb +3 -0
  42. data/test/defs/test_defs_cl.rb +39 -0
  43. data/test/defs/test_defs_de.rb +24 -0
  44. data/test/defs/test_defs_dk.rb +1 -0
  45. data/test/defs/test_defs_ecb_target.rb +23 -0
  46. data/test/defs/test_defs_es.rb +7 -2
  47. data/test/defs/test_defs_europe.rb +84 -9
  48. data/test/defs/test_defs_fr.rb +7 -3
  49. data/test/defs/test_defs_gb.rb +7 -0
  50. data/test/defs/test_defs_lt.rb +42 -0
  51. data/test/defs/test_defs_nl.rb +3 -3
  52. data/test/defs/test_defs_scandinavia.rb +10 -2
  53. data/test/defs/test_defs_se.rb +9 -2
  54. data/test/defs/test_defs_sg.rb +20 -0
  55. data/test/defs/test_defs_si.rb +36 -0
  56. data/test/defs/test_defs_vi.rb +18 -0
  57. data/test/test_all_regions.rb +17 -9
  58. metadata +123 -105
  59. data/.travis.yml +0 -15
  60. data/CHANGELOG.rdoc +0 -57
  61. data/rakefile.rb +0 -107
@@ -18,10 +18,10 @@ module Holidays
18
18
 
19
19
  def self.holidays_by_month
20
20
  {
21
- 0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pâques", :regions => [:fr]},
21
+ 0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :type => :informal, :name => "Pâques", :regions => [:fr]},
22
22
  {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lundi de Pâques", :regions => [:fr]},
23
23
  {:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Ascension", :regions => [:fr]},
24
- {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pentecôte", :regions => [:fr]},
24
+ {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :type => :informal, :name => "Pentecôte", :regions => [:fr]},
25
25
  {:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Lundi de Pentecôte", :regions => [:fr]}],
26
26
  1 => [{:mday => 1, :name => "Jour de l'an", :regions => [:fr]}],
27
27
  5 => [{:mday => 1, :name => "Fête du travail", :regions => [:fr]},
@@ -22,7 +22,7 @@ module Holidays
22
22
  {:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Easter Sunday", :regions => [:gb]},
23
23
  {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Easter Monday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]}],
24
24
  1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_monday_if_weekend(date) }, :observed_id => "to_monday_if_weekend", :name => "New Year's Day", :regions => [:gb]},
25
- {:mday => 2, :name => "New Year's", :regions => [:gb_sct]}],
25
+ {:mday => 2, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "2nd January", :regions => [:gb_sct]}],
26
26
  3 => [{:mday => 5, :name => "St. Piran's Day", :regions => [:gb_con]},
27
27
  {:mday => 17, :name => "St. Patrick's Day", :regions => [:gb_nir]}],
28
28
  5 => [{:wday => 1, :week => 1, :name => "May Day", :regions => [:gb]},
@@ -32,7 +32,8 @@ module Holidays
32
32
  {:mday => 12, :name => "Battle of the Boyne", :regions => [:gb_nir]}],
33
33
  8 => [{:wday => 1, :week => 1, :name => "Bank Holiday", :regions => [:gb_sct]},
34
34
  {:wday => 1, :week => -1, :name => "Bank Holiday", :regions => [:gb_eng, :gb_wls, :gb_eaw, :gb_nir]}],
35
- 11 => [{:mday => 5, :type => :informal, :name => "Guy Fawkes Day", :regions => [:gb]}],
35
+ 11 => [{:mday => 5, :type => :informal, :name => "Guy Fawkes Day", :regions => [:gb]},
36
+ {:mday => 30, :observed => lambda { |date| Holidays.to_monday_if_weekend(date) }, :observed_id => "to_monday_if_weekend", :type => :informal, :name => "St. Andrew's Day", :regions => [:gb_sct]}],
36
37
  12 => [{:mday => 25, :observed => lambda { |date| Holidays.to_monday_if_weekend(date) }, :observed_id => "to_monday_if_weekend", :name => "Christmas Day", :regions => [:gb]},
37
38
  {:mday => 26, :observed => lambda { |date| Holidays.to_weekday_if_boxing_weekend(date) }, :observed_id => "to_weekday_if_boxing_weekend", :name => "Boxing Day", :regions => [:gb]}]
38
39
  }
@@ -0,0 +1,41 @@
1
+ # encoding: utf-8
2
+ module Holidays
3
+ # This file is generated by the Ruby Holidays gem.
4
+ #
5
+ # Definitions loaded: data/lt.yaml
6
+ #
7
+ # To use the definitions in this file, load it right after you load the
8
+ # Holiday gem:
9
+ #
10
+ # require 'holidays'
11
+ # require 'holidays/lt'
12
+ #
13
+ # All the definitions are available at https://github.com/alexdunae/holidays
14
+ module LT # :nodoc:
15
+ def self.defined_regions
16
+ [:lt]
17
+ end
18
+
19
+ def self.holidays_by_month
20
+ {
21
+ 0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Šv. Velykos", :regions => [:lt]},
22
+ {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Antroji Velykų diena", :regions => [:lt]}],
23
+ 1 => [{:mday => 1, :name => "Naujieji metai", :regions => [:lt]}],
24
+ 2 => [{:mday => 16, :name => "Valstybės atkūrimo diena", :regions => [:lt]}],
25
+ 3 => [{:mday => 11, :name => "Nepriklausomybės atkūrimo diena", :regions => [:lt]}],
26
+ 5 => [{:mday => 1, :name => "Darbininkų diena", :regions => [:lt]}],
27
+ 6 => [{:mday => 24, :name => "Joninės", :regions => [:lt]}],
28
+ 7 => [{:mday => 6, :name => "Valstybės diena", :regions => [:lt]}],
29
+ 8 => [{:mday => 15, :name => "Žolinė", :regions => [:lt]}],
30
+ 11 => [{:mday => 1, :name => "Visų šventųjų diena", :regions => [:lt]}],
31
+ 12 => [{:mday => 24, :name => "Šv. Kūčios", :regions => [:lt]},
32
+ {:mday => 25, :name => "Šv. Kalėdos", :regions => [:lt]},
33
+ {:mday => 26, :name => "Antroji Kalėdų diena", :regions => [:lt]}]
34
+ }
35
+ end
36
+ end
37
+
38
+
39
+ end
40
+
41
+ Holidays.merge_defs(Holidays::LT.defined_regions, Holidays::LT.holidays_by_month)
@@ -25,7 +25,7 @@ module Holidays
25
25
  {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pinksteren", :regions => [:nl]},
26
26
  {:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pinksteren", :regions => [:nl]}],
27
27
  1 => [{:mday => 1, :name => "Nieuwjaar", :regions => [:nl]}],
28
- 4 => [{:mday => 30, :name => "Koninginnedag", :regions => [:nl]}],
28
+ 4 => [{:mday => 27, :name => "Koningsdag", :regions => [:nl]}],
29
29
  5 => [{:mday => 4, :name => "Dodenherdenking", :regions => [:nl]},
30
30
  {:mday => 5, :name => "Bevrijdingsdag", :regions => [:nl]}],
31
31
  12 => [{:mday => 5, :type => :informal, :name => "Sinterklaas", :regions => [:nl]},
@@ -44,6 +44,7 @@ module Holidays
44
44
  {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "1. pinsedag", :regions => [:no]},
45
45
  {:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. pinsedag", :regions => [:no]},
46
46
  {:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Långfredagen", :regions => [:se]},
47
+ {:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :type => :informal, :name => "Påskafton", :regions => [:se]},
47
48
  {:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Påskdagen", :regions => [:se]},
48
49
  {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Annandag påsk", :regions => [:se]},
49
50
  {:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Kristi himmelsfärdsdag", :regions => [:se]},
@@ -76,19 +77,20 @@ module Holidays
76
77
  {:mday => 17, :name => "17. mai", :regions => [:no]},
77
78
  {:mday => 1, :name => "Första maj", :regions => [:se]},
78
79
  {:mday => 1, :name => "Vappu", :regions => [:fi]}],
79
- 6 => [{:mday => 5, :name => "Grundlovsdag", :regions => [:dk]},
80
+ 6 => [{:mday => 5, :type => :informal, :name => "Grundlovsdag", :regions => [:dk]},
80
81
  {:mday => 15, :type => :informal, :name => "Valdemarsdag og Genforeningsdag", :regions => [:dk]},
81
82
  {:mday => 23, :type => :informal, :name => "Sankt Hans aften", :regions => [:dk]},
82
83
  {:mday => 3, :type => :informal, :name => "Sjómannadagurinn", :regions => [:is]},
83
84
  {:mday => 17, :name => "Lýðveldisdagurinn", :regions => [:is]},
84
85
  {:mday => 6, :name => "Nationaldagen", :regions => [:se]},
85
86
  {:function => lambda { |year| Holidays.se_midsommardagen(year) }, :function_id => "se_midsommardagen(year)", :name => "Midsommardagen", :regions => [:se]},
87
+ {:function => lambda { |year| Holidays.se_midsommardagen(year)-1 }, :function_id => "se_midsommardagen(year)-1", :type => :informal, :name => "Midsommarafton", :regions => [:se]},
86
88
  {:function => lambda { |year| Holidays.fi_juhannusaatto(year) }, :function_id => "fi_juhannusaatto(year)", :name => "Juhannusaatto", :regions => [:fi]},
87
89
  {:function => lambda { |year| Holidays.fi_juhannuspaiva(year) }, :function_id => "fi_juhannuspaiva(year)", :name => "Juhannuspäivä", :regions => [:fi]}],
88
90
  11 => [{:mday => 10, :type => :informal, :name => "Mortensaften", :regions => [:dk]},
89
91
  {:mday => 16, :name => "Dagur íslenskrar tungu", :regions => [:is]}],
90
92
  12 => [{:mday => 13, :type => :informal, :name => "Sankt Lucia", :regions => [:dk]},
91
- {:mday => 24, :name => "Juleaftensdag", :regions => [:dk]},
93
+ {:mday => 24, :type => :informal, :name => "Juleaftensdag", :regions => [:dk]},
92
94
  {:mday => 25, :name => "1. juledag", :regions => [:dk, :no]},
93
95
  {:mday => 26, :name => "2. juledag", :regions => [:dk, :no]},
94
96
  {:mday => 24, :name => "Jól", :regions => [:is]},
@@ -97,8 +99,10 @@ module Holidays
97
99
  {:mday => 31, :name => "Gamlárskvöld", :regions => [:is]},
98
100
  {:mday => 24, :type => :informal, :name => "Julaften", :regions => [:no]},
99
101
  {:mday => 31, :type => :informal, :name => "Nyttårsaften", :regions => [:no]},
102
+ {:mday => 24, :type => :informal, :name => "Julafton", :regions => [:se]},
100
103
  {:mday => 25, :name => "Juldagen", :regions => [:se]},
101
104
  {:mday => 26, :name => "Annandag jul", :regions => [:se]},
105
+ {:mday => 31, :type => :informal, :name => "Nyårsafton", :regions => [:se]},
102
106
  {:mday => 6, :name => "Itsenäisyyspäivä", :regions => [:fi]},
103
107
  {:mday => 24, :name => "Jouluaatto", :regions => [:fi]},
104
108
  {:mday => 25, :name => "Joulupäivä", :regions => [:fi]},
@@ -19,6 +19,7 @@ module Holidays
19
19
  def self.holidays_by_month
20
20
  {
21
21
  0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Långfredagen", :regions => [:se]},
22
+ {:function => lambda { |year| Holidays.easter(year)-1 }, :function_id => "easter(year)-1", :type => :informal, :name => "Påskafton", :regions => [:se]},
22
23
  {:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Påskdagen", :regions => [:se]},
23
24
  {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Annandag påsk", :regions => [:se]},
24
25
  {:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Kristi himmelsfärdsdag", :regions => [:se]},
@@ -28,9 +29,12 @@ module Holidays
28
29
  {:mday => 6, :name => "Trettondedag jul", :regions => [:se]}],
29
30
  5 => [{:mday => 1, :name => "Första maj", :regions => [:se]}],
30
31
  6 => [{:mday => 6, :name => "Nationaldagen", :regions => [:se]},
31
- {:function => lambda { |year| Holidays.se_midsommardagen(year) }, :function_id => "se_midsommardagen(year)", :name => "Midsommardagen", :regions => [:se]}],
32
- 12 => [{:mday => 25, :name => "Juldagen", :regions => [:se]},
33
- {:mday => 26, :name => "Annandag jul", :regions => [:se]}]
32
+ {:function => lambda { |year| Holidays.se_midsommardagen(year) }, :function_id => "se_midsommardagen(year)", :name => "Midsommardagen", :regions => [:se]},
33
+ {:function => lambda { |year| Holidays.se_midsommardagen(year)-1 }, :function_id => "se_midsommardagen(year)-1", :type => :informal, :name => "Midsommarafton", :regions => [:se]}],
34
+ 12 => [{:mday => 24, :type => :informal, :name => "Julafton", :regions => [:se]},
35
+ {:mday => 25, :name => "Juldagen", :regions => [:se]},
36
+ {:mday => 26, :name => "Annandag jul", :regions => [:se]},
37
+ {:mday => 31, :type => :informal, :name => "Nyårsafton", :regions => [:se]}]
34
38
  }
35
39
  end
36
40
  end
@@ -0,0 +1,35 @@
1
+ # encoding: utf-8
2
+ module Holidays
3
+ # This file is generated by the Ruby Holidays gem.
4
+ #
5
+ # Definitions loaded: data/sg.yaml
6
+ #
7
+ # To use the definitions in this file, load it right after you load the
8
+ # Holiday gem:
9
+ #
10
+ # require 'holidays'
11
+ # require 'holidays/sg'
12
+ #
13
+ # All the definitions are available at https://github.com/alexdunae/holidays
14
+ module SG # :nodoc:
15
+ def self.defined_regions
16
+ [:sg]
17
+ end
18
+
19
+ def self.holidays_by_month
20
+ {
21
+ 0 => [{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Good Friday", :regions => [:sg]}],
22
+ 1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "New Year's Day", :regions => [:sg]}],
23
+ 2 => [{:mday => 14, :type => :informal, :name => "Valentine's Day", :regions => [:sg]},
24
+ {:mday => 15, :type => :informal, :name => "Total Defence Day", :regions => [:sg]}],
25
+ 5 => [{:mday => 1, :name => "Labour Day", :regions => [:sg]}],
26
+ 8 => [{:mday => 9, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "National Day", :regions => [:sg]}],
27
+ 12 => [{:mday => 25, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Christmas Day", :regions => [:sg]}]
28
+ }
29
+ end
30
+ end
31
+
32
+
33
+ end
34
+
35
+ Holidays.merge_defs(Holidays::SG.defined_regions, Holidays::SG.holidays_by_month)
@@ -0,0 +1,42 @@
1
+ # encoding: utf-8
2
+ module Holidays
3
+ # This file is generated by the Ruby Holidays gem.
4
+ #
5
+ # Definitions loaded: data/si.yaml
6
+ #
7
+ # To use the definitions in this file, load it right after you load the
8
+ # Holiday gem:
9
+ #
10
+ # require 'holidays'
11
+ # require 'holidays/si'
12
+ #
13
+ # All the definitions are available at https://github.com/alexdunae/holidays
14
+ module SI # :nodoc:
15
+ def self.defined_regions
16
+ [:si]
17
+ end
18
+
19
+ def self.holidays_by_month
20
+ {
21
+ 0 => [{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "velikonočna nedelja", :regions => [:si]},
22
+ {:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "velikonočni ponedeljek", :regions => [:si]},
23
+ {:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "binkošti", :regions => [:si]}],
24
+ 1 => [{:mday => 1, :name => "novo leto", :regions => [:si]}],
25
+ 2 => [{:mday => 8, :name => "Prešernov dan, slovenski kulturni praznik", :regions => [:si]}],
26
+ 4 => [{:mday => 27, :name => "dan upora proti okupatorju", :regions => [:si]}],
27
+ 5 => [{:mday => 1, :name => "praznik dela", :regions => [:si]},
28
+ {:mday => 2, :name => "praznik dela", :regions => [:si]}],
29
+ 6 => [{:mday => 25, :name => "dan državnosti", :regions => [:si]}],
30
+ 8 => [{:mday => 15, :name => "Marijino vnebovzetje", :regions => [:si]}],
31
+ 10 => [{:mday => 31, :name => "dan reformacije", :regions => [:si]}],
32
+ 11 => [{:mday => 1, :name => "dan spomina na mrtve", :regions => [:si]}],
33
+ 12 => [{:mday => 25, :name => "božič", :regions => [:si]},
34
+ {:mday => 26, :name => "dan samostojnosti in enotnosti", :regions => [:si]}]
35
+ }
36
+ end
37
+ end
38
+
39
+
40
+ end
41
+
42
+ Holidays.merge_defs(Holidays::SI.defined_regions, Holidays::SI.holidays_by_month)
@@ -0,0 +1,3 @@
1
+ module Holidays
2
+ VERSION = '1.0.8'
3
+ end
@@ -0,0 +1,32 @@
1
+ # encoding: utf-8
2
+ module Holidays
3
+ # This file is generated by the Ruby Holidays gem.
4
+ #
5
+ # Definitions loaded: data/vi.yaml
6
+ #
7
+ # To use the definitions in this file, load it right after you load the
8
+ # Holiday gem:
9
+ #
10
+ # require 'holidays'
11
+ # require 'holidays/vi'
12
+ #
13
+ # All the definitions are available at https://github.com/alexdunae/holidays
14
+ module VI # :nodoc:
15
+ def self.defined_regions
16
+ [:vi]
17
+ end
18
+
19
+ def self.holidays_by_month
20
+ {
21
+ 1 => [{:mday => 1, :name => "New Year", :regions => [:vi]}],
22
+ 4 => [{:mday => 30, :name => "Liberation Day", :regions => [:vi]}],
23
+ 5 => [{:mday => 1, :name => "International Workers' Day", :regions => [:vi]}],
24
+ 9 => [{:mday => 2, :name => "National Day", :regions => [:vi]}]
25
+ }
26
+ end
27
+ end
28
+
29
+
30
+ end
31
+
32
+ Holidays.merge_defs(Holidays::VI.defined_regions, Holidays::VI.holidays_by_month)
@@ -42,5 +42,8 @@ assert_equal "Queen's Birthday", Date.civil(2012,6,11).holidays(:au_qld)[0][:nam
42
42
  assert_equal "Queen's Birthday", Date.civil(2012,10,1).holidays(:au_qld)[0][:name]
43
43
  assert_equal "Queen's Birthday", Date.civil(2013,6,10).holidays(:au_qld)[0][:name]
44
44
 
45
+ assert_equal 'Australia Day', Date.civil(2014,1,26).holidays(:au_qld)[0][:name]
46
+ assert_equal 'Australia Day', Date.civil(2014,1,27).holidays(:au_qld, :observed)[0][:name]
47
+
45
48
  end
46
49
  end
@@ -0,0 +1,39 @@
1
+ # encoding: utf-8
2
+ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
+
4
+ # This file is generated by the Ruby Holiday gem.
5
+ #
6
+ # Definitions loaded: data/cl.yaml
7
+ class ClDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_cl
10
+ {Date.civil(2014,1,1) => 'Año Nuevo',
11
+ Date.civil(2011,4,22) => 'Viernes Santo',
12
+ Date.civil(2011,4,23) => 'Sábado Santo',
13
+ Date.civil(2012,4,6) => 'Viernes Santo',
14
+ Date.civil(2012,4,7) => 'Sábado Santo',
15
+ Date.civil(2013,3,29) => 'Viernes Santo',
16
+ Date.civil(2013,3,30) => 'Sábado Santo',
17
+ Date.civil(2014,4,18) => 'Viernes Santo',
18
+ Date.civil(2014,4,19) => 'Sábado Santo',
19
+ Date.civil(2015,4,3) => 'Viernes Santo',
20
+ Date.civil(2015,4,4) => 'Sábado Santo',
21
+ Date.civil(2016,3,25) => 'Viernes Santo',
22
+ Date.civil(2016,3,26) => 'Sábado Santo',
23
+ Date.civil(2014,5,1) => 'Día del Trabajo',
24
+ Date.civil(2014,5,21) => "Día de las Glorias Navales",
25
+ Date.civil(2014,6,29) => "San Pedro y San Pablo",
26
+ Date.civil(2014,7,16) => "Día de la Virgen del Carmen",
27
+ Date.civil(2014,8,15) => "Asunción de la Virgen",
28
+ Date.civil(2014,9,18) => "Independencia Nacional",
29
+ Date.civil(2014,9,19) => "Día de las Glorias del Ejército",
30
+ Date.civil(2014,10,12) => "Encuentro de Dos Mundos",
31
+ Date.civil(2014,10,31) => "Día de las Iglesias Evangélicas y Protestantes",
32
+ Date.civil(2014,11,1) => "Día de Todos los Santos",
33
+ Date.civil(2014,12,8) => 'Inmaculada Concepción de María',
34
+ Date.civil(2014,12,25) => 'Navidad'}.each do |date, name|
35
+ assert_equal name, (Holidays.on(date, :cl, :informal)[0] || {})[:name]
36
+ end
37
+
38
+ end
39
+ end
@@ -39,6 +39,30 @@ end
39
39
  assert_equal 'Allerheiligen', Date.civil(2009,11,1).holidays(r)[0][:name]
40
40
  end
41
41
 
42
+ [:de_be, :de_bb, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
43
+ assert_equal 'Tag der Deutschen Einheit', Date.civil(2009,10,3).holidays(r)[0][:name]
44
+ end
45
+
46
+ [:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
47
+ assert !Date.civil(2009,1,6).holiday?(r), "Heilige Drei Könige is not a holiday in #{r}"
48
+ end
49
+
50
+ [:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
51
+ assert !Date.civil(2009,6,11).holiday?(r), "Fronleichnam is not a holiday in #{r}"
52
+ end
53
+
54
+ [:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
55
+ assert !Date.civil(2009,8,15).holiday?(r), "Mariä Himmelfahrt is not a holiday in #{r}"
56
+ end
57
+
58
+ [:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
59
+ assert !Date.civil(2009,10,31).holiday?(r), 'Reformationstag is not a holiday in #{r}'
60
+ end
61
+
62
+ [:de_be, :de_bb, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
63
+ assert !Date.civil(2009,11,1).holiday?(r), "Allerheiligen is not a holiday in #{r}"
64
+ end
65
+
42
66
  assert !Date.civil(2010,5,8).holiday?(:de), '2010-05-08 is not a holiday in Germany'
43
67
 
44
68
  # Repentance Day
@@ -26,5 +26,6 @@ class DkDefinitionTests < Test::Unit::TestCase # :nodoc:
26
26
  Date.civil(2007,12,26) => '2. juledag'}.each do |date, name|
27
27
  assert_equal name, (Holidays.on(date, :dk, :informal)[0] || {})[:name]
28
28
  end
29
+
29
30
  end
30
31
  end
@@ -0,0 +1,23 @@
1
+ # encoding: utf-8
2
+ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
+
4
+ # This file is generated by the Ruby Holiday gem.
5
+ #
6
+ # Definitions loaded: data/ecb_target.yaml
7
+ class Ecb_targetDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_ecb_target
10
+ {Date.civil(2013,1,1) => 'New Year\'s Day',
11
+ Date.civil(2013,5,1) => 'Labour Day',
12
+ Date.civil(2013,3,29) => 'Good Friday',
13
+ Date.civil(2013,4,1) => 'Easter Monday',
14
+ Date.civil(2013,12,25) => 'Christmas Day',
15
+ Date.civil(2013,12,26) => 'Christmas Holiday'}.each do |date, name|
16
+ assert_equal name, (Holidays.on(date, :ecb_target)[0] || {})[:name]
17
+ end
18
+
19
+ assert_equal 'Good Friday', Date.civil(2013,3,29).holidays(:ecb_target)[0][:name]
20
+ assert_equal 'Easter Monday', Date.civil(2013,4,1).holidays(:ecb_target)[0][:name]
21
+
22
+ end
23
+ end
@@ -7,8 +7,8 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
7
7
  class EsDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_es
10
- {Date.civil(2009,1,1) => 'Año Nuevo',
11
- Date.civil(2009,1,6) => 'Día de Reyes',
10
+ {Date.civil(2009,1,1) => 'Año Nuevo',
11
+ Date.civil(2009,1,6) => 'Día de Reyes',
12
12
  Date.civil(2009,4,10) => 'Viernes Santo',
13
13
  Date.civil(2009,5,1) => 'Día del Trabajador',
14
14
  Date.civil(2009,8,15) => 'Asunción',
@@ -25,6 +25,8 @@ end
25
25
  assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
26
26
  end
27
27
 
28
+ assert_equal 'Jueves Santo', Date.civil(2009,4,9).holidays(:es_an)[0][:name]
29
+
28
30
  [:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
29
31
  assert_equal 'San José', Date.civil(2009,3,19).holidays(r)[0][:name]
30
32
  end
@@ -41,6 +43,8 @@ end
41
43
  assert_equal 'San Esteban', Date.civil(2009,12,26).holidays(r)[0][:name]
42
44
  end
43
45
 
46
+ assert_equal 'Año Nuevo', Date.civil(2012,1,1).holidays(:es)[0][:name]
47
+ assert_equal 'Año Nuevo', Date.civil(2012,1,2).holidays(:es, :observed)[0][:name]
44
48
  assert_equal 'Día de Andalucía', Date.civil(2009,2,28).holidays(:es_an)[0][:name]
45
49
  assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1).holidays(:es_ib)[0][:name]
46
50
  assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2).holidays(:es_m)[0][:name]
@@ -53,5 +57,6 @@ assert_equal 'Día de Ceuta', Date.civil(2009,9,2).holidays(:es_ce)[0][:name]
53
57
  assert_equal 'Día de Asturias', Date.civil(2009,9,8).holidays(:es_o)[0][:name]
54
58
  assert_equal 'Día de Extremadura', Date.civil(2009,9,8).holidays(:es_ex)[0][:name]
55
59
  assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11).holidays(:es_ct)[0][:name]
60
+
56
61
  end
57
62
  end
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
3
 
4
4
  # This file is generated by the Ruby Holiday gem.
5
5
  #
6
- # Definitions loaded: data/at.yaml, data/be.yaml, data/ch.yaml, data/cz.yaml, data/dk.yaml, data/de.yaml, data/el.yaml, data/es.yaml, data/fr.yaml, data/gb.yaml, data/hr.yaml, data/hu.yaml, data/ie.yaml, data/is.yaml, data/it.yaml, data/li.yaml, data/nl.yaml, data/no.yaml, data/pl.yaml, data/pt.yaml, data/ro.yaml, data/sk.yaml
6
+ # Definitions loaded: data/at.yaml, data/be.yaml, data/ch.yaml, data/cz.yaml, data/dk.yaml, data/de.yaml, data/el.yaml, data/es.yaml, data/fr.yaml, data/gb.yaml, data/hr.yaml, data/hu.yaml, data/ie.yaml, data/is.yaml, data/it.yaml, data/li.yaml, data/lt.yaml, data/nl.yaml, data/no.yaml, data/pl.yaml, data/pt.yaml, data/ro.yaml, data/sk.yaml, data/si.yaml
7
7
  class EuropeDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_europe
@@ -101,6 +101,7 @@ end
101
101
  assert_equal name, (Holidays.on(date, :dk, :informal)[0] || {})[:name]
102
102
  end
103
103
 
104
+
104
105
  {Date.civil(2009,1,1) => 'Neujahrstag',
105
106
  Date.civil(2009,4,10) => 'Karfreitag',
106
107
  Date.civil(2009,4,13) => 'Ostermontag',
@@ -160,8 +161,8 @@ assert_equal 'Buß- und Bettag', Date.civil(2009,11,18).holidays(:de_sn)[0][:nam
160
161
  assert_equal name, (Holidays.on(date, :el, :informal)[0] || {})[:name]
161
162
  end
162
163
 
163
- {Date.civil(2009,1,1) => 'Año Nuevo',
164
- Date.civil(2009,1,6) => 'Día de Reyes',
164
+ {Date.civil(2009,1,1) => 'Año Nuevo',
165
+ Date.civil(2009,1,6) => 'Día de Reyes',
165
166
  Date.civil(2009,4,10) => 'Viernes Santo',
166
167
  Date.civil(2009,5,1) => 'Día del Trabajador',
167
168
  Date.civil(2009,8,15) => 'Asunción',
@@ -178,6 +179,8 @@ end
178
179
  assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
179
180
  end
180
181
 
182
+ assert_equal 'Jueves Santo', Date.civil(2009,4,9).holidays(:es_an)[0][:name]
183
+
181
184
  [:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
182
185
  assert_equal 'San José', Date.civil(2009,3,19).holidays(r)[0][:name]
183
186
  end
@@ -194,6 +197,8 @@ end
194
197
  assert_equal 'San Esteban', Date.civil(2009,12,26).holidays(r)[0][:name]
195
198
  end
196
199
 
200
+ assert_equal 'Año Nuevo', Date.civil(2012,1,1).holidays(:es)[0][:name]
201
+ assert_equal 'Año Nuevo', Date.civil(2012,1,2).holidays(:es, :observed)[0][:name]
197
202
  assert_equal 'Día de Andalucía', Date.civil(2009,2,28).holidays(:es_an)[0][:name]
198
203
  assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1).holidays(:es_ib)[0][:name]
199
204
  assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2).holidays(:es_m)[0][:name]
@@ -207,22 +212,27 @@ assert_equal 'Día de Asturias', Date.civil(2009,9,8).holidays(:es_o)[0][:name]
207
212
  assert_equal 'Día de Extremadura', Date.civil(2009,9,8).holidays(:es_ex)[0][:name]
208
213
  assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11).holidays(:es_ct)[0][:name]
209
214
 
210
- {Date.civil(2007,1,1) => 'Jour de l\'an',
211
- Date.civil(2007,4,8) => 'Pâques',
215
+
216
+ {Date.civil(2007,1,1) => 'Jour de l\'an',
212
217
  Date.civil(2007,4,9) => 'Lundi de Pâques',
213
218
  Date.civil(2007,5,1) => 'Fête du travail',
214
219
  Date.civil(2007,5,8) => 'Victoire 1945',
215
220
  Date.civil(2007,5,17) => 'Ascension',
216
- Date.civil(2007,5,27) => 'Pentecôte',
217
221
  Date.civil(2007,5,28) => 'Lundi de Pentecôte',
218
222
  Date.civil(2007,7,14) => 'Fête nationale',
219
223
  Date.civil(2007,8,15) => 'Assomption',
220
224
  Date.civil(2007,11,1) => 'Toussaint',
221
225
  Date.civil(2007,11,11) => 'Armistice 1918',
222
226
  Date.civil(2007,12,25) => 'Noël'}.each do |date, name|
227
+ assert_equal name, (Holidays.on(date, :fr)[0] || {})[:name]
228
+ end
229
+ {Date.civil(2007,4,8) => 'Pâques',
230
+ Date.civil(2007,5,27) => 'Pentecôte'}.each do |date, name|
231
+ assert_nil (Holidays.on(date, :fr)[0] || {})[:name]
223
232
  assert_equal name, (Holidays.on(date, :fr, :informal)[0] || {})[:name]
224
233
  end
225
234
 
235
+
226
236
  {Date.civil(2008,3,21) => 'Good Friday',
227
237
  Date.civil(2008,3,23) => 'Easter Sunday',
228
238
  Date.civil(2008,5,5) => 'May Day',
@@ -234,6 +244,7 @@ end
234
244
  end
235
245
 
236
246
  assert_equal 'St. Patrick\'s Day', Date.civil(2008,3,17).holidays(:gb_nir, :informal)[0][:name]
247
+ assert_equal 'St. Andrew\'s Day', Date.civil(2008,11,30).holidays(:gb_sct, :informal)[0][:name]
237
248
 
238
249
  assert_equal 'Christmas Day', Date.civil(2008,12,25).holidays(:gb_, :observed)[0][:name]
239
250
  assert_equal 'Christmas Day', Date.civil(2009,12,25).holidays(:gb_, :observed)[0][:name]
@@ -248,6 +259,12 @@ assert_equal 'New Year\'s Day', Date.civil(2010,1,1).holidays(:gb, :observed)[0]
248
259
  assert_equal 'New Year\'s Day', Date.civil(2011,1,3).holidays(:gb, :observed)[0][:name]
249
260
  assert_equal 'New Year\'s Day', Date.civil(2012,1,2).holidays(:gb, :observed)[0][:name]
250
261
 
262
+ assert_equal '2nd January', Date.civil(2010,1,4).holidays(:gb_sct, :observed)[0][:name]
263
+ assert_equal '2nd January', Date.civil(2011,1,4).holidays(:gb_sct, :observed)[0][:name]
264
+ assert_equal '2nd January', Date.civil(2012,1,3).holidays(:gb_sct, :observed)[0][:name]
265
+ assert_equal '2nd January', Date.civil(2013,1,2).holidays(:gb_sct, :observed)[0][:name]
266
+ assert_equal '2nd January', Date.civil(2014,1,2).holidays(:gb_sct, :observed)[0][:name]
267
+
251
268
  [:gb_wls, :gb_eng, :gb_nir, :gb_eaw, :gb_].each do |r|
252
269
  assert_equal 'Easter Monday', Date.civil(2008,3,24).holidays(r)[0][:name]
253
270
  assert_equal 'Bank Holiday', Date.civil(2008,8,25).holidays(r)[0][:name]
@@ -383,11 +400,43 @@ end
383
400
  end
384
401
 
385
402
 
386
- {Date.civil(2008,1,1) => 'Nieuwjaar',
387
- Date.civil(2008,3,21) => 'Goede Vrijdag',
403
+ {Date.civil(2008,1,1) => 'Naujieji metai',
404
+ Date.civil(2008,2,16) => 'Valstybės atkūrimo diena',
405
+ Date.civil(2008,3,11) => 'Nepriklausomybės atkūrimo diena',
406
+ Date.civil(2008,3,23) => 'Šv. Velykos',
407
+ Date.civil(2008,3,24) => 'Antroji Velykų diena',
408
+ Date.civil(2008,5,1) => 'Darbininkų diena',
409
+ Date.civil(2008,6,24) => 'Joninės',
410
+ Date.civil(2008,7,6) => 'Valstybės diena',
411
+ Date.civil(2008,8,15) => 'Žolinė',
412
+ Date.civil(2008,11,1) => 'Visų šventųjų diena',
413
+ Date.civil(2008,12,24) => 'Šv. Kūčios',
414
+ Date.civil(2008,12,25) => 'Šv. Kalėdos',
415
+ Date.civil(2008,12,26) => 'Antroji Kalėdų diena'}.each do |date, name|
416
+ assert_equal name, (Holidays.on(date, :lt)[0] || {})[:name]
417
+ end
418
+ {Date.civil(2012,1,1) => 'Naujieji metai',
419
+ Date.civil(2012,2,16) => 'Valstybės atkūrimo diena',
420
+ Date.civil(2012,3,11) => 'Nepriklausomybės atkūrimo diena',
421
+ Date.civil(2012,4,8) => 'Šv. Velykos',
422
+ Date.civil(2012,4,9) => 'Antroji Velykų diena',
423
+ Date.civil(2012,5,1) => 'Darbininkų diena',
424
+ Date.civil(2012,6,24) => 'Joninės',
425
+ Date.civil(2012,7,6) => 'Valstybės diena',
426
+ Date.civil(2012,8,15) => 'Žolinė',
427
+ Date.civil(2012,11,1) => 'Visų šventųjų diena',
428
+ Date.civil(2012,12,24) => 'Šv. Kūčios',
429
+ Date.civil(2012,12,25) => 'Šv. Kalėdos',
430
+ Date.civil(2012,12,26) => 'Antroji Kalėdų diena'}.each do |date, name|
431
+ assert_equal name, (Holidays.on(date, :lt)[0] || {})[:name]
432
+ end
433
+
434
+
435
+ {Date.civil(2008,1,1) => 'Nieuwjaar',
436
+ Date.civil(2008,3,21) => 'Goede Vrijdag',
388
437
  Date.civil(2008,3,23) => 'Pasen',
389
438
  Date.civil(2008,3,24) => 'Pasen',
390
- Date.civil(2008,4,30) => 'Koninginnedag',
439
+ Date.civil(2008,4,27) => 'Koningsdag',
391
440
  Date.civil(2008,5,1) => 'Hemelvaartsdag', # Ascension, Easter+39
392
441
  Date.civil(2008,5,5) => 'Bevrijdingsdag',
393
442
  Date.civil(2008,5,11) => 'Pinksteren', # Pentecost, Easter+49
@@ -612,5 +661,31 @@ end
612
661
  assert_equal name, (Holidays.on(date, :sk, :informal)[0] || {})[:name]
613
662
  end
614
663
 
664
+
665
+ assert_equal 'velikonočna nedelja', Date.civil(2015,4,5).holidays(:si)[0][:name]
666
+ assert_equal 'velikonočna nedelja', Date.civil(2016,3,27).holidays(:si)[0][:name]
667
+
668
+ assert_equal 'velikonočni ponedeljek', Date.civil(2015,4,6).holidays(:si)[0][:name]
669
+ assert_equal 'velikonočni ponedeljek', Date.civil(2016,3,28).holidays(:si)[0][:name]
670
+
671
+ assert_equal 'binkošti', Date.civil(2015,5,24).holidays(:si)[0][:name]
672
+ assert_equal 'binkošti', Date.civil(2016,5,15).holidays(:si)[0][:name]
673
+
674
+ (2014..2020).each do |year|
675
+ {Date.civil(year,1,1) => 'novo leto',
676
+ Date.civil(year,2,8) => 'Prešernov dan, slovenski kulturni praznik',
677
+ Date.civil(year,4,27) => 'dan upora proti okupatorju',
678
+ Date.civil(year,5,1) => 'praznik dela',
679
+ Date.civil(year,5,2) => 'praznik dela',
680
+ Date.civil(year,6,25) => 'dan državnosti',
681
+ Date.civil(year,8,15) => 'Marijino vnebovzetje',
682
+ Date.civil(year,10,31) => 'dan reformacije',
683
+ Date.civil(year,11,1) => 'dan spomina na mrtve',
684
+ Date.civil(year,12,25) => 'božič',
685
+ Date.civil(2008,12,26) => 'dan samostojnosti in enotnosti'}.each do |date, name|
686
+ assert_equal name, (Holidays.on(date, :si, :informal)[0] || {})[:name]
687
+ end
688
+ end
689
+
615
690
  end
616
691
  end