holidays 6.6.1 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/lib/generated_definitions/MANIFEST +7 -5
- data/lib/generated_definitions/REGIONS.rb +2 -2
- data/lib/generated_definitions/ar.rb +2 -2
- data/lib/generated_definitions/at.rb +2 -2
- data/lib/generated_definitions/au.rb +2 -2
- data/lib/generated_definitions/be_fr.rb +2 -2
- data/lib/generated_definitions/be_nl.rb +2 -2
- data/lib/generated_definitions/bg.rb +2 -2
- data/lib/generated_definitions/br.rb +2 -2
- data/lib/generated_definitions/ca.rb +5 -4
- data/lib/generated_definitions/ch.rb +2 -2
- data/lib/generated_definitions/cl.rb +2 -2
- data/lib/generated_definitions/co.rb +2 -2
- data/lib/generated_definitions/cr.rb +2 -2
- data/lib/generated_definitions/cz.rb +2 -2
- data/lib/generated_definitions/de.rb +2 -2
- data/lib/generated_definitions/dk.rb +2 -2
- data/lib/generated_definitions/{ecb_target.rb → ecbtarget.rb} +10 -10
- data/lib/generated_definitions/ee.rb +2 -2
- data/lib/generated_definitions/el.rb +2 -2
- data/lib/generated_definitions/es.rb +2 -2
- data/lib/generated_definitions/europe.rb +26 -13
- data/lib/generated_definitions/{federal_reserve.rb → federalreserve.rb} +14 -14
- data/lib/generated_definitions/federalreservebanks.rb +34 -0
- data/lib/generated_definitions/fedex.rb +2 -2
- data/lib/generated_definitions/fi.rb +2 -2
- data/lib/generated_definitions/fr.rb +2 -2
- data/lib/generated_definitions/gb.rb +2 -2
- data/lib/generated_definitions/ge.rb +2 -2
- data/lib/generated_definitions/hk.rb +2 -2
- data/lib/generated_definitions/hr.rb +2 -2
- data/lib/generated_definitions/hu.rb +2 -2
- data/lib/generated_definitions/ie.rb +2 -2
- data/lib/generated_definitions/is.rb +2 -2
- data/lib/generated_definitions/it.rb +2 -2
- data/lib/generated_definitions/jp.rb +12 -6
- data/lib/generated_definitions/kr.rb +2 -2
- data/lib/generated_definitions/li.rb +2 -2
- data/lib/generated_definitions/lt.rb +2 -2
- data/lib/generated_definitions/lu.rb +2 -2
- data/lib/generated_definitions/ma.rb +2 -2
- data/lib/generated_definitions/mt_en.rb +2 -2
- data/lib/generated_definitions/mt_mt.rb +2 -2
- data/lib/generated_definitions/mx.rb +3 -3
- data/lib/generated_definitions/my.rb +2 -2
- data/lib/generated_definitions/nerc.rb +2 -2
- data/lib/generated_definitions/nl.rb +2 -2
- data/lib/generated_definitions/no.rb +2 -2
- data/lib/generated_definitions/{north_america.rb → northamerica.rb} +6 -5
- data/lib/generated_definitions/nyse.rb +2 -2
- data/lib/generated_definitions/nz.rb +2 -2
- data/lib/generated_definitions/pe.rb +2 -2
- data/lib/generated_definitions/ph.rb +2 -2
- data/lib/generated_definitions/pl.rb +2 -2
- data/lib/generated_definitions/pt.rb +2 -2
- data/lib/generated_definitions/ro.rb +2 -2
- data/lib/generated_definitions/rs_cyrl.rb +2 -2
- data/lib/generated_definitions/rs_la.rb +2 -2
- data/lib/generated_definitions/ru.rb +2 -2
- data/lib/generated_definitions/scandinavia.rb +2 -2
- data/lib/generated_definitions/se.rb +2 -2
- data/lib/generated_definitions/sg.rb +2 -2
- data/lib/generated_definitions/si.rb +2 -2
- data/lib/generated_definitions/sk.rb +2 -2
- data/lib/generated_definitions/{south_america.rb → southamerica.rb} +3 -3
- data/lib/generated_definitions/tn.rb +2 -2
- data/lib/generated_definitions/tr.rb +2 -2
- data/lib/generated_definitions/ua.rb +37 -0
- data/lib/generated_definitions/{united_nations.rb → unitednations.rb} +61 -61
- data/lib/generated_definitions/ups.rb +2 -2
- data/lib/generated_definitions/us.rb +3 -3
- data/lib/generated_definitions/ve.rb +2 -2
- data/lib/generated_definitions/vi.rb +2 -2
- data/lib/generated_definitions/za.rb +2 -2
- data/lib/holidays/definition/context/generator.rb +3 -36
- data/lib/holidays/definition/generator/module.rb +54 -0
- data/lib/holidays/definition/generator/regions.rb +1 -1
- data/lib/holidays/factory/definition.rb +7 -0
- data/lib/holidays/version.rb +1 -1
- data/test/defs/test_defs_ca.rb +18 -2
- data/test/defs/{test_defs_ecb_target.rb → test_defs_ecbtarget.rb} +11 -11
- data/test/defs/test_defs_europe.rb +31 -1
- data/test/defs/{test_defs_federal_reserve.rb → test_defs_federalreserve.rb} +54 -54
- data/test/defs/test_defs_federalreservebanks.rb +113 -0
- data/test/defs/test_defs_jp.rb +19 -1
- data/test/defs/test_defs_mx.rb +1 -1
- data/test/defs/{test_defs_north_america.rb → test_defs_northamerica.rb} +20 -4
- data/test/defs/{test_defs_south_america.rb → test_defs_southamerica.rb} +2 -2
- data/test/defs/test_defs_ua.rb +41 -0
- data/test/defs/{test_defs_united_nations.rb → test_defs_unitednations.rb} +3 -3
- data/test/defs/test_defs_us.rb +1 -1
- data/test/holidays/definition/context/test_generator.rb +13 -3
- data/test/holidays/definition/generator/test_module.rb +268 -0
- data/test/integration/test_available_regions.rb +1 -1
- data/test/integration/test_holidays.rb +1 -7
- data/test/integration/test_holidays_between.rb +1 -1
- data/test/integration/test_nonstandard_regions.rb +25 -0
- 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
|
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
|
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}/
|
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:
|
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-
|
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/
|
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/
|
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/
|
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/
|
185
|
+
- lib/generated_definitions/southamerica.rb
|
185
186
|
- lib/generated_definitions/tn.rb
|
186
187
|
- lib/generated_definitions/tr.rb
|
187
|
-
- lib/generated_definitions/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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/
|
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
|