holidays 4.2.0 → 8.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (330) hide show
  1. checksums.yaml +5 -5
  2. data/.gitmodules +3 -0
  3. data/CHANGELOG.md +195 -0
  4. data/Makefile +45 -0
  5. data/README.md +253 -77
  6. data/Rakefile +10 -11
  7. data/bin/console +0 -0
  8. data/bin/setup +1 -0
  9. data/doc/CONTRIBUTING.md +72 -0
  10. data/doc/MAINTAINERS.md +81 -0
  11. data/{REFERENCES → doc/REFERENCES} +0 -0
  12. data/holidays.gemspec +9 -9
  13. data/lib/generated_definitions/MANIFEST +26 -4
  14. data/lib/generated_definitions/REGIONS.rb +3 -1
  15. data/lib/generated_definitions/ar.rb +4 -10
  16. data/lib/generated_definitions/at.rb +3 -9
  17. data/lib/generated_definitions/au.rb +32 -25
  18. data/lib/generated_definitions/be_fr.rb +2 -8
  19. data/lib/generated_definitions/be_nl.rb +2 -8
  20. data/lib/generated_definitions/bg.rb +2 -8
  21. data/lib/generated_definitions/br.rb +2 -8
  22. data/lib/generated_definitions/ca.rb +33 -32
  23. data/lib/generated_definitions/ch.rb +17 -11
  24. data/lib/generated_definitions/cl.rb +38 -12
  25. data/lib/generated_definitions/co.rb +121 -0
  26. data/lib/generated_definitions/cr.rb +2 -8
  27. data/lib/generated_definitions/cz.rb +2 -8
  28. data/lib/generated_definitions/de.rb +11 -14
  29. data/lib/generated_definitions/dk.rb +2 -8
  30. data/lib/generated_definitions/{ecb_target.rb → ecbtarget.rb} +10 -16
  31. data/lib/generated_definitions/ee.rb +36 -0
  32. data/lib/generated_definitions/el.rb +2 -8
  33. data/lib/generated_definitions/es.rb +8 -11
  34. data/lib/generated_definitions/europe.rb +121 -51
  35. data/lib/generated_definitions/federalreserve.rb +34 -0
  36. data/lib/generated_definitions/{federal_reserve.rb → federalreservebanks.rb} +14 -20
  37. data/lib/generated_definitions/fedex.rb +3 -9
  38. data/lib/generated_definitions/fi.rb +2 -8
  39. data/lib/generated_definitions/fr.rb +6 -10
  40. data/lib/generated_definitions/gb.rb +12 -16
  41. data/lib/generated_definitions/ge.rb +41 -0
  42. data/lib/generated_definitions/hk.rb +106 -0
  43. data/lib/generated_definitions/hr.rb +10 -14
  44. data/lib/generated_definitions/hu.rb +4 -9
  45. data/lib/generated_definitions/ie.rb +3 -17
  46. data/lib/generated_definitions/is.rb +3 -9
  47. data/lib/generated_definitions/it.rb +16 -13
  48. data/lib/generated_definitions/jp.rb +47 -36
  49. data/lib/generated_definitions/kr.rb +40 -0
  50. data/lib/generated_definitions/kz.rb +38 -0
  51. data/lib/generated_definitions/li.rb +2 -8
  52. data/lib/generated_definitions/lt.rb +2 -8
  53. data/lib/generated_definitions/lu.rb +35 -0
  54. data/lib/generated_definitions/lv.rb +52 -0
  55. data/lib/generated_definitions/ma.rb +2 -8
  56. data/lib/generated_definitions/mt_en.rb +38 -0
  57. data/lib/generated_definitions/mt_mt.rb +38 -0
  58. data/lib/generated_definitions/mx.rb +6 -12
  59. data/lib/generated_definitions/my.rb +30 -0
  60. data/lib/generated_definitions/nerc.rb +2 -8
  61. data/lib/generated_definitions/ng.rb +33 -0
  62. data/lib/generated_definitions/nl.rb +2 -8
  63. data/lib/generated_definitions/no.rb +2 -8
  64. data/lib/generated_definitions/northamerica.rb +223 -0
  65. data/lib/generated_definitions/nyse.rb +3 -9
  66. data/lib/generated_definitions/nz.rb +2 -9
  67. data/lib/generated_definitions/pe.rb +43 -0
  68. data/lib/generated_definitions/ph.rb +4 -10
  69. data/lib/generated_definitions/pl.rb +2 -8
  70. data/lib/generated_definitions/pt.rb +12 -12
  71. data/lib/generated_definitions/ro.rb +6 -9
  72. data/lib/generated_definitions/rs_cyrl.rb +39 -0
  73. data/lib/generated_definitions/rs_la.rb +39 -0
  74. data/lib/generated_definitions/ru.rb +37 -0
  75. data/lib/generated_definitions/scandinavia.rb +3 -9
  76. data/lib/generated_definitions/se.rb +2 -8
  77. data/lib/generated_definitions/sg.rb +2 -8
  78. data/lib/generated_definitions/si.rb +2 -8
  79. data/lib/generated_definitions/sk.rb +2 -8
  80. data/lib/generated_definitions/southamerica.rb +228 -0
  81. data/lib/generated_definitions/th.rb +36 -0
  82. data/lib/generated_definitions/tn.rb +32 -0
  83. data/lib/generated_definitions/tr.rb +64 -0
  84. data/lib/generated_definitions/ua.rb +37 -0
  85. data/lib/generated_definitions/{united_nations.rb → unitednations.rb} +61 -67
  86. data/lib/generated_definitions/ups.rb +3 -9
  87. data/lib/generated_definitions/us.rb +113 -23
  88. data/lib/generated_definitions/ve.rb +2 -8
  89. data/lib/generated_definitions/vi.rb +6 -11
  90. data/lib/generated_definitions/za.rb +2 -8
  91. data/lib/holidays/core_extensions/date.rb +21 -3
  92. data/lib/holidays/core_extensions/time.rb +23 -0
  93. data/lib/holidays/date_calculator/day_of_month.rb +3 -3
  94. data/lib/holidays/date_calculator/lunar_date.rb +371 -0
  95. data/lib/holidays/date_calculator/weekend_modifier.rb +0 -7
  96. data/lib/holidays/definition/context/function_processor.rb +91 -0
  97. data/lib/holidays/definition/context/generator.rb +37 -96
  98. data/lib/holidays/definition/context/load.rb +29 -0
  99. data/lib/holidays/definition/context/merger.rb +0 -4
  100. data/lib/holidays/definition/decorator/test.rb +37 -0
  101. data/lib/holidays/definition/entity/test.rb +11 -0
  102. data/lib/holidays/definition/generator/module.rb +54 -0
  103. data/lib/holidays/definition/generator/regions.rb +55 -0
  104. data/lib/holidays/definition/generator/test.rb +51 -0
  105. data/lib/holidays/definition/parser/custom_method.rb +3 -5
  106. data/lib/holidays/definition/parser/test.rb +86 -0
  107. data/lib/holidays/definition/repository/cache.rb +23 -9
  108. data/lib/holidays/definition/repository/holidays_by_month.rb +10 -2
  109. data/lib/holidays/definition/repository/proc_result_cache.rb +1 -1
  110. data/lib/holidays/definition/repository/regions.rb +23 -13
  111. data/lib/holidays/definition/validator/custom_method.rb +1 -1
  112. data/lib/holidays/definition/validator/region.rb +2 -11
  113. data/lib/holidays/definition/validator/test.rb +71 -0
  114. data/lib/holidays/errors.rb +5 -0
  115. data/lib/holidays/factory/date_calculator.rb +42 -0
  116. data/lib/holidays/factory/definition.rb +143 -0
  117. data/lib/holidays/factory/finder.rb +70 -0
  118. data/lib/holidays/finder/context/between.rb +45 -0
  119. data/lib/holidays/{use_case → finder}/context/dates_driver_builder.rb +11 -15
  120. data/lib/holidays/finder/context/next_holiday.rb +57 -0
  121. data/lib/holidays/finder/context/parse_options.rb +104 -0
  122. data/lib/holidays/finder/context/search.rb +110 -0
  123. data/lib/holidays/finder/context/year_holiday.rb +57 -0
  124. data/lib/holidays/finder/rules/in_region.rb +31 -0
  125. data/lib/holidays/finder/rules/year_range.rb +58 -0
  126. data/lib/holidays/load_all_definitions.rb +16 -17
  127. data/lib/holidays/version.rb +1 -1
  128. data/lib/holidays.rb +50 -125
  129. data/test/coverage_report.rb +26 -0
  130. data/test/data/test_custom_informal_holidays_defs.yaml +11 -0
  131. data/test/data/test_custom_year_range_holiday_defs.yaml +13 -10
  132. data/test/data/test_invalid_region.rb +15 -0
  133. data/test/data/test_multiple_custom_holiday_defs.yaml +7 -4
  134. data/test/data/test_multiple_regions_with_conflicts_region_1.yaml +38 -0
  135. data/test/data/test_multiple_regions_with_conflicts_region_2.yaml +38 -0
  136. data/test/data/test_region.rb +15 -0
  137. data/test/data/test_single_custom_holiday_defs.yaml +7 -4
  138. data/test/data/test_single_custom_holiday_with_custom_procs.yaml +11 -7
  139. data/test/defs/test_defs_ar.rb +41 -19
  140. data/test/defs/test_defs_at.rb +18 -11
  141. data/test/defs/test_defs_au.rb +185 -126
  142. data/test/defs/test_defs_be_fr.rb +33 -14
  143. data/test/defs/test_defs_be_nl.rb +33 -14
  144. data/test/defs/test_defs_bg.rb +29 -17
  145. data/test/defs/test_defs_br.rb +33 -19
  146. data/test/defs/test_defs_ca.rb +246 -136
  147. data/test/defs/test_defs_ch.rb +35 -23
  148. data/test/defs/test_defs_cl.rb +57 -27
  149. data/test/defs/test_defs_co.rb +113 -0
  150. data/test/defs/test_defs_cr.rb +17 -11
  151. data/test/defs/test_defs_cz.rb +25 -15
  152. data/test/defs/test_defs_de.rb +60 -59
  153. data/test/defs/test_defs_dk.rb +31 -19
  154. data/test/defs/test_defs_ecbtarget.rb +27 -0
  155. data/test/defs/test_defs_ee.rb +41 -0
  156. data/test/defs/test_defs_el.rb +29 -17
  157. data/test/defs/test_defs_es.rb +116 -52
  158. data/test/defs/test_defs_europe.rb +1382 -701
  159. data/test/defs/test_defs_federalreserve.rb +113 -0
  160. data/test/defs/test_defs_federalreservebanks.rb +247 -0
  161. data/test/defs/test_defs_fedex.rb +19 -12
  162. data/test/defs/test_defs_fi.rb +47 -27
  163. data/test/defs/test_defs_fr.rb +31 -18
  164. data/test/defs/test_defs_gb.rb +120 -51
  165. data/test/defs/test_defs_ge.rb +53 -0
  166. data/test/defs/test_defs_hk.rb +59 -0
  167. data/test/defs/test_defs_hr.rb +32 -18
  168. data/test/defs/test_defs_hu.rb +34 -16
  169. data/test/defs/test_defs_ie.rb +41 -25
  170. data/test/defs/test_defs_is.rb +39 -22
  171. data/test/defs/test_defs_it.rb +43 -14
  172. data/test/defs/test_defs_jp.rb +141 -55
  173. data/test/defs/test_defs_kr.rb +37 -0
  174. data/test/defs/test_defs_kz.rb +39 -0
  175. data/test/defs/test_defs_li.rb +20 -20
  176. data/test/defs/test_defs_lt.rb +51 -30
  177. data/test/defs/test_defs_lu.rb +35 -0
  178. data/test/defs/test_defs_lv.rb +90 -0
  179. data/test/defs/test_defs_ma.rb +17 -11
  180. data/test/defs/test_defs_mt_en.rb +41 -0
  181. data/test/defs/test_defs_mt_mt.rb +41 -0
  182. data/test/defs/test_defs_mx.rb +34 -23
  183. data/test/defs/test_defs_my.rb +23 -0
  184. data/test/defs/test_defs_nerc.rb +17 -11
  185. data/test/defs/test_defs_ng.rb +29 -0
  186. data/test/defs/test_defs_nl.rb +21 -13
  187. data/test/defs/test_defs_no.rb +31 -18
  188. data/test/defs/test_defs_northamerica.rb +644 -0
  189. data/test/defs/test_defs_nyse.rb +27 -11
  190. data/test/defs/test_defs_nz.rb +47 -28
  191. data/test/defs/test_defs_pe.rb +47 -0
  192. data/test/defs/test_defs_ph.rb +17 -13
  193. data/test/defs/test_defs_pl.rb +200 -119
  194. data/test/defs/test_defs_pt.rb +35 -15
  195. data/test/defs/test_defs_ro.rb +53 -24
  196. data/test/defs/test_defs_rs_cyrl.rb +46 -0
  197. data/test/defs/test_defs_rs_la.rb +46 -0
  198. data/test/defs/test_defs_ru.rb +34 -0
  199. data/test/defs/test_defs_scandinavia.rb +193 -116
  200. data/test/defs/test_defs_se.rb +47 -28
  201. data/test/defs/test_defs_sg.rb +13 -9
  202. data/test/defs/test_defs_si.rb +93 -24
  203. data/test/defs/test_defs_sk.rb +29 -17
  204. data/test/defs/test_defs_southamerica.rb +307 -0
  205. data/test/defs/test_defs_th.rb +33 -0
  206. data/test/defs/test_defs_tn.rb +27 -0
  207. data/test/defs/test_defs_tr.rb +60 -0
  208. data/test/defs/test_defs_ua.rb +41 -0
  209. data/test/defs/{test_defs_united_nations.rb → test_defs_unitednations.rb} +3 -4
  210. data/test/defs/test_defs_ups.rb +19 -12
  211. data/test/defs/test_defs_us.rb +370 -30
  212. data/test/defs/test_defs_ve.rb +23 -16
  213. data/test/defs/test_defs_vi.rb +10 -6
  214. data/test/defs/test_defs_za.rb +23 -14
  215. data/test/holidays/core_extensions/test_date.rb +3 -2
  216. data/test/holidays/core_extensions/test_date_time.rb +60 -0
  217. data/test/holidays/date_calculator/test_lunar_date.rb +89 -0
  218. data/test/holidays/definition/context/test_function_processor.rb +199 -0
  219. data/test/holidays/definition/context/test_generator.rb +66 -35
  220. data/test/holidays/definition/context/test_load.rb +37 -0
  221. data/test/holidays/definition/decorator/test_test.rb +123 -0
  222. data/test/holidays/definition/generator/test_module.rb +268 -0
  223. data/test/holidays/definition/generator/test_regions.rb +97 -0
  224. data/test/holidays/definition/generator/test_test.rb +113 -0
  225. data/test/holidays/definition/parser/test_custom_method.rb +6 -6
  226. data/test/holidays/definition/parser/test_test.rb +142 -0
  227. data/test/holidays/definition/repository/test_cache.rb +47 -6
  228. data/test/holidays/definition/repository/test_holidays_by_month.rb +121 -1
  229. data/test/holidays/definition/repository/test_proc_result_cache.rb +8 -1
  230. data/test/holidays/definition/repository/test_regions.rb +31 -13
  231. data/test/holidays/definition/validator/test_custom_method.rb +5 -0
  232. data/test/holidays/definition/validator/test_region.rb +16 -12
  233. data/test/holidays/definition/validator/test_test.rb +60 -0
  234. data/test/holidays/finder/context/test_between.rb +172 -0
  235. data/test/holidays/{use_case → finder}/context/test_dates_driver_builder.rb +2 -2
  236. data/test/holidays/finder/context/test_next_holiday.rb +156 -0
  237. data/test/holidays/finder/context/test_parse_options.rb +141 -0
  238. data/test/holidays/finder/context/test_search.rb +232 -0
  239. data/test/holidays/finder/context/test_year_holiday.rb +202 -0
  240. data/test/holidays/finder/rules/test_in_region.rb +42 -0
  241. data/test/holidays/finder/rules/test_year_range.rb +166 -0
  242. data/test/integration/README.md +9 -0
  243. data/test/{test_all_regions.rb → integration/test_all_regions.rb} +18 -4
  244. data/test/integration/test_any_holidays_during_work_week.rb +90 -0
  245. data/test/integration/test_available_regions.rb +23 -0
  246. data/test/{test_custom_holidays.rb → integration/test_custom_holidays.rb} +6 -6
  247. data/test/integration/test_custom_informal_holidays.rb +15 -0
  248. data/test/{test_custom_year_range_holidays.rb → integration/test_custom_year_range_holidays.rb} +1 -9
  249. data/test/{test_holidays.rb → integration/test_holidays.rb} +100 -69
  250. data/test/{test_holidays_between.rb → integration/test_holidays_between.rb} +19 -17
  251. data/test/integration/test_multiple_regions.rb +71 -0
  252. data/test/integration/test_multiple_regions_with_conflict.rb +29 -0
  253. data/test/integration/test_nonstandard_regions.rb +25 -0
  254. data/test/test_helper.rb +7 -3
  255. metadata +204 -132
  256. data/CONTRIBUTING.md +0 -41
  257. data/benchmark.rb +0 -8
  258. data/definitions/README.md +0 -353
  259. data/definitions/ar.yaml +0 -93
  260. data/definitions/at.yaml +0 -72
  261. data/definitions/au.yaml +0 -375
  262. data/definitions/be_fr.yaml +0 -69
  263. data/definitions/be_nl.yaml +0 -69
  264. data/definitions/bg.yaml +0 -127
  265. data/definitions/br.yaml +0 -77
  266. data/definitions/ca.yaml +0 -302
  267. data/definitions/ch.yaml +0 -193
  268. data/definitions/cl.yaml +0 -94
  269. data/definitions/cr.yaml +0 -65
  270. data/definitions/cz.yaml +0 -73
  271. data/definitions/de.yaml +0 -209
  272. data/definitions/dk.yaml +0 -130
  273. data/definitions/ecb_target.yaml +0 -44
  274. data/definitions/el.yaml +0 -84
  275. data/definitions/es.yaml +0 -203
  276. data/definitions/federal_reserve.yaml +0 -114
  277. data/definitions/fedex.yaml +0 -62
  278. data/definitions/fi.yaml +0 -115
  279. data/definitions/fr.yaml +0 -79
  280. data/definitions/gb.yaml +0 -151
  281. data/definitions/hr.yaml +0 -79
  282. data/definitions/hu.yaml +0 -63
  283. data/definitions/ie.yaml +0 -89
  284. data/definitions/index.yaml +0 -57
  285. data/definitions/is.yaml +0 -146
  286. data/definitions/it.yaml +0 -67
  287. data/definitions/jp.yaml +0 -316
  288. data/definitions/li.yaml +0 -107
  289. data/definitions/lt.yaml +0 -89
  290. data/definitions/ma.yaml +0 -52
  291. data/definitions/mx.yaml +0 -106
  292. data/definitions/nerc.yaml +0 -51
  293. data/definitions/nl.yaml +0 -73
  294. data/definitions/no.yaml +0 -90
  295. data/definitions/north_america_informal.yaml +0 -61
  296. data/definitions/nyse.yaml +0 -64
  297. data/definitions/nz.yaml +0 -163
  298. data/definitions/ph.yaml +0 -94
  299. data/definitions/pl.yaml +0 -320
  300. data/definitions/pt.yaml +0 -69
  301. data/definitions/ro.yaml +0 -78
  302. data/definitions/se.yaml +0 -120
  303. data/definitions/sg.yaml +0 -56
  304. data/definitions/si.yaml +0 -86
  305. data/definitions/sk.yaml +0 -80
  306. data/definitions/united_nations.yaml +0 -189
  307. data/definitions/ups.yaml +0 -62
  308. data/definitions/us.yaml +0 -103
  309. data/definitions/ve.yaml +0 -74
  310. data/definitions/vi.yaml +0 -29
  311. data/definitions/za.yaml +0 -80
  312. data/lib/generated_definitions/north_america.rb +0 -126
  313. data/lib/holidays/date_calculator_factory.rb +0 -35
  314. data/lib/holidays/definition_factory.rb +0 -86
  315. data/lib/holidays/option/context/parse_options.rb +0 -106
  316. data/lib/holidays/option_factory.rb +0 -15
  317. data/lib/holidays/use_case/context/between.rb +0 -45
  318. data/lib/holidays/use_case/context/context_common.rb +0 -123
  319. data/lib/holidays/use_case/context/next_holiday.rb +0 -54
  320. data/lib/holidays/use_case_factory.rb +0 -31
  321. data/test/defs/test_defs_ecb_target.rb +0 -23
  322. data/test/defs/test_defs_federal_reserve.rb +0 -69
  323. data/test/defs/test_defs_north_america.rb +0 -195
  324. data/test/holidays/option/context/test_parse_options.rb +0 -74
  325. data/test/holidays/test_date_calculator_factory.rb +0 -27
  326. data/test/holidays/test_definition_factory.rb +0 -49
  327. data/test/holidays/test_option_factory.rb +0 -9
  328. data/test/holidays/test_use_case_factory.rb +0 -13
  329. data/test/holidays/use_case/context/test_between.rb +0 -77
  330. data/test/test_multiple_regions.rb +0 -24
