zakuro 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +3 -0
- data/README.md +6 -4
- data/VERSION +1 -1
- data/doc/operation/transfer.rb +8 -8
- data/lib/zakuro/calculation/base/gengou.rb +46 -0
- data/lib/zakuro/calculation/era/gengou/{scroll.rb → abstract_scroll.rb} +6 -8
- data/lib/zakuro/calculation/era/gengou/dated_scroll.rb +30 -0
- data/lib/zakuro/calculation/era/gengou/internal/reserve/{list.rb → abstract_list.rb} +37 -51
- data/lib/zakuro/calculation/era/gengou/internal/reserve/{range.rb → abstract_range.rb} +17 -17
- data/lib/zakuro/calculation/era/gengou/internal/reserve/dated_list.rb +48 -0
- data/lib/zakuro/calculation/era/gengou/internal/reserve/dated_range.rb +30 -0
- data/lib/zakuro/calculation/era/gengou/internal/reserve/empty_link.rb +158 -0
- data/lib/zakuro/calculation/era/gengou/internal/reserve/named_list.rb +125 -0
- data/lib/zakuro/calculation/era/gengou/internal/reserve/named_range.rb +75 -0
- data/lib/zakuro/calculation/era/gengou/internal/reserve.rb +2 -3
- data/lib/zakuro/calculation/era/gengou/named_scroll.rb +30 -0
- data/lib/zakuro/calculation/monthly/month.rb +39 -0
- data/lib/zakuro/calculation/monthly/operated_month.rb +1 -1
- data/lib/zakuro/calculation/range/{full_range.rb → abstract_full_range.rb} +5 -4
- data/lib/zakuro/calculation/range/{operated_range.rb → abstract_operation_range.rb} +9 -11
- data/lib/zakuro/calculation/range/dated_full_range.rb +32 -0
- data/lib/zakuro/calculation/range/dated_operation_range.rb +33 -0
- data/lib/zakuro/calculation/range/named_full_range.rb +38 -0
- data/lib/zakuro/calculation/range/named_operation_range.rb +36 -0
- data/lib/zakuro/calculation/range/operated_solar_terms.rb +0 -2
- data/lib/zakuro/calculation/{specifier → summary}/internal/month.rb +1 -1
- data/lib/zakuro/calculation/summary/japan/range.rb +152 -0
- data/lib/zakuro/calculation/summary/japan/single.rb +118 -0
- data/lib/zakuro/calculation/summary/japan/specifier/single_day.rb +91 -0
- data/lib/zakuro/calculation/summary/western/range.rb +124 -0
- data/lib/zakuro/calculation/summary/western/single.rb +113 -0
- data/lib/zakuro/calculation/summary/western/specifier/multiple_day.rb +169 -0
- data/lib/zakuro/calculation/summary/western/specifier/single_day.rb +93 -0
- data/lib/zakuro/condition.rb +1 -2
- data/lib/zakuro/era/japan/gengou/alignment/aligner.rb +89 -74
- data/lib/zakuro/era/japan/gengou/alignment/division.rb +125 -122
- data/lib/zakuro/era/japan/gengou/alignment/line.rb +141 -122
- data/lib/zakuro/era/japan/gengou/alignment/linear_gengou.rb +171 -168
- data/lib/zakuro/era/japan/gengou/alignment.rb +38 -25
- data/lib/zakuro/era/japan/gengou/resource/parser.rb +183 -182
- data/lib/zakuro/era/japan/gengou/resource/type.rb +233 -232
- data/lib/zakuro/era/japan/gengou/resource/validator.rb +255 -254
- data/lib/zakuro/era/japan/gengou/resource.rb +23 -22
- data/lib/zakuro/era/japan/gengou.rb +5 -20
- data/lib/zakuro/era/western/calendar.rb +9 -9
- data/lib/zakuro/exception/case/pattern.rb +35 -0
- data/lib/zakuro/exception/case/preset.rb +51 -0
- data/lib/zakuro/exception/case/template.rb +48 -0
- data/lib/zakuro/exception/cause.rb +28 -0
- data/lib/zakuro/exception/exception.rb +37 -0
- data/lib/zakuro/exception/zakuro_error.rb +28 -0
- data/lib/zakuro/gateway/locale/date.rb +127 -0
- data/lib/zakuro/gateway/locale/range.rb +67 -0
- data/lib/zakuro/gateway/range.rb +99 -0
- data/lib/zakuro/gateway/single.rb +70 -0
- data/lib/zakuro/merchant.rb +8 -44
- data/lib/zakuro/operation/month/parser.rb +9 -9
- data/lib/zakuro/operation/month/type.rb +31 -31
- data/lib/zakuro/operation/month/validator.rb +49 -49
- data/lib/zakuro/operation/yaml/month.yaml +3736 -3736
- data/lib/zakuro/output/logger.rb +17 -3
- data/lib/zakuro/result/data/day.rb +43 -0
- data/lib/zakuro/result/data/gengou.rb +35 -0
- data/lib/zakuro/result/data/month.rb +63 -0
- data/lib/zakuro/result/data/single_day.rb +48 -0
- data/lib/zakuro/result/data/solar_term.rb +35 -0
- data/lib/zakuro/result/data/year.rb +45 -0
- data/lib/zakuro/result/operation/month/annotation.rb +40 -0
- data/lib/zakuro/result/operation/month/bundle.rb +36 -0
- data/lib/zakuro/result/operation/month/history.rb +54 -0
- data/lib/zakuro/result/operation/operation.rb +44 -0
- data/lib/zakuro/result/result.rb +4 -2
- metadata +46 -14
- data/lib/zakuro/calculation/specifier/multiple_day.rb +0 -162
- data/lib/zakuro/calculation/specifier/single_day.rb +0 -87
- data/lib/zakuro/calculation/summary/range.rb +0 -120
- data/lib/zakuro/calculation/summary/single.rb +0 -110
- data/lib/zakuro/result/data.rb +0 -187
- data/lib/zakuro/result/operation.rb +0 -114
@@ -1,114 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# :nodoc:
|
4
|
-
module Zakuro
|
5
|
-
#
|
6
|
-
# Result 演算結果
|
7
|
-
#
|
8
|
-
module Result
|
9
|
-
#
|
10
|
-
# 運用情報
|
11
|
-
#
|
12
|
-
module Operation
|
13
|
-
#
|
14
|
-
# Bundle 運用情報
|
15
|
-
#
|
16
|
-
class Bundle
|
17
|
-
# @return [True] 運用あり
|
18
|
-
# @return [False] 運用なし
|
19
|
-
attr_reader :operated
|
20
|
-
# @return [Month::Bundle] 月別履歴情報
|
21
|
-
attr_reader :month
|
22
|
-
# @return [Data::SingleDay] 計算値
|
23
|
-
attr_reader :original
|
24
|
-
|
25
|
-
#
|
26
|
-
# 初期化
|
27
|
-
#
|
28
|
-
# @param [True, False] operated 運用有無
|
29
|
-
# @param [Month::Bundle] month 月別履歴情報
|
30
|
-
# @param [Data::SingleDay] original 計算値
|
31
|
-
#
|
32
|
-
def initialize(operated:, month:, original:)
|
33
|
-
@operated = operated
|
34
|
-
@month = month
|
35
|
-
@original = original
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
#
|
40
|
-
# Month 運用情報(月)
|
41
|
-
#
|
42
|
-
module Month
|
43
|
-
#
|
44
|
-
# Bundle 月履歴集約情報
|
45
|
-
#
|
46
|
-
class Bundle
|
47
|
-
# @return [History] 月別履歴情報(当月)
|
48
|
-
attr_reader :current
|
49
|
-
# @return [History] 月別履歴情報(影響を与えた月)
|
50
|
-
attr_reader :parent
|
51
|
-
|
52
|
-
def initialize(current: History.new, parent: History.new)
|
53
|
-
@current = current
|
54
|
-
@parent = parent
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
#
|
59
|
-
# History 月別履歴情報
|
60
|
-
#
|
61
|
-
class History
|
62
|
-
# @return [String] ID
|
63
|
-
attr_reader :id
|
64
|
-
# @return [String] 月初日の西暦日
|
65
|
-
attr_reader :western_date
|
66
|
-
# @return [Integer] 原文頁数
|
67
|
-
attr_reader :page
|
68
|
-
# @return [Integer] 原文注釈番号
|
69
|
-
attr_reader :number
|
70
|
-
# @return [Array<Zakuro::Result::Operation::Annotation>] 注釈
|
71
|
-
attr_reader :annotations
|
72
|
-
|
73
|
-
#
|
74
|
-
# 初期化
|
75
|
-
#
|
76
|
-
# @param [String] id ID
|
77
|
-
# @param [String] western_date 月初日の西暦日
|
78
|
-
# @param [Integer] page 原文頁数
|
79
|
-
# @param [Integer] number 原文注釈番号
|
80
|
-
# @param [Array<Annotation>] annotations 注釈
|
81
|
-
#
|
82
|
-
def initialize(id: '', western_date: '', page: -1, number: -1, annotations: [])
|
83
|
-
@id = id
|
84
|
-
@western_date = western_date
|
85
|
-
@page = page
|
86
|
-
@number = number
|
87
|
-
@annotations = annotations
|
88
|
-
end
|
89
|
-
end
|
90
|
-
|
91
|
-
#
|
92
|
-
# Annotation 注釈
|
93
|
-
#
|
94
|
-
class Annotation
|
95
|
-
# @return [String] 注釈内容
|
96
|
-
attr_reader :description
|
97
|
-
# @return [String] 注釈補記
|
98
|
-
attr_reader :note
|
99
|
-
|
100
|
-
#
|
101
|
-
# 初期化
|
102
|
-
#
|
103
|
-
# @param [String] description 注釈内容
|
104
|
-
# @param [<Type>] note 注釈補記
|
105
|
-
#
|
106
|
-
def initialize(description:, note:)
|
107
|
-
@description = description
|
108
|
-
@note = note
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
113
|
-
end
|
114
|
-
end
|