holidays 4.3.0 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89acbd996668a34248952b19f1b181e6d0f0b8e5
4
- data.tar.gz: 0ccb01c70c539b78050b462e4192654e003aa5b3
3
+ metadata.gz: 0583fff25d319bc53a85cb10ec309c8ad39496fd
4
+ data.tar.gz: 9ee50ee21c0b476609d97d7e0b2c68682741389a
5
5
  SHA512:
6
- metadata.gz: 88dc423ea2d62826823e153a0580b5861060dd16e8ccd66a93406f2dcf311df8d98db1d30f2fa61a6d52c50eca64b4451c36fa4d9c461eb3a7670754c79cca20
7
- data.tar.gz: 99a86fd72597e01aad65a2b9d7436200d63c854a221da07e0916e2b49fe58cf779d1ccb8bcb0ffd56fdc919933cbd7e1861812f6c5a8352a3f4519fa86adf14f
6
+ metadata.gz: 3ef3930fca96668d9514dbac18bd907b7e198a81592977dabc30d20b095225cd7e1d7cc9a673d27ddf44bb31b5312332325700c9efbbedd2bb084e5456764140
7
+ data.tar.gz: 3d7dee33d38a31f68b11fe0ebd138c16beb2c4c0ea469d3eb7b0586993d1b614f0d822c97adfd3763ded3cb6bd2633363b2373f9d68d182b6bc3885fe5eba79a
@@ -1,5 +1,9 @@
1
1
  # Ruby Holidays Gem CHANGELOG
2
2
 
