holidays 6.6.1 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/lib/generated_definitions/MANIFEST +7 -5
  4. data/lib/generated_definitions/REGIONS.rb +2 -2
  5. data/lib/generated_definitions/ar.rb +2 -2
  6. data/lib/generated_definitions/at.rb +2 -2
  7. data/lib/generated_definitions/au.rb +2 -2
  8. data/lib/generated_definitions/be_fr.rb +2 -2
  9. data/lib/generated_definitions/be_nl.rb +2 -2
  10. data/lib/generated_definitions/bg.rb +2 -2
  11. data/lib/generated_definitions/br.rb +2 -2
  12. data/lib/generated_definitions/ca.rb +5 -4
  13. data/lib/generated_definitions/ch.rb +2 -2
  14. data/lib/generated_definitions/cl.rb +2 -2
  15. data/lib/generated_definitions/co.rb +2 -2
  16. data/lib/generated_definitions/cr.rb +2 -2
  17. data/lib/generated_definitions/cz.rb +2 -2
  18. data/lib/generated_definitions/de.rb +2 -2
  19. data/lib/generated_definitions/dk.rb +2 -2
  20. data/lib/generated_definitions/{ecb_target.rb → ecbtarget.rb} +10 -10
  21. data/lib/generated_definitions/ee.rb +2 -2
  22. data/lib/generated_definitions/el.rb +2 -2
  23. data/lib/generated_definitions/es.rb +2 -2
  24. data/lib/generated_definitions/europe.rb +26 -13
  25. data/lib/generated_definitions/{federal_reserve.rb → federalreserve.rb} +14 -14
  26. data/lib/generated_definitions/federalreservebanks.rb +34 -0
  27. data/lib/generated_definitions/fedex.rb +2 -2
  28. data/lib/generated_definitions/fi.rb +2 -2
  29. data/lib/generated_definitions/fr.rb +2 -2
  30. data/lib/generated_definitions/gb.rb +2 -2
  31. data/lib/generated_definitions/ge.rb +2 -2
  32. data/lib/generated_definitions/hk.rb +2 -2
  33. data/lib/generated_definitions/hr.rb +2 -2
  34. data/lib/generated_definitions/hu.rb +2 -2
  35. data/lib/generated_definitions/ie.rb +2 -2
  36. data/lib/generated_definitions/is.rb +2 -2
  37. data/lib/generated_definitions/it.rb +2 -2
  38. data/lib/generated_definitions/jp.rb +12 -6
  39. data/lib/generated_definitions/kr.rb +2 -2
  40. data/lib/generated_definitions/li.rb +2 -2
  41. data/lib/generated_definitions/lt.rb +2 -2
  42. data/lib/generated_definitions/lu.rb +2 -2
  43. data/lib/generated_definitions/ma.rb +2 -2
  44. data/lib/generated_definitions/mt_en.rb +2 -2
  45. data/lib/generated_definitions/mt_mt.rb +2 -2
  46. data/lib/generated_definitions/mx.rb +3 -3
  47. data/lib/generated_definitions/my.rb +2 -2
  48. data/lib/generated_definitions/nerc.rb +2 -2
  49. data/lib/generated_definitions/nl.rb +2 -2
  50. data/lib/generated_definitions/no.rb +2 -2
  51. data/lib/generated_definitions/{north_america.rb → northamerica.rb} +6 -5
  52. data/lib/generated_definitions/nyse.rb +2 -2
  53. data/lib/generated_definitions/nz.rb +2 -2
  54. data/lib/generated_definitions/pe.rb +2 -2
  55. data/lib/generated_definitions/ph.rb +2 -2
  56. data/lib/generated_definitions/pl.rb +2 -2
  57. data/lib/generated_definitions/pt.rb +2 -2
  58. data/lib/generated_definitions/ro.rb +2 -2
  59. data/lib/generated_definitions/rs_cyrl.rb +2 -2
  60. data/lib/generated_definitions/rs_la.rb +2 -2
  61. data/lib/generated_definitions/ru.rb +2 -2
  62. data/lib/generated_definitions/scandinavia.rb +2 -2
  63. data/lib/generated_definitions/se.rb +2 -2
  64. data/lib/generated_definitions/sg.rb +2 -2
  65. data/lib/generated_definitions/si.rb +2 -2
  66. data/lib/generated_definitions/sk.rb +2 -2
  67. data/lib/generated_definitions/{south_america.rb → southamerica.rb} +3 -3
  68. data/lib/generated_definitions/tn.rb +2 -2
  69. data/lib/generated_definitions/tr.rb +2 -2
  70. data/lib/generated_definitions/ua.rb +37 -0
  71. data/lib/generated_definitions/{united_nations.rb → unitednations.rb} +61 -61
  72. data/lib/generated_definitions/ups.rb +2 -2
  73. data/lib/generated_definitions/us.rb +3 -3
  74. data/lib/generated_definitions/ve.rb +2 -2
  75. data/lib/generated_definitions/vi.rb +2 -2
  76. data/lib/generated_definitions/za.rb +2 -2
  77. data/lib/holidays/definition/context/generator.rb +3 -36
  78. data/lib/holidays/definition/generator/module.rb +54 -0
  79. data/lib/holidays/definition/generator/regions.rb +1 -1
  80. data/lib/holidays/factory/definition.rb +7 -0
  81. data/lib/holidays/version.rb +1 -1
  82. data/test/defs/test_defs_ca.rb +18 -2
  83. data/test/defs/{test_defs_ecb_target.rb → test_defs_ecbtarget.rb} +11 -11
  84. data/test/defs/test_defs_europe.rb +31 -1
  85. data/test/defs/{test_defs_federal_reserve.rb → test_defs_federalreserve.rb} +54 -54
  86. data/test/defs/test_defs_federalreservebanks.rb +113 -0
  87. data/test/defs/test_defs_jp.rb +19 -1
  88. data/test/defs/test_defs_mx.rb +1 -1
  89. data/test/defs/{test_defs_north_america.rb → test_defs_northamerica.rb} +20 -4
  90. data/test/defs/{test_defs_south_america.rb → test_defs_southamerica.rb} +2 -2
  91. data/test/defs/test_defs_ua.rb +41 -0
  92. data/test/defs/{test_defs_united_nations.rb → test_defs_unitednations.rb} +3 -3
  93. data/test/defs/test_defs_us.rb +1 -1
  94. data/test/holidays/definition/context/test_generator.rb +13 -3
  95. data/test/holidays/definition/generator/test_module.rb +268 -0
  96. data/test/integration/test_available_regions.rb +1 -1
  97. data/test/integration/test_holidays.rb +1 -7
  98. data/test/integration/test_holidays_between.rb +1 -1
  99. data/test/integration/test_nonstandard_regions.rb +25 -0
  100. metadata +28 -17
