holidays 6.0.0 → 6.1.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 +5 -0
- data/README.md +1 -1
- data/lib/generated_definitions/ca.rb +1 -1
- data/lib/generated_definitions/cl.rb +40 -5
- data/lib/generated_definitions/kr.rb +4 -2
- data/lib/generated_definitions/north_america.rb +1 -1
- data/lib/holidays/version.rb +1 -1
- data/test/defs/test_defs_ca.rb +3 -3
- data/test/defs/test_defs_cl.rb +11 -3
- data/test/defs/test_defs_north_america.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3852430b8d0648a9edb909978956281a492d8f47
|
4
|
+
data.tar.gz: 244d3cc90b484b97203f2d7d0a3a411468c17e45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2d48c3c411f93089b914e45231d945aed026433eba045df26f4fc3b1895264da797bb411f0a8e29350c1a4509208a1ba75709580f5f28fad791e0e3009e6247
|
7
|
+
data.tar.gz: 1a2fab7e55971301d758baf7bd7ae0d39de0245c54018acd9086966b15d60e53a77c6e9e42ceabc7988c30b1f51518cf204c6296e7ab3c734b2a29703a930cf8
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Ruby Holidays Gem CHANGELOG
|
2
2
|
|
3
|
+
## 6.1.0
|
4
|
+
|
5
|
+
* Update to [v2.1.1 definitions](https://github.com/holidays/definitions/releases/tag/v2.1.1). Please see the changelog for
|
6
|
+
the definitions for details.
|
7
|
+
|
3
8
|
## 6.0.0
|
4
9
|
|
5
10
|
* Remove support for ruby 2.1.0 since it is [no longer officially supported](https://www.ruby-lang.org/en/news/2017/04/01/support-of-ruby-2-1-has-ended/). This is the cause of the major
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ To install the gem from RubyGems:
|
|
12
12
|
|
13
13
|
gem install holidays
|
14
14
|
|
15
|
-
The Holidays gem is tested on Ruby 2.
|
15
|
+
The Holidays gem is tested on Ruby 2.2.0, 2.3.0, 2.4.0 and JRuby.
|
16
16
|
|
17
17
|
This gem follows [semantic versioning](http://semver.org/). The only methods covered by this guarantee are under the
|
18
18
|
`Holidays` namespace specifically. Anything that is not a method off of `Holidays` or the core extension is not covered by
|
@@ -41,7 +41,7 @@ module Holidays
|
|
41
41
|
{:mday => 9, :name => "Nunavut Day", :regions => [:ca_nu]}],
|
42
42
|
8 => [{:wday => 1, :week => 1, :name => "B.C. Day", :regions => [:ca_bc]},
|
43
43
|
{:wday => 1, :week => 1, :name => "Saskatchewan Day", :regions => [:ca_sk]},
|
44
|
-
{:wday => 1, :week => 1, :name => "Heritage Day", :regions => [:ca_ab]},
|
44
|
+
{:wday => 1, :week => 1, :type => :informal, :name => "Heritage Day", :regions => [:ca_ab]},
|
45
45
|
{:wday => 1, :week => 1, :name => "Natal Day", :regions => [:ca_ns]},
|
46
46
|
{:wday => 1, :week => 1, :name => "Civic Holiday", :regions => [:ca_nt, :ca_nu, :ca_pe]},
|
47
47
|
{:wday => 1, :week => 1, :type => :informal, :name => "Civic Holiday", :regions => [:ca_on]},
|
@@ -13,17 +13,19 @@ module Holidays
|
|
13
13
|
def self.holidays_by_month
|
14
14
|
{
|
15
15
|
0 => [{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -2, :name => "Viernes Santo", :regions => [:cl]},
|
16
|
-
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Sábado Santo", :regions => [:cl]}
|
16
|
+
{:function => "easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Sábado Santo", :regions => [:cl]},
|
17
|
+
{:function => "st_peter_st_paul_cl(year)", :function_arguments => [:year], :year_ranges => [{:after => 2000}],:name => "San Pedro y San Pablo", :regions => [:cl]},
|
18
|
+
{:function => "other_churches_day_cl(year)", :function_arguments => [:year], :year_ranges => [{:after => 2008}],:name => "Día de las Iglesias Evangélicas y Protestantes", :regions => [:cl]}],
|
17
19
|
1 => [{:mday => 1, :name => "Año Nuevo", :regions => [:cl]}],
|
18
20
|
5 => [{:mday => 1, :name => "Día del Trabajo", :regions => [:cl]},
|
19
21
|
{:mday => 21, :name => "Día de las Glorias Navales", :regions => [:cl]}],
|
20
|
-
6 => [{:mday => 29, :name => "San Pedro y San Pablo", :regions => [:cl]}],
|
22
|
+
6 => [{:mday => 29, :year_ranges => [{:before => 1999}],:name => "San Pedro y San Pablo", :regions => [:cl]}],
|
21
23
|
7 => [{:mday => 16, :name => "Día de la Virgen del Carmen", :regions => [:cl]}],
|
22
24
|
8 => [{:mday => 15, :name => "Asunción de la Virgen", :regions => [:cl]}],
|
23
25
|
9 => [{:mday => 18, :name => "Independencia Nacional", :regions => [:cl]},
|
24
26
|
{:mday => 19, :name => "Día de las Glorias del Ejército", :regions => [:cl]}],
|
25
|
-
10 => [{:mday => 12, :name => "Encuentro de Dos Mundos", :regions => [:cl]},
|
26
|
-
{:
|
27
|
+
10 => [{:mday => 12, :year_ranges => [{:before => 1999}],:name => "Encuentro de Dos Mundos", :regions => [:cl]},
|
28
|
+
{:function => "columbus_day_cl(year)", :function_arguments => [:year], :year_ranges => [{:after => 2000}],:name => "Encuentro de Dos Mundos", :regions => [:cl]}],
|
27
29
|
11 => [{:mday => 1, :name => "Día de Todos los Santos", :regions => [:cl]}],
|
28
30
|
12 => [{:mday => 8, :name => "Inmaculada Concepción de María", :regions => [:cl]},
|
29
31
|
{:mday => 25, :name => "Navidad", :regions => [:cl]}]
|
@@ -32,7 +34,40 @@ module Holidays
|
|
32
34
|
|
33
35
|
def self.custom_methods
|
34
36
|
{
|
35
|
-
|
37
|
+
"st_peter_st_paul_cl(year)" => Proc.new { |year|
|
38
|
+
date = Date.civil(year, 6, 29)
|
39
|
+
if [2,3,4].include?(date.wday)
|
40
|
+
date -= (date.wday - 1)
|
41
|
+
elsif date.wday == 5
|
42
|
+
date += 3
|
43
|
+
end
|
44
|
+
|
45
|
+
date
|
46
|
+
},
|
47
|
+
|
48
|
+
"columbus_day_cl(year)" => Proc.new { |year|
|
49
|
+
date = Date.civil(year, 10, 12)
|
50
|
+
if [2,3,4].include?(date.wday)
|
51
|
+
date -= (date.wday - 1)
|
52
|
+
elsif date.wday == 5
|
53
|
+
date += 3
|
54
|
+
end
|
55
|
+
|
56
|
+
date
|
57
|
+
},
|
58
|
+
|
59
|
+
"other_churches_day_cl(year)" => Proc.new { |year|
|
60
|
+
date = Date.civil(year, 10, 31)
|
61
|
+
if date.wday == 2
|
62
|
+
date -= 4
|
63
|
+
elsif date.wday == 3
|
64
|
+
date += 2
|
65
|
+
end
|
66
|
+
|
67
|
+
date
|
68
|
+
},
|
69
|
+
|
70
|
+
|
36
71
|
}
|
37
72
|
end
|
38
73
|
end
|
@@ -20,12 +20,14 @@ module Holidays
|
|
20
20
|
5 => [{:mday => 5, :name => "어린이날", :regions => [:kr]}],
|
21
21
|
6 => [{:mday => 6, :name => "현충일", :regions => [:kr]}],
|
22
22
|
7 => [{:mday => 17, :type => :informal, :name => "제헌절", :regions => [:kr]}],
|
23
|
-
8 => [{:mday =>
|
23
|
+
8 => [{:mday => 14, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :name => "추석 연휴", :regions => [:kr]},
|
24
|
+
{:mday => 15, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :name => "추석", :regions => [:kr]},
|
25
|
+
{:mday => 16, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :name => "추석 연휴", :regions => [:kr]},
|
24
26
|
{:mday => 15, :name => "광복절", :regions => [:kr]}],
|
25
27
|
10 => [{:mday => 3, :name => "개천절", :regions => [:kr]},
|
26
28
|
{:mday => 9, :name => "한글날", :regions => [:kr]}],
|
27
29
|
12 => [{:mday => 25, :name => "크리스마스", :regions => [:kr]},
|
28
|
-
{:mday =>
|
30
|
+
{:mday => 30, :function => "lunar_to_solar(year, month, day, region)", :function_arguments => [:year, :month, :day, :region], :name => "설날 연휴", :regions => [:kr]}]
|
29
31
|
}
|
30
32
|
end
|
31
33
|
|
@@ -83,7 +83,7 @@ module Holidays
|
|
83
83
|
{:mday => 24, :name => "Pioneer Day", :regions => [:us_ut]}],
|
84
84
|
8 => [{:wday => 1, :week => 1, :name => "B.C. Day", :regions => [:ca_bc]},
|
85
85
|
{:wday => 1, :week => 1, :name => "Saskatchewan Day", :regions => [:ca_sk]},
|
86
|
-
{:wday => 1, :week => 1, :name => "Heritage Day", :regions => [:ca_ab]},
|
86
|
+
{:wday => 1, :week => 1, :type => :informal, :name => "Heritage Day", :regions => [:ca_ab]},
|
87
87
|
{:wday => 1, :week => 1, :name => "Natal Day", :regions => [:ca_ns]},
|
88
88
|
{:wday => 1, :week => 1, :name => "Civic Holiday", :regions => [:ca_nt, :ca_nu, :ca_pe]},
|
89
89
|
{:wday => 1, :week => 1, :type => :informal, :name => "Civic Holiday", :regions => [:ca_on]},
|
data/lib/holidays/version.rb
CHANGED
data/test/defs/test_defs_ca.rb
CHANGED
@@ -111,7 +111,7 @@ assert_equal "Victoria Day", (Holidays.on(Date.civil(2008, 5, 19), [:ca_ab, :ca_
|
|
111
111
|
|
112
112
|
assert_equal "Saskatchewan Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_sk])[0] || {})[:name]
|
113
113
|
|
114
|
-
assert_equal "Heritage Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_ab])[0] || {})[:name]
|
114
|
+
assert_equal "Heritage Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_ab], [:informal])[0] || {})[:name]
|
115
115
|
|
116
116
|
assert_equal "Natal Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_ns])[0] || {})[:name]
|
117
117
|
|
@@ -131,7 +131,7 @@ assert_equal "Civic Holiday", (Holidays.on(Date.civil(2015, 8, 3), [:ca_on], [:i
|
|
131
131
|
|
132
132
|
assert_equal "Saskatchewan Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_sk])[0] || {})[:name]
|
133
133
|
|
134
|
-
assert_equal "Heritage Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_ab])[0] || {})[:name]
|
134
|
+
assert_equal "Heritage Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_ab], [:informal])[0] || {})[:name]
|
135
135
|
|
136
136
|
assert_equal "Natal Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_ns])[0] || {})[:name]
|
137
137
|
|
@@ -147,7 +147,7 @@ assert_equal "Civic Holiday", (Holidays.on(Date.civil(2015, 8, 3), [:ca_on], [:i
|
|
147
147
|
|
148
148
|
assert_equal "Saskatchewan Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_sk])[0] || {})[:name]
|
149
149
|
|
150
|
-
assert_equal "Heritage Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_ab])[0] || {})[:name]
|
150
|
+
assert_equal "Heritage Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_ab], [:informal])[0] || {})[:name]
|
151
151
|
|
152
152
|
assert_equal "Natal Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_ns])[0] || {})[:name]
|
153
153
|
|
data/test/defs/test_defs_cl.rb
CHANGED
@@ -37,7 +37,13 @@ class ClDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
37
37
|
|
38
38
|
assert_equal "Día de las Glorias Navales", (Holidays.on(Date.civil(2014, 5, 21), [:cl], [:informal])[0] || {})[:name]
|
39
39
|
|
40
|
-
assert_equal "San Pedro y San Pablo", (Holidays.on(Date.civil(
|
40
|
+
assert_equal "San Pedro y San Pablo", (Holidays.on(Date.civil(1999, 6, 29), [:cl], [:informal])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "San Pedro y San Pablo", (Holidays.on(Date.civil(2000, 6, 26), [:cl], [:informal])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "San Pedro y San Pablo", (Holidays.on(Date.civil(2017, 6, 26), [:cl], [:informal])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "San Pedro y San Pablo", (Holidays.on(Date.civil(2018, 7, 2), [:cl], [:informal])[0] || {})[:name]
|
41
47
|
|
42
48
|
assert_equal "Día de la Virgen del Carmen", (Holidays.on(Date.civil(2014, 7, 16), [:cl], [:informal])[0] || {})[:name]
|
43
49
|
|
@@ -47,9 +53,11 @@ class ClDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
47
53
|
|
48
54
|
assert_equal "Día de las Glorias del Ejército", (Holidays.on(Date.civil(2014, 9, 19), [:cl], [:informal])[0] || {})[:name]
|
49
55
|
|
50
|
-
assert_equal "Encuentro de Dos Mundos", (Holidays.on(Date.civil(
|
56
|
+
assert_equal "Encuentro de Dos Mundos", (Holidays.on(Date.civil(1999, 10, 12), [:cl], [:informal])[0] || {})[:name]
|
57
|
+
|
58
|
+
assert_equal "Encuentro de Dos Mundos", (Holidays.on(Date.civil(2017, 10, 9), [:cl], [:informal])[0] || {})[:name]
|
51
59
|
|
52
|
-
assert_equal "Día de las Iglesias Evangélicas y Protestantes", (Holidays.on(Date.civil(
|
60
|
+
assert_equal "Día de las Iglesias Evangélicas y Protestantes", (Holidays.on(Date.civil(2017, 10, 27), [:cl], [:informal])[0] || {})[:name]
|
53
61
|
|
54
62
|
assert_equal "Día de Todos los Santos", (Holidays.on(Date.civil(2014, 11, 1), [:cl], [:informal])[0] || {})[:name]
|
55
63
|
|
@@ -111,7 +111,7 @@ assert_equal "Victoria Day", (Holidays.on(Date.civil(2008, 5, 19), [:ca_ab, :ca_
|
|
111
111
|
|
112
112
|
assert_equal "Saskatchewan Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_sk])[0] || {})[:name]
|
113
113
|
|
114
|
-
assert_equal "Heritage Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_ab])[0] || {})[:name]
|
114
|
+
assert_equal "Heritage Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_ab], [:informal])[0] || {})[:name]
|
115
115
|
|
116
116
|
assert_equal "Natal Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_ns])[0] || {})[:name]
|
117
117
|
|
@@ -131,7 +131,7 @@ assert_equal "Civic Holiday", (Holidays.on(Date.civil(2015, 8, 3), [:ca_on], [:i
|
|
131
131
|
|
132
132
|
assert_equal "Saskatchewan Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_sk])[0] || {})[:name]
|
133
133
|
|
134
|
-
assert_equal "Heritage Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_ab])[0] || {})[:name]
|
134
|
+
assert_equal "Heritage Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_ab], [:informal])[0] || {})[:name]
|
135
135
|
|
136
136
|
assert_equal "Natal Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_ns])[0] || {})[:name]
|
137
137
|
|
@@ -147,7 +147,7 @@ assert_equal "Civic Holiday", (Holidays.on(Date.civil(2015, 8, 3), [:ca_on], [:i
|
|
147
147
|
|
148
148
|
assert_equal "Saskatchewan Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_sk])[0] || {})[:name]
|
149
149
|
|
150
|
-
assert_equal "Heritage Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_ab])[0] || {})[:name]
|
150
|
+
assert_equal "Heritage Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_ab], [:informal])[0] || {})[:name]
|
151
151
|
|
152
152
|
assert_equal "Natal Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_ns])[0] || {})[:name]
|
153
153
|
|
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.
|
4
|
+
version: 6.1.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: 2017-08-
|
12
|
+
date: 2017-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|