zakuro 0.7.2 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/VERSION +1 -1
- data/lib/zakuro/calculation/base/gengou.rb +5 -5
- data/lib/zakuro/calculation/base/linear_gengou.rb +5 -5
- data/lib/zakuro/calculation/base/operated_year.rb +23 -21
- data/lib/zakuro/calculation/base/year.rb +3 -3
- data/lib/zakuro/calculation/cycle/abstract_remainder.rb +50 -44
- data/lib/zakuro/calculation/cycle/abstract_solar_term.rb +28 -24
- data/lib/zakuro/calculation/cycle/zodiac.rb +22 -20
- data/lib/zakuro/calculation/era/gengou/abstract_scroll.rb +38 -29
- data/lib/zakuro/calculation/era/gengou/internal/connector.rb +4 -4
- data/lib/zakuro/calculation/era/gengou/internal/counter.rb +16 -16
- data/lib/zakuro/calculation/era/gengou/internal/publisher.rb +74 -72
- data/lib/zakuro/calculation/era/gengou/internal/reserve/abstract_list.rb +16 -16
- data/lib/zakuro/calculation/era/gengou/internal/reserve/abstract_range.rb +58 -35
- data/lib/zakuro/calculation/era/gengou/internal/reserve/dated_list.rb +3 -3
- data/lib/zakuro/calculation/era/gengou/internal/reserve/empty_link.rb +111 -113
- data/lib/zakuro/calculation/era/gengou/internal/reserve/named_list.rb +6 -6
- data/lib/zakuro/calculation/era/gengou/internal/reserve/named_range.rb +7 -9
- data/lib/zakuro/calculation/era/gengou/internal/reserve.rb +22 -20
- data/lib/zakuro/calculation/era/version/internal/crawler.rb +39 -22
- data/lib/zakuro/calculation/era/version/version.rb +12 -10
- data/lib/zakuro/calculation/monthly/abstract_lunar_phase.rb +13 -9
- data/lib/zakuro/calculation/monthly/const.rb +18 -0
- data/lib/zakuro/calculation/monthly/initialized_month.rb +39 -37
- data/lib/zakuro/calculation/monthly/month.rb +15 -15
- data/lib/zakuro/calculation/monthly/month_label.rb +4 -4
- data/lib/zakuro/calculation/monthly/operated_month.rb +36 -85
- data/lib/zakuro/calculation/monthly/operated_solar_term.rb +80 -0
- data/lib/zakuro/calculation/range/abstract_full_range.rb +34 -21
- data/lib/zakuro/calculation/range/abstract_operation_range.rb +109 -107
- data/lib/zakuro/calculation/range/medieval_annual_range.rb +64 -63
- data/lib/zakuro/calculation/range/operated_solar_term.rb +220 -0
- data/lib/zakuro/calculation/range/transfer/gengou_scroller.rb +32 -29
- data/lib/zakuro/calculation/range/transfer/year_boundary.rb +115 -117
- data/lib/zakuro/calculation/stella/lunar/abstract_location.rb +1 -1
- data/lib/zakuro/calculation/stella/lunar/choukei_value.rb +48 -46
- data/lib/zakuro/calculation/stella/solar/abstract_average.rb +31 -26
- data/lib/zakuro/calculation/stella/solar/abstract_location.rb +5 -5
- data/lib/zakuro/calculation/stella/solar/choukei_value.rb +114 -114
- data/lib/zakuro/calculation/summary/internal/day.rb +21 -19
- data/lib/zakuro/calculation/summary/internal/month.rb +25 -12
- data/lib/zakuro/calculation/summary/internal/operation.rb +68 -67
- data/lib/zakuro/calculation/summary/internal/option.rb +66 -50
- data/lib/zakuro/calculation/summary/japan/range.rb +145 -124
- data/lib/zakuro/calculation/summary/japan/single.rb +87 -87
- data/lib/zakuro/calculation/summary/japan/specifier/single_day.rb +54 -52
- data/lib/zakuro/calculation/summary/japan/specifier/specified_range.rb +34 -0
- data/lib/zakuro/calculation/summary/western/range.rb +95 -92
- data/lib/zakuro/calculation/summary/western/single.rb +78 -76
- data/lib/zakuro/calculation/summary/western/specifier/multiple_day.rb +123 -124
- data/lib/zakuro/calculation/summary/western/specifier/single_day.rb +60 -58
- data/lib/zakuro/calculation/type/old_float.rb +2 -2
- data/lib/zakuro/condition.rb +121 -111
- data/lib/zakuro/context/context.rb +1 -1
- data/lib/zakuro/context/option.rb +31 -29
- data/lib/zakuro/context/version_class_resolver.rb +26 -24
- data/lib/zakuro/era/japan/calendar.rb +35 -33
- data/lib/zakuro/era/japan/gengou/alignment/aligner.rb +4 -4
- data/lib/zakuro/era/japan/gengou/alignment/division.rb +117 -118
- data/lib/zakuro/era/japan/gengou/alignment/line.rb +7 -5
- data/lib/zakuro/era/japan/gengou/alignment/linear_gengou.rb +20 -14
- data/lib/zakuro/era/japan/gengou/alignment.rb +27 -25
- data/lib/zakuro/era/japan/gengou/resource/parser.rb +51 -36
- data/lib/zakuro/era/japan/gengou/resource/type.rb +39 -37
- data/lib/zakuro/era/japan/gengou/resource/validator.rb +34 -32
- data/lib/zakuro/era/japan/gengou.rb +28 -26
- data/lib/zakuro/era/japan/version.rb +18 -16
- data/lib/zakuro/era/western/calendar.rb +102 -90
- data/lib/zakuro/exception/case/preset.rb +2 -2
- data/lib/zakuro/exception/exception.rb +15 -13
- data/lib/zakuro/exception/zakuro_error.rb +1 -1
- data/lib/zakuro/gateway/locale/date.rb +2 -2
- data/lib/zakuro/gateway/locale/range.rb +3 -3
- data/lib/zakuro/gateway/range.rb +1 -1
- data/lib/zakuro/gateway/single.rb +13 -2
- data/lib/zakuro/merchant.rb +1 -1
- data/lib/zakuro/operation/month/parser.rb +252 -251
- data/lib/zakuro/operation/month/type.rb +17 -8
- data/lib/zakuro/operation/month/validator.rb +148 -144
- data/lib/zakuro/operation/operation.rb +38 -36
- data/lib/zakuro/output/response.rb +112 -113
- data/lib/zakuro/result/operation/month/annotation.rb +2 -2
- data/lib/zakuro/result/operation/month/history.rb +2 -2
- data/lib/zakuro/result/operation/month.rb +31 -0
- data/lib/zakuro/result/operation.rb +39 -0
- data/lib/zakuro/result/result.rb +3 -3
- data/lib/zakuro/tools/stringifier.rb +66 -64
- data/lib/zakuro/tools/typeconv.rb +17 -15
- data/lib/zakuro/tools/typeof.rb +15 -13
- data/lib/zakuro/version/daien/monthly/lunar_phase.rb +10 -12
- data/lib/zakuro/version/daien/range/annual_range.rb +19 -17
- data/lib/zakuro/version/daien/stella/lunar/adjustment.rb +42 -39
- data/lib/zakuro/version/daien/stella/lunar/localization.rb +16 -14
- data/lib/zakuro/version/daien/stella/lunar/value.rb +52 -49
- data/lib/zakuro/version/daien/stella/origin/average_november.rb +15 -13
- data/lib/zakuro/version/daien/stella/origin/lunar_age.rb +23 -21
- data/lib/zakuro/version/daien/stella/origin/winter_solstice.rb +22 -20
- data/lib/zakuro/version/daien/stella/solar/adjustment.rb +12 -10
- data/lib/zakuro/version/daien/stella/solar/average.rb +53 -51
- data/lib/zakuro/version/daien/stella/solar/interval.rb +19 -17
- data/lib/zakuro/version/daien/stella/solar/value.rb +13 -11
- data/lib/zakuro/version/genka/cycle/remainder.rb +2 -2
- data/lib/zakuro/version/genka/monthly/lunar_phase.rb +7 -5
- data/lib/zakuro/version/genka/range/annual_range.rb +48 -44
- data/lib/zakuro/version/genka/stella/origin/first_term.rb +30 -28
- data/lib/zakuro/version/genka/stella/origin/january.rb +22 -20
- data/lib/zakuro/version/gihou/monthly/lunar_phase.rb +9 -9
- data/lib/zakuro/version/gihou/range/annual_range.rb +19 -17
- data/lib/zakuro/version/gihou/stella/lunar/adjustment.rb +42 -39
- data/lib/zakuro/version/gihou/stella/lunar/localization.rb +16 -14
- data/lib/zakuro/version/gihou/stella/lunar/value.rb +52 -49
- data/lib/zakuro/version/gihou/stella/origin/average_november.rb +15 -13
- data/lib/zakuro/version/gihou/stella/origin/lunar_age.rb +23 -21
- data/lib/zakuro/version/gihou/stella/origin/winter_solstice.rb +24 -22
- data/lib/zakuro/version/gihou/stella/solar/adjustment.rb +12 -10
- data/lib/zakuro/version/gihou/stella/solar/average.rb +52 -50
- data/lib/zakuro/version/gihou/stella/solar/interval.rb +19 -17
- data/lib/zakuro/version/gihou/stella/solar/value.rb +13 -11
- data/lib/zakuro/version/senmyou/monthly/lunar_phase.rb +10 -10
- data/lib/zakuro/version/senmyou/range/annual_range.rb +19 -17
- data/lib/zakuro/version/senmyou/stella/lunar/adjustment.rb +42 -38
- data/lib/zakuro/version/senmyou/stella/lunar/localization.rb +16 -14
- data/lib/zakuro/version/senmyou/stella/lunar/value.rb +39 -36
- data/lib/zakuro/version/senmyou/stella/origin/average_november.rb +15 -13
- data/lib/zakuro/version/senmyou/stella/origin/lunar_age.rb +23 -21
- data/lib/zakuro/version/senmyou/stella/origin/winter_solstice.rb +22 -20
- data/lib/zakuro/version/senmyou/stella/solar/adjustment.rb +12 -10
- data/lib/zakuro/version/senmyou/stella/solar/average.rb +52 -50
- data/lib/zakuro/version/senmyou/stella/solar/interval.rb +19 -17
- data/lib/zakuro/version/senmyou/stella/solar/value.rb +13 -11
- metadata +12 -9
- data/lib/zakuro/calculation/range/operated_solar_terms.rb +0 -218
- data/lib/zakuro/result/operation/bundle.rb +0 -44
- data/lib/zakuro/result/operation/month/bundle.rb +0 -36
@@ -20,122 +20,124 @@ module Zakuro
|
|
20
20
|
EMPTY_STRING = '-'
|
21
21
|
BOOLEANS = %w[true false].freeze
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
23
|
+
class << self
|
24
|
+
#
|
25
|
+
# 有効文字列か
|
26
|
+
#
|
27
|
+
# @param [String] str 対象文字列
|
28
|
+
#
|
29
|
+
# @return [True] 有効
|
30
|
+
# @return [False] 無効
|
31
|
+
#
|
32
|
+
def string?(str: '')
|
33
|
+
return false if str == ''
|
33
34
|
|
34
|
-
|
35
|
+
return false unless str
|
35
36
|
|
36
|
-
|
37
|
-
|
37
|
+
str.is_a?(String)
|
38
|
+
end
|
38
39
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
40
|
+
#
|
41
|
+
# 有効文字列(空文字許容)か
|
42
|
+
#
|
43
|
+
# @param [String] str 対象文字列
|
44
|
+
#
|
45
|
+
# @return [True] 有効
|
46
|
+
# @return [False] 無効
|
47
|
+
#
|
48
|
+
def empiable_string?(str: '')
|
49
|
+
return false unless str
|
49
50
|
|
50
|
-
|
51
|
-
|
51
|
+
str.is_a?(String)
|
52
|
+
end
|
52
53
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
54
|
+
#
|
55
|
+
# 正数か
|
56
|
+
#
|
57
|
+
# @param [String] str 対象文字列
|
58
|
+
#
|
59
|
+
# @return [True] 正数
|
60
|
+
# @return [False] 負数
|
61
|
+
#
|
62
|
+
def positive?(str: '')
|
63
|
+
return true if str == EMPTY_STRING
|
63
64
|
|
64
|
-
|
65
|
+
return false unless str
|
65
66
|
|
66
|
-
|
67
|
-
|
67
|
+
/^[0-9]+$/.match?(str)
|
68
|
+
end
|
68
69
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
70
|
+
#
|
71
|
+
# 数値か
|
72
|
+
#
|
73
|
+
# @param [String] str 対象文字列
|
74
|
+
#
|
75
|
+
# @return [True] 数値
|
76
|
+
# @return [False] 非数値
|
77
|
+
#
|
78
|
+
def num?(str: '')
|
79
|
+
return true if str == EMPTY_STRING
|
79
80
|
|
80
|
-
|
81
|
+
return false unless str
|
81
82
|
|
82
|
-
|
83
|
-
|
83
|
+
/^[-0-9]+$/.match?(str)
|
84
|
+
end
|
84
85
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
86
|
+
#
|
87
|
+
# booleanか
|
88
|
+
#
|
89
|
+
# @param [String] str 対象文字列
|
90
|
+
#
|
91
|
+
# @return [True] boolean
|
92
|
+
# @return [False] 非boolean
|
93
|
+
#
|
94
|
+
def bool?(str: '')
|
95
|
+
BOOLEANS.include?(str)
|
96
|
+
end
|
96
97
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
98
|
+
#
|
99
|
+
# boolean(空許容)か
|
100
|
+
#
|
101
|
+
# @param [String] str 対象文字列
|
102
|
+
#
|
103
|
+
# @return [True] boolean
|
104
|
+
# @return [False] 非boolean
|
105
|
+
#
|
106
|
+
def empiable_bool?(str: '')
|
107
|
+
return true if str == EMPTY_STRING
|
107
108
|
|
108
|
-
|
109
|
-
|
109
|
+
bool?(str: str)
|
110
|
+
end
|
110
111
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
112
|
+
#
|
113
|
+
# 月差分か
|
114
|
+
#
|
115
|
+
# @param [String] str 対象文字列
|
116
|
+
#
|
117
|
+
# @return [True] 有効
|
118
|
+
# @return [False] 無効
|
119
|
+
#
|
120
|
+
def month_days?(str: '')
|
121
|
+
return true if str == EMPTY_STRING
|
121
122
|
|
122
|
-
|
123
|
+
return false unless str
|
123
124
|
|
124
|
-
|
125
|
-
|
125
|
+
/^[大小]$/.match?(str)
|
126
|
+
end
|
126
127
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
128
|
+
#
|
129
|
+
# 西暦日か
|
130
|
+
#
|
131
|
+
# @param [String] str 対象文字列
|
132
|
+
#
|
133
|
+
# @return [True] 有効
|
134
|
+
# @return [False] 無効
|
135
|
+
#
|
136
|
+
def western_date?(str: '')
|
137
|
+
return Western::Calendar.new if str == EMPTY_STRING
|
137
138
|
|
138
|
-
|
139
|
+
Western::Calendar.valid_date_string(text: str)
|
140
|
+
end
|
139
141
|
end
|
140
142
|
end
|
141
143
|
|
@@ -381,9 +383,9 @@ module Zakuro
|
|
381
383
|
|
382
384
|
prefix = "[#{@index}] invalid"
|
383
385
|
|
384
|
-
failed +=
|
386
|
+
failed += month.validate
|
385
387
|
|
386
|
-
failed +=
|
388
|
+
failed += solar_term.validate
|
387
389
|
|
388
390
|
failed.push("#{prefix} 'days'. #{@days}") unless days?
|
389
391
|
|
@@ -432,11 +434,11 @@ module Zakuro
|
|
432
434
|
def validate
|
433
435
|
failed = []
|
434
436
|
|
435
|
-
failed +=
|
437
|
+
failed += number.validate
|
436
438
|
|
437
|
-
failed +=
|
439
|
+
failed += leaped.validate
|
438
440
|
|
439
|
-
failed +=
|
441
|
+
failed += days.validate
|
440
442
|
|
441
443
|
failed
|
442
444
|
end
|
@@ -473,7 +475,7 @@ module Zakuro
|
|
473
475
|
end
|
474
476
|
|
475
477
|
def days?
|
476
|
-
Types.positive?(str:
|
478
|
+
Types.positive?(str: days)
|
477
479
|
end
|
478
480
|
|
479
481
|
# :reek:TooManyStatements { max_statements: 6 }
|
@@ -488,9 +490,9 @@ module Zakuro
|
|
488
490
|
|
489
491
|
prefix = "[#{index}][solar_term] invalid"
|
490
492
|
|
491
|
-
failed +=
|
493
|
+
failed += source.validate
|
492
494
|
|
493
|
-
failed +=
|
495
|
+
failed += destination.validate
|
494
496
|
|
495
497
|
failed.push("#{prefix} 'days'. #{@days}") unless days?
|
496
498
|
|
@@ -537,27 +539,27 @@ module Zakuro
|
|
537
539
|
def validate
|
538
540
|
failed = []
|
539
541
|
|
540
|
-
prefix = "[#{
|
542
|
+
prefix = "[#{diff_index}][solar_term.src] invalid"
|
541
543
|
|
542
|
-
failed.push("#{prefix} 'index'. #{
|
544
|
+
failed.push("#{prefix} 'index'. #{index}") unless index?
|
543
545
|
|
544
|
-
failed.push("#{prefix} 'to'. #{
|
546
|
+
failed.push("#{prefix} 'to'. #{to}") unless to?
|
545
547
|
|
546
|
-
failed.push("#{prefix} 'zodiac_name'. #{
|
548
|
+
failed.push("#{prefix} 'zodiac_name'. #{zodiac_name}") unless zodiac_name?
|
547
549
|
|
548
550
|
failed
|
549
551
|
end
|
550
552
|
|
551
553
|
def index?
|
552
|
-
Types.positive?(str:
|
554
|
+
Types.positive?(str: index)
|
553
555
|
end
|
554
556
|
|
555
557
|
def to?
|
556
|
-
Types.western_date?(str:
|
558
|
+
Types.western_date?(str: to)
|
557
559
|
end
|
558
560
|
|
559
561
|
def zodiac_name?
|
560
|
-
Types.string?(str:
|
562
|
+
Types.string?(str: zodiac_name)
|
561
563
|
end
|
562
564
|
end
|
563
565
|
|
@@ -600,27 +602,27 @@ module Zakuro
|
|
600
602
|
def validate
|
601
603
|
failed = []
|
602
604
|
|
603
|
-
prefix = "[#{
|
605
|
+
prefix = "[#{diff_index}][solar_term.dest] invalid"
|
604
606
|
|
605
|
-
failed.push("#{prefix} 'index'. #{
|
607
|
+
failed.push("#{prefix} 'index'. #{index}") unless index?
|
606
608
|
|
607
|
-
failed.push("#{prefix} 'from'. #{
|
609
|
+
failed.push("#{prefix} 'from'. #{from}") unless from?
|
608
610
|
|
609
|
-
failed.push("#{prefix} 'zodiac_name'. #{
|
611
|
+
failed.push("#{prefix} 'zodiac_name'. #{zodiac_name}") unless zodiac_name?
|
610
612
|
|
611
613
|
failed
|
612
614
|
end
|
613
615
|
|
614
616
|
def index?
|
615
|
-
Types.positive?(str:
|
617
|
+
Types.positive?(str: index)
|
616
618
|
end
|
617
619
|
|
618
620
|
def from?
|
619
|
-
Types.western_date?(str:
|
621
|
+
Types.western_date?(str: from)
|
620
622
|
end
|
621
623
|
|
622
624
|
def zodiac_name?
|
623
|
-
Types.string?(str:
|
625
|
+
Types.string?(str: zodiac_name)
|
624
626
|
end
|
625
627
|
end
|
626
628
|
end
|
@@ -660,21 +662,21 @@ module Zakuro
|
|
660
662
|
def validate
|
661
663
|
failed = []
|
662
664
|
|
663
|
-
prefix = "[#{
|
665
|
+
prefix = "[#{index}][#{NAME}] invalid"
|
664
666
|
|
665
|
-
failed.push("#{prefix} 'src'. #{
|
667
|
+
failed.push("#{prefix} 'src'. #{src}") unless src?
|
666
668
|
|
667
|
-
failed.push("#{prefix} 'dest'. #{
|
669
|
+
failed.push("#{prefix} 'dest'. #{dest}") unless dest?
|
668
670
|
|
669
671
|
failed
|
670
672
|
end
|
671
673
|
|
672
674
|
def src?
|
673
|
-
Types.positive?(str:
|
675
|
+
Types.positive?(str: src)
|
674
676
|
end
|
675
677
|
|
676
678
|
def dest?
|
677
|
-
Types.positive?(str:
|
679
|
+
Types.positive?(str: dest)
|
678
680
|
end
|
679
681
|
end
|
680
682
|
|
@@ -713,21 +715,21 @@ module Zakuro
|
|
713
715
|
def validate
|
714
716
|
failed = []
|
715
717
|
|
716
|
-
prefix = "[#{
|
718
|
+
prefix = "[#{index}][#{NAME}] invalid"
|
717
719
|
|
718
|
-
failed.push("#{prefix} 'src'. #{
|
720
|
+
failed.push("#{prefix} 'src'. #{src}") unless src?
|
719
721
|
|
720
|
-
failed.push("#{prefix} 'dest'. #{
|
722
|
+
failed.push("#{prefix} 'dest'. #{dest}") unless dest?
|
721
723
|
|
722
724
|
failed
|
723
725
|
end
|
724
726
|
|
725
727
|
def src?
|
726
|
-
Types.empiable_bool?(str:
|
728
|
+
Types.empiable_bool?(str: src)
|
727
729
|
end
|
728
730
|
|
729
731
|
def dest?
|
730
|
-
Types.empiable_bool?(str:
|
732
|
+
Types.empiable_bool?(str: dest)
|
731
733
|
end
|
732
734
|
end
|
733
735
|
|
@@ -766,36 +768,38 @@ module Zakuro
|
|
766
768
|
def validate
|
767
769
|
failed = []
|
768
770
|
|
769
|
-
prefix = "[#{
|
771
|
+
prefix = "[#{index}][#{NAME}] invalid"
|
770
772
|
|
771
|
-
failed.push("#{prefix} 'src'. #{
|
773
|
+
failed.push("#{prefix} 'src'. #{src}") unless src?
|
772
774
|
|
773
|
-
failed.push("#{prefix} 'dest'. #{
|
775
|
+
failed.push("#{prefix} 'dest'. #{dest}") unless dest?
|
774
776
|
|
775
777
|
failed
|
776
778
|
end
|
777
779
|
|
778
780
|
def src?
|
779
|
-
Types.month_days?(str:
|
781
|
+
Types.month_days?(str: src)
|
780
782
|
end
|
781
783
|
|
782
784
|
def dest?
|
783
|
-
Types.month_days?(str:
|
785
|
+
Types.month_days?(str: dest)
|
784
786
|
end
|
785
787
|
end
|
786
788
|
|
787
789
|
# :reek:TooManyStatements { max_statements: 7 }
|
788
790
|
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
791
|
+
class << self
|
792
|
+
def run(yaml_hash: {})
|
793
|
+
failed = []
|
794
|
+
yaml_hash.each_with_index do |history, index|
|
795
|
+
failed += MonthHistory.new(index: index, yaml_hash: history).validate
|
796
|
+
failed += Annotation.new(index: index, yaml_hash: history).validate
|
797
|
+
failed += Reference.new(index: index, yaml_hash: history).validate
|
798
|
+
failed += Diffs.new(index: index, yaml_hash: history['diffs']).validate
|
799
|
+
end
|
797
800
|
|
798
|
-
|
801
|
+
failed
|
802
|
+
end
|
799
803
|
end
|
800
804
|
end
|
801
805
|
end
|
@@ -16,51 +16,53 @@ module Zakuro
|
|
16
16
|
__dir__
|
17
17
|
))
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
class << self
|
20
|
+
#
|
21
|
+
# 変更履歴(月)を返す
|
22
|
+
#
|
23
|
+
# @return [Array<MonthHistory>] 変更履歴
|
24
|
+
#
|
25
|
+
def month_histories
|
26
|
+
MONTH_HISTORIES
|
27
|
+
end
|
27
28
|
|
28
|
-
|
29
|
+
# :reek:ControlParameter
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
31
|
+
#
|
32
|
+
# 変更履歴を特定する
|
33
|
+
#
|
34
|
+
# @param [Western::Calendar] western_date 月初日の西暦日
|
35
|
+
#
|
36
|
+
# @return [Operation::MonthHistory] 変更履歴
|
37
|
+
#
|
38
|
+
def specify_history(western_date:)
|
39
|
+
month_histroies = month_histories
|
40
|
+
|
41
|
+
month_histroies.each do |history|
|
42
|
+
return history if western_date == history.western_date
|
43
|
+
end
|
39
44
|
|
40
|
-
|
41
|
-
return history if western_date == history.western_date
|
45
|
+
Operation::MonthHistory.new
|
42
46
|
end
|
43
47
|
|
44
|
-
|
45
|
-
end
|
48
|
+
# :reek:ControlParameter
|
46
49
|
|
47
|
-
|
50
|
+
#
|
51
|
+
# 変更履歴を特定する
|
52
|
+
#
|
53
|
+
# @param [Western::Calendar] id 変更履歴ID
|
54
|
+
#
|
55
|
+
# @return [Operation::MonthHistory] 変更履歴
|
56
|
+
#
|
57
|
+
def specify_history_by_id(id:)
|
58
|
+
month_histroies = month_histories
|
48
59
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
# @param [Western::Calendar] id 変更履歴ID
|
53
|
-
#
|
54
|
-
# @return [Operation::MonthHistory] 変更履歴
|
55
|
-
#
|
56
|
-
def self.specify_history_by_id(id:)
|
57
|
-
month_histroies = Operation.month_histories
|
60
|
+
month_histroies.each do |history|
|
61
|
+
return history if id == history.id
|
62
|
+
end
|
58
63
|
|
59
|
-
|
60
|
-
return history if id == history.id
|
64
|
+
Operation::MonthHistory.new
|
61
65
|
end
|
62
|
-
|
63
|
-
Operation::MonthHistory.new
|
64
66
|
end
|
65
67
|
end
|
66
68
|
end
|