@@ -18,6 +18,6 @@ class AvailableRegionsTests < Test::Unit::TestCase
18
18
  # This test might fail if we add new regions. Since this is an integration test
19
19
  # I am fine with that!
20
20
  def test_available_regions_returns_correct_number_of_regions
21
- assert_equal 240, Holidays.available_regions.count
21
+ assert_equal 242, Holidays.available_regions.count
22
22
  end
23
23
  end
@@ -1,12 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
3
 
4
- require "#{Holidays::DEFINITIONS_PATH}/ca"
5
-
6
- # Re-include CA defs via holidays/north_america to ensure that individual
7
- # defs aren't duplicated.
8
- require "#{Holidays::DEFINITIONS_PATH}/north_america"
9
-
10
4
  class HolidaysTests < Test::Unit::TestCase
11
5
  def setup
12
6
  @date = Date.civil(2008,1,1)
@@ -272,6 +266,6 @@ class HolidaysTests < Test::Unit::TestCase
272
266
 
273
267
  def test_load_all
274
268
  Holidays.load_all
275
- assert_equal 240, Holidays.available_regions.count
269
+ assert_equal 242, Holidays.available_regions.count
276
270
  end
277
271
  end
@@ -8,7 +8,7 @@ require "#{Holidays::DEFINITIONS_PATH}/ca"
8
8
  # NOTE: this test is a mixture of integration and unit tests. It's messy and bad.
9
9
  # I am not fixing it here because I am trying to clean up the 'between' use case
10
10
  # and don't want to bite off more than I can chew.
11
- require "#{Holidays::DEFINITIONS_PATH}/north_america"
11
+ require "#{Holidays::DEFINITIONS_PATH}/northamerica"
12
12
 
13
13
  class HolidaysBetweenTests < Test::Unit::TestCase
14
14
  def setup
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
+
4
+ class NonstandardRegionsHolidaysTests < Test::Unit::TestCase
5
+ def test_ecbtarget_christmas_day
6
+ h = Holidays.on(Date.new(2018,12,25), :ecbtarget)
7
+ assert_equal 'Christmas Day', h[0][:name]
8
+ end
9
+
10
+ def test_federalreserve_memorial_day
11
+ h = Holidays.on(Date.new(2018,5,28), :federalreserve)
12
+ assert_equal 'Memorial Day', h[0][:name]
13
+
14
+ end
15
+
16
+ def test_federalreservebanks_independence_day
17
+ h = Holidays.on(Date.new(2020,7,3), :federalreservebanks, :observed)
18
+ assert_equal 'Independence Day', h[0][:name]
19
+ end
20
+
21
+ def test_unitednations_international_day_of_families
22
+ h = Holidays.on(Date.new(2021,5,15), :unitednations)
23
+ assert_equal 'International Day of Families', h[0][:name]
24
+ end
25
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: holidays
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.6.1
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dunae
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-10-13 00:00:00.000000000 Z
12
+ date: 2018-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -135,12 +135,13 @@ files:
135
135
  - lib/generated_definitions/cz.rb