data/definitions/si.yaml DELETED
@@ -1,86 +0,0 @@
1
- # Slovenia holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Updated: 2014-04-09.
4
- # Sources:
5
- # - http://en.wikipedia.org/wiki/Public_holidays_in_Slovenia
6
-
7
- months:
8
- 0:
9
- - name: velikonočna nedelja
10
- regions: [si]
11
- function: easter(year)
12
- - name: velikonočni ponedeljek
13
- regions: [si]
14
- function: easter(year)
15
- function_modifier: 1
16
- - name: binkošti
17
- regions: [si]
18
- function: easter(year)
19
- function_modifier: 49
20
- 1:
21
- - name: novo leto
22
- regions: [si]
23
- mday: 1
24
- 2:
25
- - name: Prešernov dan, slovenski kulturni praznik
26
- regions: [si]
27
- mday: 8
28
- 4:
29
- - name: dan upora proti okupatorju
30
- regions: [si]
31
- mday: 27
32
- 5:
33
- - name: praznik dela
34
- regions: [si]
35
- mday: 1
36
- - name: praznik dela
37
- regions: [si]
38
- mday: 2
39
- 6:
40
- - name: dan državnosti
41
- regions: [si]
42
- mday: 25
43
- 8:
44
- - name: Marijino vnebovzetje
45
- regions: [si]
46
- mday: 15
47
- 10:
48
- - name: dan reformacije
49
- regions: [si]
50
- mday: 31
51
- 11:
52
- - name: dan spomina na mrtve
53
- regions: [si]
54
- mday: 1
55
- 12:
56
- - name: božič
57
- regions: [si]
58
- mday: 25
59
- - name: dan samostojnosti in enotnosti
60
- regions: [si]
61
- mday: 26
62
- tests: |
63
- assert_equal 'velikonočna nedelja', Holidays.on(Date.civil(2015,4,5), :si)[0][:name]
64
- assert_equal 'velikonočna nedelja', Holidays.on(Date.civil(2016,3,27), :si)[0][:name]
65
-
66
- assert_equal 'velikonočni ponedeljek', Holidays.on(Date.civil(2015,4,6), :si)[0][:name]
67
- assert_equal 'velikonočni ponedeljek', Holidays.on(Date.civil(2016,3,28), :si)[0][:name]
68
-
69
- assert_equal 'binkošti', Holidays.on(Date.civil(2015,5,24), :si)[0][:name]
70
- assert_equal 'binkošti', Holidays.on(Date.civil(2016,5,15), :si)[0][:name]
71
-
72
- (2014..2020).each do |year|
73
- {Date.civil(year,1,1) => 'novo leto',
74
- Date.civil(year,2,8) => 'Prešernov dan, slovenski kulturni praznik',
75
- Date.civil(year,4,27) => 'dan upora proti okupatorju',
76
- Date.civil(year,5,1) => 'praznik dela',
77
- Date.civil(year,5,2) => 'praznik dela',
78
- Date.civil(year,6,25) => 'dan državnosti',
79
- Date.civil(year,8,15) => 'Marijino vnebovzetje',
80
- Date.civil(year,10,31) => 'dan reformacije',
81
- Date.civil(year,11,1) => 'dan spomina na mrtve',
82
- Date.civil(year,12,25) => 'božič',
83
- Date.civil(2008,12,26) => 'dan samostojnosti in enotnosti'}.each do |date, name|
84
- assert_equal name, (Holidays.on(date, :si, :informal)[0] || {})[:name]
85
- end
86
- end
data/definitions/sk.yaml DELETED
@@ -1,80 +0,0 @@
1
- # Slovak holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Updated: 2013-12-26.
4
- # Sources:
5
- # - http://sk.wikipedia.org/wiki/Slovensk%C3%A9_%C5%A1t%C3%A1tne_sviatky
6
- ---
7
- months:
8
- 0:
9
- - name: Veľkonočný pondelok
10
- regions: [sk]
11
- function: easter(year)
12
- function_modifier: 1
13
- - name: Veľký piatok
14
- regions: [sk]
15
- function: easter(year)
16
- function_modifier: -2
17
- 1:
18
- - name: Nový rok
19
- regions: [sk]
20
- mday: 1
21
- - name: Zjavenie Pána (Traja králi)
22
- regions: [sk]
23
- mday: 6
24
- 5:
25
- - name: Sviatok práce
26
- regions: [sk]
27
- mday: 1
28
- - name: Deň víťazstva nad fašizmom
29
- regions: [sk]
30
- mday: 8
31
- 7:
32
- - name: Sviatok svätého Cyrila a svätého Metoda
33
- regions: [sk]
34
- mday: 5
35
- 8:
36
- - name: Výročie Slovenského národného povstania
37
- regions: [sk]
38
- mday: 29
39
- 9:
40
- - name: Deň Ústavy Slovenskej republiky
41
- regions: [sk]
42
- mday: 1
43
- - name: Sedembolestná Panna Mária
44
- regions: [sk]
45
- mday: 15
46
- 11:
47
- - name: Sviatok všetkých svätých
48
- regions: [sk]
49
- mday: 1
50
- - name: Deň boja za slobodu a demokraciu
51
- regions: [sk]
52
- mday: 17
53
- 12:
54
- - name: Štedrý deň
55
- regions: [sk]
56
- mday: 24
57
- - name: 1. sviatok vianočný
58
- regions: [sk]
59
- mday: 25
60
- - name: 2. sviatok vianočný
61
- regions: [sk]
62
- mday: 26
63
- tests: |
64
- {Date.civil(2013,1,1) => 'Nový rok',
65
- Date.civil(2013,1,6) => 'Zjavenie Pána (Traja králi)',
66
- Date.civil(2013,3,29) => 'Veľký piatok',
67
- Date.civil(2013,4,1) => 'Veľkonočný pondelok',
68
- Date.civil(2013,5,1) => 'Sviatok práce',
69
- Date.civil(2013,5,8) => 'Deň víťazstva nad fašizmom',
70
- Date.civil(2013,7,5) => 'Sviatok svätého Cyrila a svätého Metoda',
71
- Date.civil(2013,8,29) => 'Výročie Slovenského národného povstania',
72
- Date.civil(2013,9,1) => 'Deň Ústavy Slovenskej republiky',
73
- Date.civil(2013,9,15) => 'Sedembolestná Panna Mária',
74
- Date.civil(2013,11,1) => 'Sviatok všetkých svätých',
75
- Date.civil(2013,11,17) => 'Deň boja za slobodu a demokraciu',
76
- Date.civil(2013,12,24) => 'Štedrý deň',
77
- Date.civil(2013,12,25) => '1. sviatok vianočný',
78
- Date.civil(2013,12,26) => '2. sviatok vianočný'}.each do |date, name|
79
- assert_equal name, (Holidays.on(date, :sk, :informal)[0] || {})[:name]
80
- end
@@ -1,189 +0,0 @@
1
- # United Nationas holiday definitions for the Ruby Holiday gem.
2
- # Updated 2008-11-21.
3
- ---
4
- months:
5
- 2:
6
- - name: International Mother Language Day
7
- regions: [united_nations]
8
- mday: 2
9
- 3:
10
- - name: United Nations Day for Women's Rights and International Peace
11
- regions: [united_nations]
12
- mday: 8
13
- - name: International Day for the Elimination of Racial Discrimination
14
- regions: [united_nations]
15
- mday: 21
16
- - name: Beginning of the Week of Solidarity with the Peoples Struggling against Racism and Racial Discrimination
17
- regions: [united_nations]
18
- mday: 21
19
- - name: World Day for Water
20
- regions: [united_nations]
21
- mday: 22
22
- - name: World Meteorological Day
23
- regions: [united_nations]
24
- mday: 23
25
- 4:
26
- - name: World Health Day
27
- regions: [united_nations]
28
- mday: 7
29
- - name: World Book and Copyright Day
30
- regions: [united_nations]
31
- mday: 23
32
- 5:
33
- - name: World Press Freedom Day
34
- regions: [united_nations]
35
- mday: 3
36
- - name: International Day of Families
37
- regions: [united_nations]
38
- mday: 15
39
- - name: World Telecommunication Day
40
- regions: [united_nations]
41
- mday: 17
42
- - name: World Day for Cultural Diversity for Dialogue and Development
43
- regions: [united_nations]
44
- mday: 21
45
- - name: International Day for Biological Diversity
46
- regions: [united_nations]
47
- mday: 22
48
- - name: Beginning of the Week of Solidarity with the Peoples of Non-Self-Governing Territories
49
- regions: [united_nations]
50
- mday: 25
51
- - name: International Day of United Nations Peacekeepers
52
- regions: [united_nations]
53
- mday: 29
54
- - name: World No-Tobacco Day
55
- regions: [united_nations]
56
- mday: 31
57
- 6:
58
- - name: International Day of Innocent Children Victims of Aggression
59
- regions: [united_nations]
60
- mday: 4
61
- - name: World Environment Day
62
- regions: [united_nations]
63
- mday: 5
64
- - name: World Day to Combat Desertification and Drought
65
- regions: [united_nations]
66
- mday: 17
67
- - name: World Refugee Day
68
- regions: [united_nations]
69
- mday: 20
70
- - name: United Nations Public Service Day
71
- regions: [united_nations]
72
- mday: 23
73
- - name: International Day against Drug Abuse and Illicit Trafficking
74
- regions: [united_nations]
75
- mday: 26
76
- - name: International Day in Support of Victims of Torture
77
- regions: [united_nations]
78
- mday: 26
79
- 7:
80
- - name: International Day of Cooperatives
81
- week: 1
82
- regions: [united_nations]
83
- wday: 6
84
- - name: World Population Day
85
- regions: [united_nations]
86
- mday: 11
87
- 8:
88
- - name: International Day of the World's Indigenous People
89
- regions: [united_nations]
90
- mday: 9
91
- - name: International Youth Day
92
- regions: [united_nations]
93
- mday: 12
94
- - name: International Day for the Remembrance of the Slave Trade and Its Abolition
95
- regions: [united_nations]
96
- mday: 23
97
- 9:
98
- - name: International Literacy Day
99
- regions: [united_nations]
100
- mday: 8
101
- - name: International Day for the Preservation of the Ozone Layer
102
- regions: [united_nations]
103
- mday: 16
104
- - name: International Day of Peace
105
- regions: [united_nations]
106
- mday: 21
107
- - name: International Day of Older Persons
108
- regions: [united_nations]
109
- mday: 1
110
- 10:
111
- - name: World Space Week
112
- regions: [united_nations]
113
- mday: 4
114
- - name: World Teachers' Day
115
- regions: [united_nations]
116
- mday: 5
117
- - name: World Habitat Day
118
- week: 1
119
- regions: [united_nations]
120
- wday: 1
121
- - name: International Day for Natural Disaster Reduction
122
- week: 2
123
- regions: [united_nations]
124
- wday: 3
125
- - name: World Post Day
126
- regions: [united_nations]
127
- mday: 9
128
- - name: World Mental Health Day
129
- regions: [united_nations]
130
- mday: 10
131
- - name: World Food Day
132
- regions: [united_nations]
133
- mday: 16
134
- - name: International Day for the Eradication of Poverty
135
- regions: [united_nations]
136
- mday: 17
137
- - name: United Nations Day
138
- regions: [united_nations]
139
- mday: 24
140
- - name: World Development Information Day
141
- regions: [united_nations]
142
- mday: 24
143
- - name: Disarmament Week
144
- regions: [united_nations]
145
- mday: 24
146
- 11:
147
- - name: International Day for Preventing the Exploitation of the Environment in War and Armed Conflict
148
- regions: [united_nations]
149
- mday: 6
150
- - name: International Day for Tolerance
151
- regions: [united_nations]
152
- mday: 16
153
- - name: Africa Industrialization Day
154
- regions: [united_nations]
155
- mday: 20
156
- - name: Universal Children's Day
157
- regions: [united_nations]
158
- mday: 20
159
- - name: World Television Day
160
- regions: [united_nations]
161
- mday: 21
162
- - name: International Day for the Elimination of Violence against Women
163
- regions: [united_nations]
164
- mday: 25
165
- - name: International Day of Solidarity with the Palestinian People
166
- regions: [united_nations]
167
- mday: 29
168
- 12:
169
- - name: World AIDS Day
170
- regions: [united_nations]
171
- mday: 1
172
- - name: International Day for the Abolition of Slavery
173
- regions: [united_nations]
174
- mday: 2
175
- - name: International Day of Disabled Persons
176
- regions: [united_nations]
177
- mday: 3
178
- - name: International Volunteer Day for Economic and Social Development
179
- regions: [united_nations]
180
- mday: 5
181
- - name: International Civil Aviation Day
182
- regions: [united_nations]
183
- mday: 7
184
- - name: Human Rights Day
185
- regions: [united_nations]
186
- mday: 10
187
- - name: International Migrants Day
188
- regions: [united_nations]
189
- mday: 18
data/definitions/ups.yaml DELETED
@@ -1,62 +0,0 @@
1
- # UPS holiday definitions for the Ruby Holiday gem.
2
- #
3
- # By Tim Anglade
4
- #
5
- # Updated: 2008-09-23.
6
- # Source: http://www.ups.com/content/us/en/resources/ship/imp_exp/operation.html
7
- ---
8
- months:
9
- 1:
10
- - name: New Year's Day
11
- regions: [ups]
12
- mday: 1
13
- observed: to_weekday_if_weekend(date)
14
- 5:
15
- - name: Memorial Day
16
- week: -1
17
- regions: [ups]
18
- wday: 1
19
- 7:
20
- - name: Independence Day
21
- regions: [ups]
22
- mday: 4
23
- observed: to_weekday_if_weekend(date)
24
- 9:
25
- - name: Labor Day
26
- week: 1
27
- regions: [ups]
28
- wday: 1
29
- 11:
30
- - name: Thanksgiving
31
- week: 4
32
- regions: [ups]
33
- wday: 4
34
- - name: Day After Thanksgiving
35
- function: day_after_thanksgiving(year)
36
- regions: [ups]
37
- 12:
38
- - name: Christmas Day
39
- regions: [ups]
40
- mday: 25
41
- observed: to_weekday_if_weekend(date)
42
- - name: New Year's Eve
43
- regions: [ups]
44
- mday: 31
45
- methods:
46
- day_after_thanksgiving:
47
- arguments: year
48
- source: |
49
- Holidays::DateCalculatorFactory.day_of_month_calculator.call(year, 11, 4, 4) + 1
50
- tests: |
51
- {Date.civil(2008,1,1) => 'New Year\'s Day',
52
- Date.civil(2008,5,26) => 'Memorial Day',
53
- Date.civil(2008,7,4) => 'Independence Day',
54
- Date.civil(2008,9,1) => 'Labor Day',
55
- Date.civil(2008,11,27) => 'Thanksgiving',
56
- Date.civil(2008,11,28) => 'Day After Thanksgiving',
57
- Date.civil(2013,11,28) => 'Thanksgiving',
58
- Date.civil(2013,11,29) => 'Day After Thanksgiving',
59
- Date.civil(2008,12,25) => 'Christmas Day',
60
- Date.civil(2008,12,31) => 'New Year\'s Eve',}.each do |date, name|
61
- assert_equal name, (Holidays.on(date, :ups)[0] || {})[:name]
62
- end
data/definitions/us.yaml DELETED
@@ -1,103 +0,0 @@
1
- # United States holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Updated: 2008-11-24.
4
- # Source: http://en.wikipedia.org/wiki/Public_holidays_of_the_United_States
5
- ---
6
- months:
7
- 0:
8
- - name: Good Friday
9
- regions: [us]
10
- function: easter(year)
11
- function_modifier: -2
12
- type: informal
13
- - name: Easter Sunday
14
- regions: [us]
15
- function: easter(year)
16
- type: informal
17
- 1:
18
- - name: New Year's Day
19
- regions: [us]
20
- mday: 1
21
- observed: to_weekday_if_weekend(date)
22
- - name: Martin Luther King, Jr. Day
23
- week: 3
24
- regions: [us]
25
- wday: 1
26
- - name: Inauguration Day
27
- function: us_inauguration_day(year)
28
- regions: [us_dc]
29
- 2:
30
- - name: Presidents' Day
31
- week: 3
32
- regions: [us]
33
- wday: 1
34
- 3:
35
- - name: 'Cesar Chavez Day'
36
- regions: [us_ca]
37
- mday: 31
38
- 5:
39
- - name: Memorial Day
40
- week: -1
41
- regions: [us]
42
- wday: 1
43
- 7:
44
- - name: Independence Day
45
- regions: [us]
46
- mday: 4
47
- observed: to_weekday_if_weekend(date)
48
- 9:
49
- - name: Labor Day
50
- week: 1
51
- regions: [us]
52
- wday: 1
53
- 10:
54
- - name: Columbus Day
55
- week: 2
56
- regions: [us]
57
- wday: 1
58
- 11:
59
- - name: Veterans Day
60
- regions: [us]
61
- mday: 11
62
- observed: to_weekday_if_weekend(date)
63
- - name: Thanksgiving
64
- week: 4
65
- regions: [us]
66
- wday: 4
67
- - name: Day after Thanksgiving
68
- function: day_after_thanksgiving(year)
69
- regions: [us_ca]
70
- 12:
71
- - name: Christmas Day
72
- regions: [us]
73
- mday: 25
74
- observed: to_weekday_if_weekend(date)
75
- methods:
76
- us_inauguration_day:
77
- # January 20, every fourth year, following Presidential election
78
- arguments: year
79
- source: |
80
- year % 4 == 1 ? 20 : nil
81
- day_after_thanksgiving:
82
- arguments: year
83
- source: |
84
- Holidays::DateCalculatorFactory.day_of_month_calculator.call(year, 11, 4, 4) + 1
85
- tests: |
86
- {Date.civil(2008,1,1) => 'New Year\'s Day',
87
- Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
88
- Date.civil(2008,2,18) => 'Presidents\' Day',
89
- Date.civil(2008,5,26) => 'Memorial Day',
90
- Date.civil(2008,7,4) => 'Independence Day',
91
- Date.civil(2008,9,1) => 'Labor Day',
92
- Date.civil(2008,10,13) => 'Columbus Day',
93
- Date.civil(2008,11,11) => 'Veterans Day',
94
- Date.civil(2008,11,27) => 'Thanksgiving',
95
- Date.civil(2013,11,28) => 'Thanksgiving',
96
- Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
97
- assert_equal name, (Holidays.on(date, :us)[0] || {})[:name]
98
- end
99
- {Date.civil(2008, 3, 31) => 'Cesar Chavez Day',
100
- Date.civil(2008, 11, 28) => 'Day after Thanksgiving',
101
- Date.civil(2013, 11, 29) => 'Day after Thanksgiving'}.each do |date, name|
102
- assert_equal name, (Holidays.on(date, :us, :us_ca)[0] || {})[:name]
103
- end
data/definitions/ve.yaml DELETED
@@ -1,74 +0,0 @@
1
- # Venezuela holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Just including nonworking days nationally
4
- #
5
- # Updated: 2012-09-14.
6
- # Source: http://venciclopedia.com/index.php?title=D%C3%ADas_feriados_de_Venezuela
7
- ---
8
- months:
9
- 0:
10
- - name: Lunes Carnaval
11
- regions: [ve]
12
- function: easter(year)
13
- function_modifier: -48
14
- - name: Martes Carnaval
15
- regions: [ve]
16
- function: easter(year)
17
- function_modifier: -47
18
- - name: Jueves Santo
19
- regions: [ve]
20
- function: easter(year)
21
- function_modifier: -3
22
- - name: Viernes Santo
23
- regions: [ve]
24
- function: easter(year)
25
- function_modifier: -2
26
- 1:
27
- - name: Año Nuevo
28
- regions: [ve]
29
- mday: 1
30
- 4:
31
- - name: Declaración Independencia
32
- regions: [ve]
33
- mday: 19
34
- 5:
35
- - name: Día del Trabajador
36
- regions: [ve]
37
- mday: 1
38
- 6:
39
- - name: Aniversario Batalla de Carabobo
40
- regions: [ve]
41
- mday: 24
42
- 7:
43
- - name: Día de la Independencia
44
- regions: [ve]
45
- mday: 5
46
- - name: Natalicio de Simón Bolívar
47
- regions: [ve]
48
- mday: 24
49
- 10:
50
- - name: Día de la Resistencia Indígena
51
- regions: [ve]
52
- mday: 12
53
- 12:
54
- - name: Día de Navidad
55
- regions: [ve]
56
- mday: 25
57
-
58
- tests: |
59
- {
60
- Date.civil(2013, 1, 1) => "Año Nuevo",
61
- Date.civil(2013, 2, 11) => "Lunes Carnaval",
62
- Date.civil(2013, 2, 12) => "Martes Carnaval",
63
- Date.civil(2013, 3, 28) => "Jueves Santo",
64
- Date.civil(2013, 3, 29) => "Viernes Santo",
65
- Date.civil(2013, 4, 19) => "Declaración Independencia",
66
- Date.civil(2013, 5, 1) => "Día del Trabajador",
67
- Date.civil(2013, 6, 24) => "Aniversario Batalla de Carabobo",
68
- Date.civil(2013, 7, 5) => "Día de la Independencia",
69
- Date.civil(2013, 7, 24) => "Natalicio de Simón Bolívar",
70
- Date.civil(2013, 10, 12) => "Día de la Resistencia Indígena",
71
- Date.civil(2013, 12, 25) => "Día de Navidad"
72
- }.each do |date, name|
73
- assert_equal name, (Holidays.on(date, :ve)[0] || {})[:name]
74
- end
data/definitions/vi.yaml DELETED
@@ -1,29 +0,0 @@
1
- # Vietnam holiday definitions for the Ruby Holiday gem.
2
- #
3
- # Updated: 2014-07-17.
4
- # Source: http://en.wikipedia.org/wiki/Public_holidays_in_Vietnam
5
- ---
6
- months:
7
- 1:
8
- - name: New Year
9
- regions: [vi]
10
- mday: 1
11
- 4:
12
- - name: Liberation Day
13
- regions: [vi]
14
- mday: 30
15
- 5:
16
- - name: International Workers' Day
17
- regions: [vi]
18
- mday: 1
19
- 9:
20
- - name: National Day
21
- regions: [vi]
22
- mday: 2
23
- tests: |
24
- {Date.civil(2014,1,1) => 'New Year',
25
- Date.civil(2014,4,30) => 'Liberation Day',
26
- Date.civil(2014,5,1) => "International Workers' Day",
27
- Date.civil(2014,9,2) => 'National Day'}.each do |date, name|
28
- assert_equal name, (Holidays.on(date, :vi)[0] || {})[:name]
29
- end
data/definitions/za.yaml DELETED
@@ -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