holidays 4.7.0 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/CHANGELOG.md +9 -0
  4. data/CONTRIBUTING.md +21 -11
  5. data/Makefile +9 -6
  6. data/holidays.gemspec +1 -1
  7. data/lib/generated_definitions/MANIFEST +1 -0
  8. data/lib/generated_definitions/REGIONS.rb +1 -1
  9. data/lib/generated_definitions/hk.rb +112 -0
  10. data/lib/generated_definitions/kr.rb +4 -4
  11. data/lib/holidays/errors.rb +1 -0
  12. data/lib/holidays/finder/context/parse_options.rb +8 -3
  13. data/lib/holidays/load_all_definitions.rb +0 -11
  14. data/lib/holidays/version.rb +1 -1
  15. data/test/defs/test_defs_hk.rb +38 -0
  16. data/test/defs/test_defs_jp.rb +1 -0
  17. data/test/defs/test_defs_kr.rb +1 -1
  18. data/test/holidays/definition/validator/test_region.rb +4 -0
  19. data/test/holidays/finder/context/test_parse_options.rb +9 -1
  20. data/test/integration/test_all_regions.rb +4 -4
  21. data/test/integration/test_custom_holidays.rb +4 -4
  22. data/test/integration/test_holidays.rb +6 -6
  23. metadata +6 -60
  24. data/definitions/README.md +0 -353
  25. data/definitions/ar.yaml +0 -93
  26. data/definitions/at.yaml +0 -72
  27. data/definitions/au.yaml +0 -378
  28. data/definitions/be_fr.yaml +0 -69
  29. data/definitions/be_nl.yaml +0 -69
  30. data/definitions/bg.yaml +0 -127
  31. data/definitions/br.yaml +0 -77
  32. data/definitions/ca.yaml +0 -317
  33. data/definitions/ch.yaml +0 -193
  34. data/definitions/cl.yaml +0 -94
  35. data/definitions/cr.yaml +0 -65
  36. data/definitions/cz.yaml +0 -73
  37. data/definitions/de.yaml +0 -209
  38. data/definitions/dk.yaml +0 -130
  39. data/definitions/ecb_target.yaml +0 -44
  40. data/definitions/el.yaml +0 -84
  41. data/definitions/es.yaml +0 -203
  42. data/definitions/federal_reserve.yaml +0 -114
  43. data/definitions/fedex.yaml +0 -62
  44. data/definitions/fi.yaml +0 -115
  45. data/definitions/fr.yaml +0 -79
  46. data/definitions/gb.yaml +0 -151
  47. data/definitions/hr.yaml +0 -79
  48. data/definitions/hu.yaml +0 -63
  49. data/definitions/ie.yaml +0 -89
  50. data/definitions/index.yaml +0 -61
  51. data/definitions/is.yaml +0 -146
  52. data/definitions/it.yaml +0 -67
  53. data/definitions/jp.yaml +0 -321
  54. data/definitions/kr.yaml +0 -282
  55. data/definitions/li.yaml +0 -107
  56. data/definitions/lt.yaml +0 -89
  57. data/definitions/lu.yaml +0 -56
  58. data/definitions/ma.yaml +0 -52
  59. data/definitions/mx.yaml +0 -106
  60. data/definitions/my.yaml +0 -51
  61. data/definitions/nerc.yaml +0 -51
  62. data/definitions/nl.yaml +0 -73
  63. data/definitions/no.yaml +0 -90
  64. data/definitions/north_america_informal.yaml +0 -61
  65. data/definitions/nyse.yaml +0 -64
  66. data/definitions/nz.yaml +0 -163
  67. data/definitions/pe.yaml +0 -119
  68. data/definitions/ph.yaml +0 -94
  69. data/definitions/pl.yaml +0 -320
  70. data/definitions/pt.yaml +0 -89
  71. data/definitions/ro.yaml +0 -78
  72. data/definitions/se.yaml +0 -120
  73. data/definitions/sg.yaml +0 -56
  74. data/definitions/si.yaml +0 -86
  75. data/definitions/sk.yaml +0 -80
  76. data/definitions/united_nations.yaml +0 -189
  77. data/definitions/ups.yaml +0 -62
  78. data/definitions/us.yaml +0 -103
  79. data/definitions/ve.yaml +0 -74
  80. data/definitions/vi.yaml +0 -29
  81. data/definitions/za.yaml +0 -80
@@ -1,80 +0,0 @@
1
- # South African holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Updated: 2008-11-29.
4
- # Sources:
5
- # - http://en.wikipedia.org/wiki/Public_holidays_in_South_Africa
6
- # - http://www.info.gov.za/aboutsa/holidays.htm
7
- ---
8
- months:
9
- 0:
10
- - name: Good Friday
11
- regions: [za]
12
- function: easter(year)
13
- function_modifier: -2
14
- - name: Family Day
15
- regions: [za]
16
- function: easter(year)
17
- function_modifier: 1
18
- 1:
19
- - name: New Year's Day
20
- regions: [za]
21
- mday: 1
22
- observed: to_monday_if_sunday(date)
23
- 3:
24
- - name: Human Rights Day
25
- regions: [za]
26
- mday: 21
27
- observed: to_monday_if_sunday(date)
28
- 4:
29
- - name: Freedom Day
30
- regions: [za]
31
- mday: 27
32
- observed: to_monday_if_sunday(date)
33
- 5:
34
- - name: Workers Day
35
- regions: [za]
36
- mday: 1
37
- observed: to_monday_if_sunday(date)
38
- 6:
39
- - name: Youth Day
40
- regions: [za]
41
- mday: 16
42
- observed: to_monday_if_sunday(date)
43
- 8:
44
- - name: National Women's Day
45
- regions: [za]
46
- mday: 9
47
- observed: to_monday_if_sunday(date)
48
- 9:
49
- - name: Heritage Day
50
- regions: [za]
51
- mday: 24
52
- observed: to_monday_if_sunday(date)
53
- 12:
54
- - name: Day of Reconciliation
55
- regions: [za]
56
- mday: 16
57
- observed: to_monday_if_sunday(date)
58
- - name: Christmas Day
59
- regions: [za]
60
- mday: 25
61
- observed: to_monday_if_sunday(date)
62
- - name: Day of Goodwill
63
- regions: [za]
64
- mday: 26
65
- observed: to_weekday_if_boxing_weekend(date)
66
- tests: |
67
- {Date.civil(2007,1,1) => 'New Year\'s Day',
68
- Date.civil(2007,3,21) => 'Human Rights Day',
69
- Date.civil(2007,4,6) => 'Good Friday',
70
- Date.civil(2007,4,9) => 'Family Day',
71
- Date.civil(2007,4,27) => 'Freedom Day',
72
- Date.civil(2007,5,1) => 'Workers Day',
73
- Date.civil(2007,6,16) => 'Youth Day',
74
- Date.civil(2007,8,9) => 'National Women\'s Day',
75
- Date.civil(2007,9,24) => 'Heritage Day',
76
- Date.civil(2007,12,16) => 'Day of Reconciliation',
77
- Date.civil(2007,12,25) => 'Christmas Day',
78
- Date.civil(2007,12,26) => 'Day of Goodwill'}.each do |date, name|
79
- assert_equal name, (Holidays.on(date, :za, :informal)[0] || {})[:name]
80
- end