136
136
  - lib/generated_definitions/de.rb
137
137
  - lib/generated_definitions/dk.rb
138
- - lib/generated_definitions/ecb_target.rb
138
+ - lib/generated_definitions/ecbtarget.rb
139
139
  - lib/generated_definitions/ee.rb
140
140
  - lib/generated_definitions/el.rb
141
141
  - lib/generated_definitions/es.rb
142
142
  - lib/generated_definitions/europe.rb
143
- - lib/generated_definitions/federal_reserve.rb
143
+ - lib/generated_definitions/federalreserve.rb
144
+ - lib/generated_definitions/federalreservebanks.rb
144
145
  - lib/generated_definitions/fedex.rb
145
146
  - lib/generated_definitions/fi.rb
146
147
  - lib/generated_definitions/fr.rb
@@ -165,7 +166,7 @@ files:
165
166
  - lib/generated_definitions/nerc.rb
166
167
  - lib/generated_definitions/nl.rb
167
168
  - lib/generated_definitions/no.rb
168
- - lib/generated_definitions/north_america.rb
169
+ - lib/generated_definitions/northamerica.rb
169
170
  - lib/generated_definitions/nyse.rb
170
171
  - lib/generated_definitions/nz.rb
171
172
  - lib/generated_definitions/pe.rb
@@ -181,10 +182,11 @@ files:
181
182
  - lib/generated_definitions/sg.rb
182
183
  - lib/generated_definitions/si.rb
183
184
  - lib/generated_definitions/sk.rb
184
- - lib/generated_definitions/south_america.rb
185
+ - lib/generated_definitions/southamerica.rb
185
186
  - lib/generated_definitions/tn.rb
186
187
  - lib/generated_definitions/tr.rb
187
- - lib/generated_definitions/united_nations.rb
188
+ - lib/generated_definitions/ua.rb
189
+ - lib/generated_definitions/unitednations.rb
188
190
  - lib/generated_definitions/ups.rb
189
191
  - lib/generated_definitions/us.rb
190
192
  - lib/generated_definitions/ve.rb
@@ -206,6 +208,7 @@ files:
206
208
  - lib/holidays/definition/decorator/test.rb
207
209
  - lib/holidays/definition/entity/custom_method.rb
208
210
  - lib/holidays/definition/entity/test.rb
211
+ - lib/holidays/definition/generator/module.rb
209
212
  - lib/holidays/definition/generator/regions.rb
210
213
  - lib/holidays/definition/generator/test.rb
211
214
  - lib/holidays/definition/parser/custom_method.rb
@@ -256,13 +259,14 @@ files:
256
259
  - test/defs/test_defs_cz.rb
257
260
  - test/defs/test_defs_de.rb
258
261
  - test/defs/test_defs_dk.rb
259
- - test/defs/test_defs_ecb_target.rb
262
+ - test/defs/test_defs_ecbtarget.rb
260
263
  - test/defs/test_defs_ee.rb
261
264
  - test/defs/test_defs_el.rb
262
265
  - test/defs/test_defs_es.rb
263
266
  - test/defs/test_defs_europe.rb
264
267
  - test/defs/test_defs_fed_ex.rb
265
- - test/defs/test_defs_federal_reserve.rb
268
+ - test/defs/test_defs_federalreserve.rb
269
+ - test/defs/test_defs_federalreservebanks.rb
266
270
  - test/defs/test_defs_fedex.rb
267
271
  - test/defs/test_defs_fi.rb
268
272
  - test/defs/test_defs_fr.rb
@@ -287,7 +291,7 @@ files:
287
291
  - test/defs/test_defs_nerc.rb
288
292
  - test/defs/test_defs_nl.rb
289
293
  - test/defs/test_defs_no.rb
290
- - test/defs/test_defs_north_america.rb
294
+ - test/defs/test_defs_northamerica.rb
291
295
  - test/defs/test_defs_nyse.rb
292
296
  - test/defs/test_defs_nz.rb
293
297
  - test/defs/test_defs_pe.rb
@@ -303,10 +307,11 @@ files:
303
307
  - test/defs/test_defs_sg.rb
