zakuro 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -0
- data/lib/zakuro/calculation/base/gengou.rb +82 -0
- data/lib/zakuro/calculation/base/linear_gengou.rb +76 -0
- data/lib/zakuro/calculation/base/operated_year.rb +5 -15
- data/lib/zakuro/calculation/base/year.rb +26 -14
- data/lib/zakuro/calculation/gengou/internal/counter.rb +129 -0
- data/lib/zakuro/calculation/gengou/internal/reserve/interval.rb +183 -0
- data/lib/zakuro/calculation/gengou/internal/reserve/list.rb +382 -0
- data/lib/zakuro/calculation/gengou/internal/reserve.rb +42 -0
- data/lib/zakuro/calculation/gengou/scroll.rb +262 -0
- data/lib/zakuro/calculation/monthly/first_day.rb +3 -2
- data/lib/zakuro/calculation/monthly/month.rb +49 -2
- data/lib/zakuro/calculation/monthly/operated_month.rb +2 -2
- data/lib/zakuro/calculation/range/full_range.rb +65 -103
- data/lib/zakuro/calculation/range/operated_range.rb +13 -8
- data/lib/zakuro/calculation/range/operated_solar_terms.rb +36 -17
- data/lib/zakuro/calculation/range/transfer/gengou_scroller.rb +54 -0
- data/lib/zakuro/calculation/range/transfer/year_boundary.rb +25 -21
- data/lib/zakuro/calculation/specifier/single_day.rb +13 -35
- data/lib/zakuro/calculation/summary/single.rb +5 -2
- data/lib/zakuro/calculation/version/internal/crawler.rb +51 -0
- data/lib/zakuro/calculation/version/internal/range.rb +39 -0
- data/lib/zakuro/calculation/version/version.rb +24 -0
- data/lib/zakuro/era/japan/calendar.rb +133 -0
- data/lib/zakuro/era/japan/gengou/parser.rb +95 -25
- data/lib/zakuro/era/japan/gengou/type.rb +148 -41
- data/lib/zakuro/era/japan/gengou/validator.rb +157 -52
- data/lib/zakuro/era/japan/gengou/yaml/set-001-until-south.yaml +1870 -0
- data/lib/zakuro/era/japan/gengou/yaml/set-002-from-north.yaml +810 -0
- data/lib/zakuro/era/japan/gengou/yaml/set-003-modern.yaml +50 -0
- data/lib/zakuro/era/japan/gengou.rb +5 -5
- data/lib/zakuro/era/japan/version.rb +151 -0
- data/lib/zakuro/era/{western.rb → western/calendar.rb} +0 -0
- data/lib/zakuro/merchant.rb +12 -3
- data/lib/zakuro/operation/month/parser.rb +1 -1
- data/lib/zakuro/operation/month/type.rb +1 -1
- data/lib/zakuro/operation/month/validator.rb +1 -1
- data/lib/zakuro/output/response.rb +5 -5
- data/lib/zakuro/tools/typeconv.rb +38 -0
- data/lib/zakuro/tools/typeof.rb +4 -1
- data/lib/zakuro/version/context.rb +24 -3
- data/lib/zakuro/version/daien/daien.rb +1 -26
- data/lib/zakuro/version/genka/genka.rb +1 -26
- data/lib/zakuro/version/gihou/gihou.rb +1 -30
- data/lib/zakuro/version/gregorio/gregorio.rb +1 -9
- data/lib/zakuro/version/houryaku/houryaku.rb +1 -9
- data/lib/zakuro/version/joukyou/joukyou.rb +1 -9
- data/lib/zakuro/version/kansei/kansei.rb +1 -9
- data/lib/zakuro/version/senmyou/senmyou.rb +1 -30
- data/lib/zakuro/version/tenpou/tenpou.rb +1 -9
- data/zakuro.gemspec +1 -3
- metadata +25 -17
- data/lib/zakuro/calculation/base/multi_gengou.rb +0 -101
- data/lib/zakuro/calculation/base/multi_gengou_roller.rb +0 -218
- data/lib/zakuro/calculation/range/transfer/western_date_allocation.rb +0 -82
- data/lib/zakuro/era/japan/reki.rb +0 -91
- data/lib/zakuro/era/japan/yaml/set-001-until-south.yaml +0 -1121
- data/lib/zakuro/era/japan/yaml/set-002-from-north.yaml +0 -485
- data/lib/zakuro/era/japan/yaml/set-003-modern.yaml +0 -28
- data/lib/zakuro/version/abstract_version.rb +0 -29
- data/lib/zakuro/version.rb +0 -7
- data/lib/zakuro/version_factory.rb +0 -59
@@ -1,485 +0,0 @@
|
|
1
|
-
id: 2
|
2
|
-
name: "北朝+南北朝後"
|
3
|
-
# 明治1年9月7日
|
4
|
-
end_date: "1868-10-22"
|
5
|
-
list:
|
6
|
-
- name: "正慶"
|
7
|
-
# 1年4月28日
|
8
|
-
start_year: 1
|
9
|
-
start_date: "1332-5-23"
|
10
|
-
new_year_date: "1332-1-28"
|
11
|
-
note: ""
|
12
|
-
- name: "建武"
|
13
|
-
# 1年1月29日
|
14
|
-
start_year: 1
|
15
|
-
start_date: "1334-3-5"
|
16
|
-
new_year_date: "1334-2-5"
|
17
|
-
note: ""
|
18
|
-
- name: "暦応"
|
19
|
-
# 1年8月28日
|
20
|
-
start_year: 1
|
21
|
-
start_date: "1338-10-11"
|
22
|
-
new_year_date: "1338-1-22"
|
23
|
-
note: ""
|
24
|
-
- name: "康永"
|
25
|
-
# 1年4月27日
|
26
|
-
start_year: 1
|
27
|
-
start_date: "1342-6-1"
|
28
|
-
new_year_date: "1342-2-6"
|
29
|
-
note: ""
|
30
|
-
- name: "貞和"
|
31
|
-
# 1年10月21日
|
32
|
-
start_year: 1
|
33
|
-
start_date: "1345-11-15"
|
34
|
-
new_year_date: "1345-2-3"
|
35
|
-
note: ""
|
36
|
-
- name: "観応"
|
37
|
-
# 1年2月27日
|
38
|
-
start_year: 1
|
39
|
-
start_date: "1350-4-4"
|
40
|
-
new_year_date: "1350-2-8"
|
41
|
-
note: ""
|
42
|
-
- name: "文和"
|
43
|
-
# 1年9月27日
|
44
|
-
start_year: 1
|
45
|
-
start_date: "1352-11-4"
|
46
|
-
new_year_date: "1352-1-18"
|
47
|
-
note: ""
|
48
|
-
- name: "延文"
|
49
|
-
# 1年3月28日
|
50
|
-
start_year: 1
|
51
|
-
start_date: "1356-4-29"
|
52
|
-
new_year_date: "1356-2-2"
|
53
|
-
note: ""
|
54
|
-
- name: "康安"
|
55
|
-
# 1年3月29日
|
56
|
-
start_year: 1
|
57
|
-
start_date: "1361-5-4"
|
58
|
-
new_year_date: "1361-2-6"
|
59
|
-
note: ""
|
60
|
-
- name: "貞治"
|
61
|
-
# 1年9月23日
|
62
|
-
start_year: 1
|
63
|
-
start_date: "1362-10-11"
|
64
|
-
new_year_date: "1362-1-27"
|
65
|
-
note: ""
|
66
|
-
- name: "応安"
|
67
|
-
# 1年2月18日
|
68
|
-
start_year: 1
|
69
|
-
start_date: "1368-3-7"
|
70
|
-
new_year_date: "1368-1-21"
|
71
|
-
note: ""
|
72
|
-
- name: "永和"
|
73
|
-
# 1年2月27日
|
74
|
-
start_year: 1
|
75
|
-
start_date: "1375-3-29"
|
76
|
-
new_year_date: "1375-2-2"
|
77
|
-
note: ""
|
78
|
-
- name: "康暦"
|
79
|
-
# 1年3月22日
|
80
|
-
start_year: 1
|
81
|
-
start_date: "1379-4-9"
|
82
|
-
new_year_date: "1379-1-19"
|
83
|
-
note: ""
|
84
|
-
- name: "永徳"
|
85
|
-
# 1年2月24日
|
86
|
-
start_year: 1
|
87
|
-
start_date: "1381-3-20"
|
88
|
-
new_year_date: "1381-1-26"
|
89
|
-
note: ""
|
90
|
-
- name: "至徳"
|
91
|
-
# 1年2月27日
|
92
|
-
start_year: 1
|
93
|
-
start_date: "1384-3-19"
|
94
|
-
new_year_date: "1384-1-23"
|
95
|
-
note: ""
|
96
|
-
- name: "嘉慶"
|
97
|
-
# 1年8月23日
|
98
|
-
start_year: 1
|
99
|
-
start_date: "1387-10-5"
|
100
|
-
new_year_date: "1387-1-21"
|
101
|
-
note: ""
|
102
|
-
- name: "康応"
|
103
|
-
# 1年2月9日
|
104
|
-
start_year: 1
|
105
|
-
start_date: "1389-3-7"
|
106
|
-
new_year_date: "1389-1-28"
|
107
|
-
note: ""
|
108
|
-
- name: "明徳"
|
109
|
-
# 1年3月26日
|
110
|
-
start_year: 1
|
111
|
-
start_date: "1390-4-12"
|
112
|
-
new_year_date: "1390-1-17"
|
113
|
-
note: ""
|
114
|
-
- name: "応永"
|
115
|
-
# 1年7月5日
|
116
|
-
start_year: 1
|
117
|
-
start_date: "1394-8-2"
|
118
|
-
new_year_date: "1394-2-1"
|
119
|
-
note: ""
|
120
|
-
- name: "正長"
|
121
|
-
# 1年4月27日
|
122
|
-
start_year: 1
|
123
|
-
start_date: "1428-6-10"
|
124
|
-
new_year_date: "1428-1-17"
|
125
|
-
note: ""
|
126
|
-
- name: "永享"
|
127
|
-
# 1年9月5日
|
128
|
-
start_year: 1
|
129
|
-
start_date: "1429-10-3"
|
130
|
-
new_year_date: "1429-2-4"
|
131
|
-
note: ""
|
132
|
-
- name: "嘉吉"
|
133
|
-
# 1年2月17日
|
134
|
-
start_year: 1
|
135
|
-
start_date: "1441-3-10"
|
136
|
-
new_year_date: "1441-1-23"
|
137
|
-
note: ""
|
138
|
-
- name: "文安"
|
139
|
-
# 1年2月5日
|
140
|
-
start_year: 1
|
141
|
-
start_date: "1444-2-23"
|
142
|
-
new_year_date: "1444-1-20"
|
143
|
-
note: ""
|
144
|
-
- name: "宝徳"
|
145
|
-
# 1年7月28日
|
146
|
-
start_year: 1
|
147
|
-
start_date: "1449-8-16"
|
148
|
-
new_year_date: "1449-1-25"
|
149
|
-
note: ""
|
150
|
-
- name: "享徳"
|
151
|
-
# 1年7月25日
|
152
|
-
start_year: 1
|
153
|
-
start_date: "1452-8-10"
|
154
|
-
new_year_date: "1452-1-22"
|
155
|
-
note: ""
|
156
|
-
- name: "康正"
|
157
|
-
# 1年7月25日
|
158
|
-
start_year: 1
|
159
|
-
start_date: "1455-9-6"
|
160
|
-
new_year_date: "1455-1-18"
|
161
|
-
note: ""
|
162
|
-
- name: "長禄"
|
163
|
-
# 1年9月28日
|
164
|
-
start_year: 1
|
165
|
-
start_date: "1457-10-16"
|
166
|
-
new_year_date: "1457-1-26"
|
167
|
-
note: ""
|
168
|
-
- name: "寛正"
|
169
|
-
# 1年12月21日
|
170
|
-
start_year: 1
|
171
|
-
start_date: "1461-2-1"
|
172
|
-
new_year_date: "1460-1-24"
|
173
|
-
note: ""
|
174
|
-
- name: "文正"
|
175
|
-
# 1年2月28日
|
176
|
-
start_year: 1
|
177
|
-
start_date: "1466-3-14"
|
178
|
-
new_year_date: "1466-1-17"
|
179
|
-
note: ""
|
180
|
-
- name: "応仁"
|
181
|
-
# 1年3月5日
|
182
|
-
start_year: 1
|
183
|
-
start_date: "1467-4-9"
|
184
|
-
new_year_date: "1467-2-5"
|
185
|
-
note: ""
|
186
|
-
- name: "文明"
|
187
|
-
# 1年4月28日
|
188
|
-
start_year: 1
|
189
|
-
start_date: "1469-6-8"
|
190
|
-
new_year_date: "1469-2-12"
|
191
|
-
note: ""
|
192
|
-
- name: "長享"
|
193
|
-
# 1年7月20日
|
194
|
-
start_year: 1
|
195
|
-
start_date: "1487-8-9"
|
196
|
-
new_year_date: "1487-1-25"
|
197
|
-
note: ""
|
198
|
-
- name: "延徳"
|
199
|
-
# 1年8月21日
|
200
|
-
start_year: 1
|
201
|
-
start_date: "1489-9-16"
|
202
|
-
new_year_date: "1489-2-1"
|
203
|
-
note: ""
|
204
|
-
- name: "明応"
|
205
|
-
# 1年7月19日
|
206
|
-
start_year: 1
|
207
|
-
start_date: "1492-8-12"
|
208
|
-
new_year_date: "1492-1-30"
|
209
|
-
note: ""
|
210
|
-
- name: "文亀"
|
211
|
-
# 1年2月29日
|
212
|
-
start_year: 1
|
213
|
-
start_date: "1501-3-18"
|
214
|
-
new_year_date: "1501-1-19"
|
215
|
-
note: ""
|
216
|
-
- name: "永正"
|
217
|
-
# 1年2月30日
|
218
|
-
start_year: 1
|
219
|
-
start_date: "1504-3-16"
|
220
|
-
new_year_date: "1504-1-18"
|
221
|
-
note: ""
|
222
|
-
- name: "大永"
|
223
|
-
# 1年8月23日
|
224
|
-
start_year: 1
|
225
|
-
start_date: "1521-9-23"
|
226
|
-
new_year_date: "1521-2-8"
|
227
|
-
note: ""
|
228
|
-
- name: "享禄"
|
229
|
-
# 1年8月20日
|
230
|
-
start_year: 1
|
231
|
-
start_date: "1528-9-3"
|
232
|
-
new_year_date: "1528-1-22"
|
233
|
-
note: ""
|
234
|
-
- name: "天文"
|
235
|
-
# 1年7月29日
|
236
|
-
start_year: 1
|
237
|
-
start_date: "1532-8-29"
|
238
|
-
new_year_date: "1532-2-6"
|
239
|
-
note: ""
|
240
|
-
- name: "弘治"
|
241
|
-
# 1年10月23日
|
242
|
-
start_year: 1
|
243
|
-
start_date: "1555-11-7"
|
244
|
-
new_year_date: "1555-1-23"
|
245
|
-
note: ""
|
246
|
-
- name: "永禄"
|
247
|
-
# 1年2月28日
|
248
|
-
start_year: 1
|
249
|
-
start_date: "1558-3-18"
|
250
|
-
new_year_date: "1558-1-20"
|
251
|
-
note: ""
|
252
|
-
- name: "元亀"
|
253
|
-
# 1年4月23日
|
254
|
-
start_year: 1
|
255
|
-
start_date: "1570-5-27"
|
256
|
-
new_year_date: "1570-2-5"
|
257
|
-
note: ""
|
258
|
-
- name: "天正"
|
259
|
-
# 1年7月28日
|
260
|
-
start_year: 1
|
261
|
-
start_date: "1573-8-25"
|
262
|
-
new_year_date: "1573-2-3"
|
263
|
-
note: ""
|
264
|
-
- name: "文禄"
|
265
|
-
# 1年12月8日
|
266
|
-
start_year: 1
|
267
|
-
start_date: "1593-1-10"
|
268
|
-
new_year_date: "1592-2-13"
|
269
|
-
note: ""
|
270
|
-
- name: "慶長"
|
271
|
-
# 1年10月27日
|
272
|
-
start_year: 1
|
273
|
-
start_date: "1596-12-16"
|
274
|
-
new_year_date: "1596-1-30"
|
275
|
-
note: ""
|
276
|
-
- name: "元和"
|
277
|
-
# 1年7月13日
|
278
|
-
start_year: 1
|
279
|
-
start_date: "1615-9-5"
|
280
|
-
new_year_date: "1615-1-29"
|
281
|
-
note: ""
|
282
|
-
- name: "寛永"
|
283
|
-
# 1年2月30日
|
284
|
-
start_year: 1
|
285
|
-
start_date: "1624-4-17"
|
286
|
-
new_year_date: "1624-2-19"
|
287
|
-
note: ""
|
288
|
-
- name: "正保"
|
289
|
-
# 1年12月16日
|
290
|
-
start_year: 1
|
291
|
-
start_date: "1645-1-13"
|
292
|
-
new_year_date: "1644-2-8"
|
293
|
-
note: ""
|
294
|
-
- name: "慶安"
|
295
|
-
# 1年2月15日
|
296
|
-
start_year: 1
|
297
|
-
start_date: "1648-4-7"
|
298
|
-
new_year_date: "1648-1-25"
|
299
|
-
note: ""
|
300
|
-
- name: "承応"
|
301
|
-
# 1年9月18日
|
302
|
-
start_year: 1
|
303
|
-
start_date: "1652-10-20"
|
304
|
-
new_year_date: "1652-2-10"
|
305
|
-
note: ""
|
306
|
-
- name: "明暦"
|
307
|
-
# 1年4月13日
|
308
|
-
start_year: 1
|
309
|
-
start_date: "1655-5-18"
|
310
|
-
new_year_date: "1655-2-7"
|
311
|
-
note: ""
|
312
|
-
- name: "万治"
|
313
|
-
# 1年7月23日
|
314
|
-
start_year: 1
|
315
|
-
start_date: "1658-8-21"
|
316
|
-
new_year_date: "1658-2-3"
|
317
|
-
note: ""
|
318
|
-
- name: "寛文"
|
319
|
-
# 1年4月25日
|
320
|
-
start_year: 1
|
321
|
-
start_date: "1661-5-23"
|
322
|
-
new_year_date: "1661-1-31"
|
323
|
-
note: ""
|
324
|
-
- name: "延宝"
|
325
|
-
# 1年9月21日
|
326
|
-
start_year: 1
|
327
|
-
start_date: "1673-10-30"
|
328
|
-
new_year_date: "1673-2-17"
|
329
|
-
note: ""
|
330
|
-
- name: "天和"
|
331
|
-
# 1年9月29日
|
332
|
-
start_year: 1
|
333
|
-
start_date: "1681-11-9"
|
334
|
-
new_year_date: "1681-2-19"
|
335
|
-
note: ""
|
336
|
-
- name: "貞享"
|
337
|
-
# 1年2月21日
|
338
|
-
start_year: 1
|
339
|
-
start_date: "1684-4-5"
|
340
|
-
new_year_date: "1684-2-16"
|
341
|
-
note: ""
|
342
|
-
- name: "元禄"
|
343
|
-
# 1年9月30日
|
344
|
-
start_year: 1
|
345
|
-
start_date: "1688-10-23"
|
346
|
-
new_year_date: "1688-2-2"
|
347
|
-
note: ""
|
348
|
-
- name: "宝永"
|
349
|
-
# 1年3月13日
|
350
|
-
start_year: 1
|
351
|
-
start_date: "1704-4-16"
|
352
|
-
new_year_date: "1704-2-5"
|
353
|
-
note: ""
|
354
|
-
- name: "正徳"
|
355
|
-
# 1年4月25日
|
356
|
-
start_year: 1
|
357
|
-
start_date: "1711-6-11"
|
358
|
-
new_year_date: "1711-2-17"
|
359
|
-
note: ""
|
360
|
-
- name: "享保"
|
361
|
-
# 1年6月22日
|
362
|
-
start_year: 1
|
363
|
-
start_date: "1716-8-9"
|
364
|
-
new_year_date: "1716-1-25"
|
365
|
-
note: ""
|
366
|
-
- name: "元文"
|
367
|
-
# 1年4月28日
|
368
|
-
start_year: 1
|
369
|
-
start_date: "1736-6-7"
|
370
|
-
new_year_date: "1736-2-12"
|
371
|
-
note: ""
|
372
|
-
- name: "寛保"
|
373
|
-
# 1年2月27日
|
374
|
-
start_year: 1
|
375
|
-
start_date: "1741-4-12"
|
376
|
-
new_year_date: "1741-2-16"
|
377
|
-
note: ""
|
378
|
-
- name: "延享"
|
379
|
-
# 1年2月21日
|
380
|
-
start_year: 1
|
381
|
-
start_date: "1744-4-3"
|
382
|
-
new_year_date: "1744-2-14"
|
383
|
-
note: ""
|
384
|
-
- name: "寛延"
|
385
|
-
# 1年7月12日
|
386
|
-
start_year: 1
|
387
|
-
start_date: "1748-8-5"
|
388
|
-
new_year_date: "1748-1-30"
|
389
|
-
note: ""
|
390
|
-
- name: "宝暦"
|
391
|
-
# 1年10月27日
|
392
|
-
start_year: 1
|
393
|
-
start_date: "1751-12-14"
|
394
|
-
new_year_date: "1751-1-27"
|
395
|
-
note: ""
|
396
|
-
- name: "明和"
|
397
|
-
# 1年6月2日
|
398
|
-
start_year: 1
|
399
|
-
start_date: "1764-6-30"
|
400
|
-
new_year_date: "1764-2-2"
|
401
|
-
note: ""
|
402
|
-
- name: "安永"
|
403
|
-
# 1年11月16日
|
404
|
-
start_year: 1
|
405
|
-
start_date: "1772-12-10"
|
406
|
-
new_year_date: "1772-2-4"
|
407
|
-
note: ""
|
408
|
-
- name: "天明"
|
409
|
-
# 1年4月2日
|
410
|
-
start_year: 1
|
411
|
-
start_date: "1781-4-25"
|
412
|
-
new_year_date: "1781-1-24"
|
413
|
-
note: ""
|
414
|
-
- name: "寛政"
|
415
|
-
# 1年1月25日
|
416
|
-
start_year: 1
|
417
|
-
start_date: "1789-2-19"
|
418
|
-
new_year_date: "1789-1-26"
|
419
|
-
note: ""
|
420
|
-
- name: "享和"
|
421
|
-
# 1年2月5日
|
422
|
-
start_year: 1
|
423
|
-
start_date: "1801-3-19"
|
424
|
-
new_year_date: "1801-2-13"
|
425
|
-
note: ""
|
426
|
-
- name: "文化"
|
427
|
-
# 1年2月11日
|
428
|
-
start_year: 1
|
429
|
-
start_date: "1804-3-22"
|
430
|
-
new_year_date: "1804-2-11"
|
431
|
-
note: ""
|
432
|
-
- name: "文政"
|
433
|
-
# 1年4月22日
|
434
|
-
start_year: 1
|
435
|
-
start_date: "1818-5-26"
|
436
|
-
new_year_date: "1818-2-5"
|
437
|
-
note: ""
|
438
|
-
- name: "天保"
|
439
|
-
# 1年12月10日
|
440
|
-
start_year: 1
|
441
|
-
start_date: "1831-1-23"
|
442
|
-
new_year_date: "1830-1-25"
|
443
|
-
note: ""
|
444
|
-
- name: "弘化"
|
445
|
-
# 1年12月2日
|
446
|
-
start_year: 1
|
447
|
-
start_date: "1845-1-9"
|
448
|
-
new_year_date: "1844-2-18"
|
449
|
-
note: ""
|
450
|
-
- name: "嘉永"
|
451
|
-
# 1年2月28日
|
452
|
-
start_year: 1
|
453
|
-
start_date: "1848-4-1"
|
454
|
-
new_year_date: "1848-2-5"
|
455
|
-
note: ""
|
456
|
-
- name: "安政"
|
457
|
-
# 1年11月27日
|
458
|
-
start_year: 1
|
459
|
-
start_date: "1855-1-15"
|
460
|
-
new_year_date: "1854-1-29"
|
461
|
-
note: ""
|
462
|
-
- name: "万延"
|
463
|
-
# 1年3月18日
|
464
|
-
start_year: 1
|
465
|
-
start_date: "1860-4-8"
|
466
|
-
new_year_date: "1860-1-23"
|
467
|
-
note: ""
|
468
|
-
- name: "文久"
|
469
|
-
# 1年2月19日
|
470
|
-
start_year: 1
|
471
|
-
start_date: "1861-3-29"
|
472
|
-
new_year_date: "1861-2-10"
|
473
|
-
note: ""
|
474
|
-
- name: "元治"
|
475
|
-
# 1年2月20日
|
476
|
-
start_year: 1
|
477
|
-
start_date: "1864-3-27"
|
478
|
-
new_year_date: "1864-2-8"
|
479
|
-
note: ""
|
480
|
-
- name: "慶応"
|
481
|
-
# 1年4月7日
|
482
|
-
start_year: 1
|
483
|
-
start_date: "1865-5-1"
|
484
|
-
new_year_date: "1865-1-27"
|
485
|
-
note: ""
|
@@ -1,28 +0,0 @@
|
|
1
|
-
id: 3
|
2
|
-
name: "近代(一世一元)"
|
3
|
-
end_date: "9999-12-31"
|
4
|
-
list:
|
5
|
-
- name: "明治"
|
6
|
-
# 1年9月8日
|
7
|
-
start_year: 1
|
8
|
-
start_date: "1868-10-23"
|
9
|
-
new_year_date: "1868-1-25"
|
10
|
-
note: ""
|
11
|
-
- name: "大正"
|
12
|
-
# 1年7月30日
|
13
|
-
start_year: 1
|
14
|
-
start_date: "1912-7-30"
|
15
|
-
new_year_date: "1912-1-1"
|
16
|
-
note: ""
|
17
|
-
- name: "昭和"
|
18
|
-
# 1年12月25日
|
19
|
-
start_year: 1
|
20
|
-
start_date: "1926-12-25"
|
21
|
-
new_year_date: "1926-1-1"
|
22
|
-
note: ""
|
23
|
-
- name: "令和"
|
24
|
-
# 1年5月1日
|
25
|
-
start_year: 1
|
26
|
-
start_date: "2019-5-1"
|
27
|
-
new_year_date: "2019-1-1"
|
28
|
-
note: ""
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# :nodoc:
|
4
|
-
module Zakuro
|
5
|
-
#
|
6
|
-
# AbstractVersion 暦インターフェース
|
7
|
-
#
|
8
|
-
# @abstract 暦日を引き当てるためのインターフェース
|
9
|
-
#
|
10
|
-
class AbstractVersion
|
11
|
-
# @return [True] 暦の使用可
|
12
|
-
# @return [False] 暦の使用不可
|
13
|
-
RELEASE = false
|
14
|
-
|
15
|
-
#
|
16
|
-
# 西暦日から和暦日に変換する
|
17
|
-
#
|
18
|
-
# @param [Date] western_date 西暦日
|
19
|
-
#
|
20
|
-
# @return [Result::Single] 和暦日
|
21
|
-
#
|
22
|
-
# @raise [NotImplementedError] オーバーライドなし
|
23
|
-
#
|
24
|
-
def self.to_japan_date(western_date:)
|
25
|
-
raise NotImplementedError,
|
26
|
-
"must be implemented on #{self.class}##{__method__}(#{western_date})"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
data/lib/zakuro/version.rb
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative './era/japan/reki'
|
4
|
-
require_relative './era/western'
|
5
|
-
require_relative './version/genka/genka'
|
6
|
-
require_relative './version/gihou/gihou'
|
7
|
-
require_relative './version/daien/daien'
|
8
|
-
require_relative './version/senmyou/senmyou'
|
9
|
-
require_relative './version/joukyou/joukyou'
|
10
|
-
require_relative './version/houryaku/houryaku'
|
11
|
-
require_relative './version/kansei/kansei'
|
12
|
-
require_relative './version/tenpou/tenpou'
|
13
|
-
require_relative './version/gregorio/gregorio'
|
14
|
-
|
15
|
-
# :nodoc:
|
16
|
-
module Zakuro
|
17
|
-
#
|
18
|
-
# VersionFactory 暦生成
|
19
|
-
#
|
20
|
-
class VersionFactory
|
21
|
-
# :reek:TooManyStatements { max_statements: 6 }
|
22
|
-
# :reek:UncommunicativeVariableName {accept: e}
|
23
|
-
|
24
|
-
#
|
25
|
-
# 実行可能な暦を取得する
|
26
|
-
#
|
27
|
-
# @param [Date] date 西暦日
|
28
|
-
#
|
29
|
-
# @return [AbstractVersion] 暦クラス
|
30
|
-
#
|
31
|
-
def self.get_runnable_constant(date:)
|
32
|
-
class_name = Japan::Reki.class_name(
|
33
|
-
date: Western::Calendar.create(date: date)
|
34
|
-
)
|
35
|
-
constant = Object.const_get(class_name)
|
36
|
-
raise ArgumentError, 'unreleased version' unless constant::RELEASE
|
37
|
-
|
38
|
-
constant
|
39
|
-
rescue StandardError => e
|
40
|
-
raise e
|
41
|
-
end
|
42
|
-
|
43
|
-
# :reek:UncommunicativeVariableName {accept: e}
|
44
|
-
|
45
|
-
#
|
46
|
-
# 西暦日から和暦日に変換する
|
47
|
-
#
|
48
|
-
# @param [Date] western_date 西暦日
|
49
|
-
#
|
50
|
-
# @return [Result::Single] 和暦日
|
51
|
-
#
|
52
|
-
def self.to_japan_date(western_date:)
|
53
|
-
runnable = VersionFactory.get_runnable_constant(date: western_date)
|
54
|
-
runnable.to_japan_date(western_date: western_date)
|
55
|
-
rescue StandardError => e
|
56
|
-
raise Output::ZakuroError, e.message
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|