3
+ ## 4.4.0
4
+
5
+ * Add Peruvian holiday definitions (https://github.com/Xosmond)
6
+
3
7
  ## 4.3.0
4
8
 
5
9
  * Update Portuguese holidays to restore 4 holidays (https://github.com/ruippeixotog)
@@ -37,6 +37,7 @@ defs:
37
37
  "NO": ['no.yaml']
38
38
  NYSE: ['nyse.yaml']
39
39
  NZ: ['nz.yaml']
40
+ PE: ['pe.yaml']
40
41
  PH: ['ph.yaml']
41
42
  PL: ['pl.yaml']
42
43
  PT: ['pt.yaml']
@@ -0,0 +1,119 @@
1
+ # Peruvian holiday definitions for the Ruby Holiday gem.
2
+ #
3
+ # created: 2016-06-18.
4
+ # updated: 2016-06-18.
5
+ #
6
+ # Sources:
7
+ # - http://www.timeanddate.com/holidays/peru/
8
+ # - https://en.wikipedia.org/wiki/Public_holidays_in_Peru
9
+ #
10
+ # Avoided days:
11
+ # March equinox
12
+ # June Solstice
13
+ # September equinox
14
+ # All soul's day
15
+ # December solstice
16
+ # Christmas eve
17
+ # Christmas day observed
18
+ # New year's eve
19
+ #
20
+ months:
21
+ 0:
22
+ - name: Jueves Santo
23
+ regions: [pe]
24
+ function: easter(year)
25
+ function_modifier: -3
26
+ - name: Viernes Santo
27
+ regions: [pe]
28
+ function: easter(year)
29
+ function_modifier: -2
30
+ - name: Pascua
31
+ regions: [pe]
32
+ function: easter(year)
33
+ 1:
34
+ - name: Año Nuevo
35
+ regions: [pe]
36
+ mday: 1
37
+ - name: Día de los Reyes Magos
38
+ regions: [pe]
39
+ mday: 6
40
+ observed: to_monday_if_sunday(date)
41
+ 5:
42
+ - name: Día del Trabajador
43
+ regions: [pe]
44
+ mday: 1
45
+ - name: Día de la Madre
46
+ regions: [pe]
47
+ week: 2
48
+ wday: 0
49
+ type: informal
50
+ 6:
51
+ - name: Día de la Bandera
52
+ regions: [pe]
53
+ mday: 7
54
+ type: informal
55
+ - name: Día del Padre
56
+ regions: [pe]
57
+ week: 3
58
+ wday: 0
59
+ type: informal
60
+ - name: Inti Raymi
61
+ regions: [pe]
62
+ mday: 24
63
+ type: informal
64
+ - name: San Pablo y San Pedro
65
+ regions: [pe]
66
+ mday: 29
67
+ 7:
68
+ - name: Primer Día de la Independencia
69
+ regions: [pe]
70
+ mday: 28
71
+ - name: Segundo Día de la Independencia
72
+ regions: [pe]
73
+ mday: 29
74
+ 8:
75
+ - name: Santa Rosa de Lima
76
+ regions: [pe]
77
+ mday: 30
78
+ 9:
79
+ - name: Día de las Fuerzas Armadas
80
+ regions: [pe]
81
+ mday: 24
82
+ type: informal
83
+ 10:
84
+ - name: Batalla de Angamos
85
+ regions: [pe]
86
+ mday: 8
87
+ 11:
88
+ - name: Todos los Santos
89
+ regions: [pe]
90
+ mday: 1
91
+ 12:
92
+ - name: Inmaculada Concepción
93
+ regions: [pe]
94
+ mday: 8
95
+ observed: to_monday_if_sunday(date)
96
+ - name: Navidad del Señor
97
+ regions: [pe]
98
+ mday: 25
99
+ tests: |
100
+ {Date.civil(2016,1,1) => 'Año Nuevo',
101
+ Date.civil(2016,1,6) => 'Día de los Reyes Magos',
102
+ Date.civil(2016,3,24) => 'Jueves Santo',
103
+ Date.civil(2016,3,25) => 'Viernes Santo',
104
+ Date.civil(2016,3,27) => 'Pascua',
105
+ Date.civil(2016,5,1) => 'Día del Trabajador',
106
+ Date.civil(2016,5,8) => 'Día de la Madre',
107
+ Date.civil(2016,6,7) => 'Día de la Bandera',
108
+ Date.civil(2016,6,19) => 'Día del Padre',
109
+ Date.civil(2016,6,29) => 'San Pablo y San Pedro',
110
+ Date.civil(2016,7,28) => 'Primer Día de la Independencia',
111
+ Date.civil(2016,7,29) => 'Segundo Día de la Independencia',
112
+ Date.civil(2016,8,30) => 'Santa Rosa de Lima',
113
+ Date.civil(2016,9,24) => 'Día de las Fuerzas Armadas',
114
+ Date.civil(2016,10,8) => 'Batalla de Angamos',
115
+ Date.civil(2016,11,1) => 'Todos los Santos',
116
+ Date.civil(2016,12,8) => 'Inmaculada Concepción',
117
+ Date.civil(2016,12,25) => 'Navidad del Señor'}.each do |date, name|
118
+ assert_equal name, (Holidays.on(date, :pe, :informal)[0] || {})[:name]
119
+ end
@@ -42,6 +42,7 @@ The following definition files are included in this installation:
42
42
  * generated_definitions/north_america
43
43
  * generated_definitions/nyse
44
44
  * generated_definitions/nz
45
+ * generated_definitions/pe
45
46
  * generated_definitions/ph
46
47
  * generated_definitions/pl
47
48
  * generated_definitions/pt
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Holidays
3
- REGIONS = [:ar, :at, :au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_tas_south, :au_wa, :au_tas, :au_qld_cairns, :au_qld_brisbane, :au_tas_north, :au_vic_melbourne, :be_fr, :be_nl, :br, :bg_en, :bg_bg, :ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_mb, :ca_ns, :ca_pe, :ca_nf, :ca_nt, :ca_nu, :ca_nb, :ca_yk, :us, :ch_zh, :ch_be, :ch_lu, :ch_ur, :ch_sz, :ch_ow, :ch_nw, :ch_gl, :ch_zg, :ch_fr, :ch_so, :ch_bs, :ch_bl, :ch_sh, :ch_ar, :ch_ai, :ch_sg, :ch_gr, :ch_ag, :ch_tg, :ch_ti, :ch_vd, :ch_ne, :ch_ge, :ch_ju, :ch_vs, :ch, :cl, :cr, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_aux, :de_th_aux, :de_sn, :de_st, :de_by_aux, :de_bb, :de_mv, :de_th, :ecb_target, :el, :es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es, :es_ct, :es_v, :es_vc, :federal_reserve, :fedex, :fi, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom, :hr, :hu, :ie, :is, :it, :li, :lt, :ma, :mx, :mx_pue, :us, :ca, :nerc, :nl, :no, :nyse, :nz, :nz_sl, :nz_we, :nz_ak, :nz_nl, :nz_ne, :nz_ot, :nz_ta, :nz_sc, :nz_hb, :nz_mb, :nz_ca, :nz_ch, :nz_wl, :ph, :pl, :pt, :ro, :se, :us, :us_dc, :us_ca, :ca, :united_nations, :ups, :za, :ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_mb, :ca_ns, :ca_pe, :ca_nf, :ca_nt, :ca_nu, :ca_nb, :ca_yk, :mx, :mx_pue, :us, :us_dc, :us_ca, :dk, :is, :no, :se, :fi, :at, :be_fr, :be_nl, :ch_zh, :ch_be, :ch_lu, :ch_ur, :ch_sz, :ch_ow, :ch_nw, :ch_gl, :ch_zg, :ch_fr, :ch_so, :ch_bs, :ch_bl, :ch_sh, :ch_ar, :ch_ai, :ch_sg, :ch_gr, :ch_ag, :ch_tg, :ch_ti, :ch_vd, :ch_ne, :ch_ge, :ch_ju, :ch_vs, :ch, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_aux, :de_th_aux, :de_sn, :de_st, :de_by_aux, :de_bb, :de_mv, :de_th, :el, :es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es, :es_ct, :es_v, :es_vc, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom, :hr, :hu, :ie, :is, :it, :li, :lt, :nl, :no, :pl, :pt, :ro, :sk, :si, :bg_en, :bg_bg, :jp, :ve, :vi, :sk, :si, :sg]
3
+ REGIONS = [:ar, :at, :au, :au_nsw, :au_vic, :au_qld, :au_nt, :au_act, :au_sa, :au_tas_south, :au_wa, :au_tas, :au_qld_cairns, :au_qld_brisbane, :au_tas_north, :au_vic_melbourne, :be_fr, :be_nl, :br, :bg_en, :bg_bg, :ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_mb, :ca_ns, :ca_pe, :ca_nf, :ca_nt, :ca_nu, :ca_nb, :ca_yk, :us, :ch_zh, :ch_be, :ch_lu, :ch_ur, :ch_sz, :ch_ow, :ch_nw, :ch_gl, :ch_zg, :ch_fr, :ch_so, :ch_bs, :ch_bl, :ch_sh, :ch_ar, :ch_ai, :ch_sg, :ch_gr, :ch_ag, :ch_tg, :ch_ti, :ch_vd, :ch_ne, :ch_ge, :ch_ju, :ch_vs, :ch, :cl, :cr, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_aux, :de_th_aux, :de_sn, :de_st, :de_by_aux, :de_bb, :de_mv, :de_th, :ecb_target, :el, :es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es, :es_ct, :es_v, :es_vc, :federal_reserve, :fedex, :fi, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom, :hr, :hu, :ie, :is, :it, :li, :lt, :ma, :mx, :mx_pue, :us, :ca, :nerc, :nl, :no, :nyse, :nz, :nz_sl, :nz_we, :nz_ak, :nz_nl, :nz_ne, :nz_ot, :nz_ta, :nz_sc, :nz_hb, :nz_mb, :nz_ca, :nz_ch, :nz_wl, :pe, :ph, :pl, :pt, :ro, :se, :us, :us_dc, :us_ca, :ca, :united_nations, :ups, :za, :ca, :ca_qc, :ca_ab, :ca_sk, :ca_on, :ca_bc, :ca_mb, :ca_ns, :ca_pe, :ca_nf, :ca_nt, :ca_nu, :ca_nb, :ca_yk, :mx, :mx_pue, :us, :us_dc, :us_ca, :dk, :is, :no, :se, :fi, :at, :be_fr, :be_nl, :ch_zh, :ch_be, :ch_lu, :ch_ur, :ch_sz, :ch_ow, :ch_nw, :ch_gl, :ch_zg, :ch_fr, :ch_so, :ch_bs, :ch_bl, :ch_sh, :ch_ar, :ch_ai, :ch_sg, :ch_gr, :ch_ag, :ch_tg, :ch_ti, :ch_vd, :ch_ne, :ch_ge, :ch_ju, :ch_vs, :ch, :cz, :dk, :de, :de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_aux, :de_th_aux, :de_sn, :de_st, :de_by_aux, :de_bb, :de_mv, :de_th, :el, :es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es, :es_ct, :es_v, :es_vc, :fr, :gb, :gb_eng, :gb_wls, :gb_eaw, :gb_nir, :gb_sct, :gb_con, :je, :gb_jsy, :gg, :gb_gsy, :im, :gb_iom, :hr, :hu, :ie, :is, :it, :li, :lt, :nl, :no, :pl, :pt, :ro, :sk, :si, :bg_en, :bg_bg, :jp, :ve, :vi, :sk, :si, :sg]
4
4
  end
@@ -0,0 +1,49 @@
1
+ # encoding: utf-8
2
+ module Holidays
3
+ # This file is generated by the Ruby Holidays gem.
4
+ #
5
+ # Definitions loaded: definitions/pe.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 'generated_definitions/pe'
12
+ #
13
+ # All the definitions are available at https://github.com/holidays/holidays
14
+ module PE # :nodoc:
15
+ def self.defined_regions
16
+ [:pe]
17
+ end
18
+
19
+ def self.holidays_by_month
20
+ {
21
+ 0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -3, :name => "Jueves Santo", :regions => [:pe]},
22
+ {:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Viernes Santo", :regions => [:pe]},
23
+ {:function => "easter(year)", :function_arguments => [:year], :name => "Pascua", :regions => [:pe]}],
24
+ 1 => [{:mday => 1, :name => "Año Nuevo", :regions => [:pe]},
25
+ {:mday => 6, :observed => "to_monday_if_sunday(date)", :observed_arguments => [:date], :name => "Día de los Reyes Magos", :regions => [:pe]}],
26
+ 5 => [{:mday => 1, :name => "Día del Trabajador", :regions => [:pe]},
27
+ {:wday => 0, :week => 2, :type => :informal, :name => "Día de la Madre", :regions => [:pe]}],
28
+ 6 => [{:mday => 7, :type => :informal, :name => "Día de la Bandera", :regions => [:pe]},
29
+ {:wday => 0, :week => 3, :type => :informal, :name => "Día del Padre", :regions => [:pe]},
30
+ {:mday => 24, :type => :informal, :name => "Inti Raymi", :regions => [:pe]},
31
+ {:mday => 29, :name => "San Pablo y San Pedro", :regions => [:pe]}],
32
+ 7 => [{:mday => 28, :name => "Primer Día de la Independencia", :regions => [:pe]},
33
+ {:mday => 29, :name => "Segundo Día de la Independencia", :regions => [:pe]}],
34
+ 8 => [{:mday => 30, :name => "Santa Rosa de Lima", :regions => [:pe]}],
35
+ 9 => [{:mday => 24, :type => :informal, :name => "Día de las Fuerzas Armadas", :regions => [:pe]}],
36
+ 10 => [{:mday => 8, :name => "Batalla de Angamos", :regions => [:pe]}],
37
+ 11 => [{:mday => 1, :name => "Todos los Santos", :regions => [:pe]}],
38
+ 12 => [{:mday => 8, :observed => "to_monday_if_sunday(date)", :observed_arguments => [:date], :name => "Inmaculada Concepción", :regions => [:pe]},
39
+ {:mday => 25, :name => "Navidad del Señor", :regions => [:pe]}]
40
+ }
41
+ end
42
+
43
+ def self.custom_methods
44
+ {
45
+
46
+ }
47
+ end
48
+ end
49
+ end
@@ -1,3 +1,3 @@
1
1
  module Holidays
2
- VERSION = '4.3.0'
2
+ VERSION = '4.4.0'
3
3
  end
@@ -0,0 +1,32 @@
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: definitions/pe.yaml
7
+ class PeDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_pe
10
+ {Date.civil(2016,1,1) => 'Año Nuevo',
11
+ Date.civil(2016,1,6) => 'Día de los Reyes Magos',
12
+ Date.civil(2016,3,24) => 'Jueves Santo',
13
+ Date.civil(2016,3,25) => 'Viernes Santo',
14
+ Date.civil(2016,3,27) => 'Pascua',
15
+ Date.civil(2016,5,1) => 'Día del Trabajador',
16
+ Date.civil(2016,5,8) => 'Día de la Madre',
17
+ Date.civil(2016,6,7) => 'Día de la Bandera',
18
+ Date.civil(2016,6,19) => 'Día del Padre',
19
+ Date.civil(2016,6,29) => 'San Pablo y San Pedro',
20
+ Date.civil(2016,7,28) => 'Primer Día de la Independencia',
21
+ Date.civil(2016,7,29) => 'Segundo Día de la Independencia',
22
+ Date.civil(2016,8,30) => 'Santa Rosa de Lima',
23
+ Date.civil(2016,9,24) => 'Día de las Fuerzas Armadas',
24
+ Date.civil(2016,10,8) => 'Batalla de Angamos',
25
+ Date.civil(2016,11,1) => 'Todos los Santos',
26
+ Date.civil(2016,12,8) => 'Inmaculada Concepción',
27
+ Date.civil(2016,12,25) => 'Navidad del Señor'}.each do |date, name|
28
+ assert_equal name, (Holidays.on(date, :pe, :informal)[0] || {})[:name]
29
+ end
30
+
31
+ end
32
+ 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.3.0
4
+ version: 4.4.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: 2016-06-09 00:00:00.000000000 Z
12
+ date: 2016-06-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -154,6 +154,7 @@ files:
154
154
  - definitions/north_america_informal.yaml
155
155
  - definitions/nyse.yaml
156
156
  - definitions/nz.yaml
157
+ - definitions/pe.yaml
157
158
  - definitions/ph.yaml
158
159
  - definitions/pl.yaml
159
160
  - definitions/pt.yaml
@@ -211,6 +212,7 @@ files:
211
212
  - lib/generated_definitions/north_america.rb
212
213
  - lib/generated_definitions/nyse.rb
213
214
  - lib/generated_definitions/nz.rb
215
+ - lib/generated_definitions/pe.rb
214
216
  - lib/generated_definitions/ph.rb
215
217
  - lib/generated_definitions/pl.rb
216
218
  - lib/generated_definitions/pt.rb
@@ -301,6 +303,7 @@ files:
301
303
  - test/defs/test_defs_north_america.rb
302
304
  - test/defs/test_defs_nyse.rb
303
305
  - test/defs/test_defs_nz.rb
306
+ - test/defs/test_defs_pe.rb
304
307
  - test/defs/test_defs_ph.rb
305
308
  - test/defs/test_defs_pl.rb
306
309
  - test/defs/test_defs_pt.rb
@@ -417,6 +420,7 @@ test_files:
417
420
  - test/defs/test_defs_north_america.rb
418
421
  - test/defs/test_defs_nyse.rb
419
422
  - test/defs/test_defs_nz.rb
423
+ - test/defs/test_defs_pe.rb
420
424
  - test/defs/test_defs_ph.rb
421
425
  - test/defs/test_defs_pl.rb
422
426
  - test/defs/test_defs_pt.rb