304
308
  - test/defs/test_defs_si.rb
305
309
  - test/defs/test_defs_sk.rb
306
- - test/defs/test_defs_south_america.rb
310
+ - test/defs/test_defs_southamerica.rb
307
311
  - test/defs/test_defs_tn.rb
308
312
  - test/defs/test_defs_tr.rb
309
- - test/defs/test_defs_united_nations.rb
313
+ - test/defs/test_defs_ua.rb
314
+ - test/defs/test_defs_unitednations.rb
310
315
  - test/defs/test_defs_ups.rb
311
316
  - test/defs/test_defs_us.rb
312
317
  - test/defs/test_defs_ve.rb
@@ -326,6 +331,7 @@ files:
326
331
  - test/holidays/definition/decorator/test_custom_method_proc.rb
327
332
  - test/holidays/definition/decorator/test_custom_method_source.rb
328
333
  - test/holidays/definition/decorator/test_test.rb
334
+ - test/holidays/definition/generator/test_module.rb
329
335
  - test/holidays/definition/generator/test_regions.rb
330
336
  - test/holidays/definition/generator/test_test.rb
331
337
  - test/holidays/definition/parser/test_custom_method.rb
@@ -356,6 +362,7 @@ files:
356
362
  - test/integration/test_holidays.rb
357
363
  - test/integration/test_holidays_between.rb
358
364
  - test/integration/test_multiple_regions.rb
365
+ - test/integration/test_nonstandard_regions.rb
359
366
  - test/test_helper.rb
360
367
  homepage: https://github.com/holidays/holidays
361
368
  licenses:
@@ -406,13 +413,14 @@ test_files:
406
413
  - test/defs/test_defs_cz.rb
407
414
  - test/defs/test_defs_de.rb
408
415
  - test/defs/test_defs_dk.rb
409
- - test/defs/test_defs_ecb_target.rb
416
+ - test/defs/test_defs_ecbtarget.rb
410
417
  - test/defs/test_defs_ee.rb
411
418
  - test/defs/test_defs_el.rb
412
419
  - test/defs/test_defs_es.rb
413
420
  - test/defs/test_defs_europe.rb
414
421
  - test/defs/test_defs_fed_ex.rb
415
- - test/defs/test_defs_federal_reserve.rb
422
+ - test/defs/test_defs_federalreserve.rb
423
+ - test/defs/test_defs_federalreservebanks.rb
416
424
  - test/defs/test_defs_fedex.rb
417
425
  - test/defs/test_defs_fi.rb
418
426
  - test/defs/test_defs_fr.rb
@@ -437,7 +445,7 @@ test_files:
437
445
  - test/defs/test_defs_nerc.rb
438
446
  - test/defs/test_defs_nl.rb
439
447
  - test/defs/test_defs_no.rb
440
- - test/defs/test_defs_north_america.rb
448
+ - test/defs/test_defs_northamerica.rb
441
449
  - test/defs/test_defs_nyse.rb
442
450
  - test/defs/test_defs_nz.rb
443
451
  - test/defs/test_defs_pe.rb
@@ -453,10 +461,11 @@ test_files:
453
461
  - test/defs/test_defs_sg.rb
454
462
  - test/defs/test_defs_si.rb
455
463
  - test/defs/test_defs_sk.rb
456
- - test/defs/test_defs_south_america.rb
464
+ - test/defs/test_defs_southamerica.rb
457
465
  - test/defs/test_defs_tn.rb
458
466
  - test/defs/test_defs_tr.rb
459
- - test/defs/test_defs_united_nations.rb
467
+ - test/defs/test_defs_ua.rb
468
+ - test/defs/test_defs_unitednations.rb
460
469
  - test/defs/test_defs_ups.rb
461
470
  - test/defs/test_defs_us.rb
462
471
  - test/defs/test_defs_ve.rb
@@ -476,6 +485,7 @@ test_files:
476
485
  - test/holidays/definition/decorator/test_custom_method_proc.rb
477
486
  - test/holidays/definition/decorator/test_custom_method_source.rb
478
487
  - test/holidays/definition/decorator/test_test.rb
488
+ - test/holidays/definition/generator/test_module.rb
479
489
  - test/holidays/definition/generator/test_regions.rb
480
490
  - test/holidays/definition/generator/test_test.rb
481
491
  - test/holidays/definition/parser/test_custom_method.rb
@@ -506,4 +516,5 @@ test_files:
506
516
  - test/integration/test_holidays.rb
507
517
  - test/integration/test_holidays_between.rb
508
518
  - test/integration/test_multiple_regions.rb
519
+ - test/integration/test_nonstandard_regions.rb
509
520
  - test/test_helper.rb