holidays 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/data/{SYNTAX → SYNTAX.rdoc} +1 -1
- data/data/br.yaml +74 -0
- data/data/ca.yaml +2 -2
- data/data/fi.yaml +95 -0
- data/data/index.yaml +4 -1
- data/data/jp.yaml +202 -0
- data/holidays.gemspec +130 -120
- data/lib/holidays.rb +1 -1
- data/lib/holidays/MANIFEST +20 -17
- data/lib/holidays/br.rb +36 -0
- data/lib/holidays/ca.rb +1 -1
- data/lib/holidays/fi.rb +54 -0
- data/lib/holidays/jp.rb +109 -0
- data/lib/holidays/north_america.rb +1 -1
- data/lib/holidays/scandinavia.rb +37 -7
- data/rakefile.rb +1 -1
- data/test/defs/test_defs_br.rb +31 -0
- data/test/defs/test_defs_ca.rb +1 -1
- data/test/defs/test_defs_fi.rb +33 -0
- data/test/defs/test_defs_jp.rb +50 -0
- data/test/defs/test_defs_north_america.rb +1 -1
- data/test/defs/test_defs_scandinavia.rb +24 -1
- metadata +18 -7
- data/.gitignore +0 -3
@@ -0,0 +1,50 @@
|
|
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: data/jp.yaml
|
7
|
+
class JpDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_jp
|
10
|
+
{Date.civil(2008,1,1) => '元日',
|
11
|
+
Date.civil(2010,1,11) => '成人の日',
|
12
|
+
Date.civil(2008,2,11) => '建国記念日',
|
13
|
+
Date.civil(2008,4,29) => '昭和の日',
|
14
|
+
Date.civil(2008,5,3) => '憲法記念日',
|
15
|
+
Date.civil(2008,5,5) => 'こどもの日',
|
16
|
+
Date.civil(2010,7,19) => '海の日',
|
17
|
+
Date.civil(2010,9,20) => '敬老の日',
|
18
|
+
Date.civil(2010,10,11) => '体育の日',
|
19
|
+
Date.civil(2008,11,3) => '文化の日',
|
20
|
+
Date.civil(2008,11,23) => '勤労感謝の日',
|
21
|
+
Date.civil(2008,12,23) => '天皇誕生日',
|
22
|
+
Date.civil(2010,3,22) => '振替休日',
|
23
|
+
Date.civil(2008,11,24) => '振替休日',
|
24
|
+
}.each do |date, name|
|
25
|
+
assert_equal name, (Holidays.on(date, :jp, :informal)[0] || {})[:name]
|
26
|
+
end
|
27
|
+
|
28
|
+
# vernal equinox day
|
29
|
+
[Date.civil(2004,3,20), Date.civil(2005,3,20), Date.civil(2006,3,21),
|
30
|
+
Date.civil(2007,3,21), Date.civil(2008,3,20), Date.civil(2009,3,20),
|
31
|
+
Date.civil(2010,3,21)].each do |date|
|
32
|
+
assert_equal '春分の日', Holidays.on(date, :jp)[0][:name]
|
33
|
+
end
|
34
|
+
|
35
|
+
# national culture day
|
36
|
+
[Date.civil(2004,9,23), Date.civil(2005,9,23), Date.civil(2006,9,23),
|
37
|
+
Date.civil(2007,9,23), Date.civil(2008,9,23), Date.civil(2009,9,23),
|
38
|
+
Date.civil(2010,9,23), Date.civil(2011,9,23), Date.civil(2012,9,22),
|
39
|
+
Date.civil(2013,9,23)].each do |date|
|
40
|
+
assert_equal '秋分の日', Holidays.on(date, :jp)[0][:name]
|
41
|
+
end
|
42
|
+
|
43
|
+
# citizens holiday
|
44
|
+
[Date.civil(2032,9,21), Date.civil(2049,9,21), Date.civil(2009,9,22),
|
45
|
+
Date.civil(2015,9,22), Date.civil(2026,9,22)].each do |date|
|
46
|
+
assert_equal '国民の休日', Holidays.on(date, :jp)[0][:name]
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
@@ -14,7 +14,7 @@ class North_americaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
14
14
|
Date.civil(2008,7,1) => 'Canada Day',
|
15
15
|
Date.civil(2008,9,1) => 'Labour Day',
|
16
16
|
Date.civil(2008,10,13) => 'Thanksgiving',
|
17
|
-
Date.civil(2008,11,11) => '
|
17
|
+
Date.civil(2008,11,11) => 'Remembrance Day',
|
18
18
|
Date.civil(2008,12,25) => 'Christmas Day',
|
19
19
|
Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name|
|
20
20
|
assert_equal name, (Holidays.on(date, :ca, :informal)[0] || {})[:name]
|
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded: data/dk.yaml, data/is.yaml, data/no.yaml, data/se.yaml
|
6
|
+
# Definitions loaded: data/dk.yaml, data/is.yaml, data/no.yaml, data/se.yaml, data/fi.yaml
|
7
7
|
class ScandinaviaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_scandinavia
|
@@ -90,5 +90,28 @@ end
|
|
90
90
|
Date.civil(2008,12,26) => 'Annandag jul'}.each do |date, name|
|
91
91
|
assert_equal name, (Holidays.on(date, :se, :informal)[0] || {})[:name]
|
92
92
|
end
|
93
|
+
|
94
|
+
{Date.civil(2008,1,1) => 'Uudenvuodenpäivä',
|
95
|
+
Date.civil(2008,1,6) => 'Loppiainen',
|
96
|
+
Date.civil(2008,3,21) => 'Pitkäperjantai',
|
97
|
+
Date.civil(2008,3,23) => 'Pääsiäispäivä',
|
98
|
+
Date.civil(2008,3,24) => '2. Pääsiäispäivä',
|
99
|
+
Date.civil(2008,5,1) => 'Vappu',
|
100
|
+
Date.civil(2008,5,1) => 'Helatorstai',
|
101
|
+
Date.civil(2008,5,11) => 'Helluntaipäivä',
|
102
|
+
Date.civil(2005,6,25) => 'Juhannuspäivä',
|
103
|
+
Date.civil(2006,6,24) => 'Juhannuspäivä',
|
104
|
+
Date.civil(2007,6,23) => 'Juhannuspäivä',
|
105
|
+
Date.civil(2008,6,21) => 'Juhannuspäivä',
|
106
|
+
Date.civil(2005,11,5) => 'Pyhäinpäivä',
|
107
|
+
Date.civil(2006,11,4) => 'Pyhäinpäivä',
|
108
|
+
Date.civil(2007,11,3) => 'Pyhäinpäivä',
|
109
|
+
Date.civil(2008,11,1) => 'Pyhäinpäivä',
|
110
|
+
Date.civil(2008,12,6) => 'Itsenäisyyspäivä',
|
111
|
+
Date.civil(2008,12,24) => 'Jouluaatto',
|
112
|
+
Date.civil(2008,12,25) => 'Joulupäivä',
|
113
|
+
Date.civil(2008,12,26) => 'Tapaninpäivä'}.each do |date, name|
|
114
|
+
assert_equal name, (Holidays.on(date, :fi, :informal)[0] || {})[:name]
|
115
|
+
end
|
93
116
|
end
|
94
117
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 1
|
9
|
+
version: 1.0.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Alex Dunae
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-04-29 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -29,25 +29,27 @@ extra_rdoc_files:
|
|
29
29
|
- LICENSE
|
30
30
|
- README.rdoc
|
31
31
|
files:
|
32
|
-
- .gitignore
|
33
32
|
- CHANGELOG
|
34
33
|
- LICENSE
|
35
34
|
- README.rdoc
|
36
35
|
- REFERENCES
|
37
|
-
- data/SYNTAX
|
36
|
+
- data/SYNTAX.rdoc
|
38
37
|
- data/au.yaml
|
38
|
+
- data/br.yaml
|
39
39
|
- data/build_defs.rb
|
40
40
|
- data/ca.yaml
|
41
41
|
- data/cz.yaml
|
42
42
|
- data/de.yaml
|
43
43
|
- data/dk.yaml
|
44
44
|
- data/es.yaml
|
45
|
+
- data/fi.yaml
|
45
46
|
- data/fr.yaml
|
46
47
|
- data/gb.yaml
|
47
48
|
- data/ie.yaml
|
48
49
|
- data/index.yaml
|
49
50
|
- data/is.yaml
|
50
51
|
- data/it.yaml
|
52
|
+
- data/jp.yaml
|
51
53
|
- data/mx.yaml
|
52
54
|
- data/nl.yaml
|
53
55
|
- data/no.yaml
|
@@ -64,17 +66,20 @@ files:
|
|
64
66
|
- lib/holidays.rb
|
65
67
|
- lib/holidays/MANIFEST
|
66
68
|
- lib/holidays/au.rb
|
69
|
+
- lib/holidays/br.rb
|
67
70
|
- lib/holidays/ca.rb
|
68
71
|
- lib/holidays/cz.rb
|
69
72
|
- lib/holidays/de.rb
|
70
73
|
- lib/holidays/dk.rb
|
71
74
|
- lib/holidays/es.rb
|
72
75
|
- lib/holidays/europe.rb
|
76
|
+
- lib/holidays/fi.rb
|
73
77
|
- lib/holidays/fr.rb
|
74
78
|
- lib/holidays/gb.rb
|
75
79
|
- lib/holidays/ie.rb
|
76
80
|
- lib/holidays/is.rb
|
77
81
|
- lib/holidays/it.rb
|
82
|
+
- lib/holidays/jp.rb
|
78
83
|
- lib/holidays/mx.rb
|
79
84
|
- lib/holidays/nl.rb
|
80
85
|
- lib/holidays/no.rb
|
@@ -90,17 +95,20 @@ files:
|
|
90
95
|
- lib/holidays/za.rb
|
91
96
|
- rakefile.rb
|
92
97
|
- test/defs/test_defs_au.rb
|
98
|
+
- test/defs/test_defs_br.rb
|
93
99
|
- test/defs/test_defs_ca.rb
|
94
100
|
- test/defs/test_defs_cz.rb
|
95
101
|
- test/defs/test_defs_de.rb
|
96
102
|
- test/defs/test_defs_dk.rb
|
97
103
|
- test/defs/test_defs_es.rb
|
98
104
|
- test/defs/test_defs_europe.rb
|
105
|
+
- test/defs/test_defs_fi.rb
|
99
106
|
- test/defs/test_defs_fr.rb
|
100
107
|
- test/defs/test_defs_gb.rb
|
101
108
|
- test/defs/test_defs_ie.rb
|
102
109
|
- test/defs/test_defs_is.rb
|
103
110
|
- test/defs/test_defs_it.rb
|
111
|
+
- test/defs/test_defs_jp.rb
|
104
112
|
- test/defs/test_defs_mx.rb
|
105
113
|
- test/defs/test_defs_nl.rb
|
106
114
|
- test/defs/test_defs_no.rb
|
@@ -122,8 +130,8 @@ homepage: https://github.com/alexdunae/holidays
|
|
122
130
|
licenses: []
|
123
131
|
|
124
132
|
post_install_message:
|
125
|
-
rdoc_options:
|
126
|
-
|
133
|
+
rdoc_options: []
|
134
|
+
|
127
135
|
require_paths:
|
128
136
|
- lib
|
129
137
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -151,17 +159,20 @@ specification_version: 3
|
|
151
159
|
summary: A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!
|
152
160
|
test_files:
|
153
161
|
- test/defs/test_defs_au.rb
|
162
|
+
- test/defs/test_defs_br.rb
|
154
163
|
- test/defs/test_defs_ca.rb
|
155
164
|
- test/defs/test_defs_cz.rb
|
156
165
|
- test/defs/test_defs_de.rb
|
157
166
|
- test/defs/test_defs_dk.rb
|
158
167
|
- test/defs/test_defs_es.rb
|
159
168
|
- test/defs/test_defs_europe.rb
|
169
|
+
- test/defs/test_defs_fi.rb
|
160
170
|
- test/defs/test_defs_fr.rb
|
161
171
|
- test/defs/test_defs_gb.rb
|
162
172
|
- test/defs/test_defs_ie.rb
|
163
173
|
- test/defs/test_defs_is.rb
|
164
174
|
- test/defs/test_defs_it.rb
|
175
|
+
- test/defs/test_defs_jp.rb
|
165
176
|
- test/defs/test_defs_mx.rb
|
166
177
|
- test/defs/test_defs_nl.rb
|
167
178
|
- test/defs/test_defs_no.rb
|
data/.gitignore
DELETED