zakuro 0.9.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/README.md +41 -8
  4. data/VERSION +1 -1
  5. data/doc/gengou.md +1 -1
  6. data/doc/operation/csv/month.csv +5 -5
  7. data/doc/operation/operation.xlsx +0 -0
  8. data/images/logo-text.png +0 -0
  9. data/lib/zakuro/calculation/base/gengou.rb +2 -4
  10. data/lib/zakuro/calculation/base/year.rb +1 -1
  11. data/lib/zakuro/calculation/era/gengou/abstract_scroll.rb +2 -2
  12. data/lib/zakuro/calculation/era/gengou/internal/publisher.rb +1 -1
  13. data/lib/zakuro/calculation/era/gengou/internal/reserve/abstract_list.rb +4 -4
  14. data/lib/zakuro/calculation/era/gengou/internal/reserve/empty_link.rb +3 -3
  15. data/lib/zakuro/calculation/era/gengou/internal/reserve/named_list.rb +1 -1
  16. data/lib/zakuro/calculation/era/version/internal/crawler.rb +3 -3
  17. data/lib/zakuro/calculation/monthly/abstract_lunar_phase.rb +1 -1
  18. data/lib/zakuro/calculation/monthly/internal/date_comparer.rb +78 -0
  19. data/lib/zakuro/calculation/monthly/{meta → internal/meta}/all_solar_term.rb +1 -1
  20. data/lib/zakuro/calculation/monthly/{meta → internal/meta}/meta_collector.rb +2 -2
  21. data/lib/zakuro/calculation/monthly/{first_day.rb → internal/part/first_day.rb} +2 -2
  22. data/lib/zakuro/calculation/monthly/{meta.rb → internal/part/meta.rb} +1 -1
  23. data/lib/zakuro/calculation/monthly/internal/solar_term_selector.rb +203 -0
  24. data/lib/zakuro/calculation/monthly/month.rb +30 -125
  25. data/lib/zakuro/calculation/monthly/operated_month.rb +5 -2
  26. data/lib/zakuro/calculation/range/medieval_annual_range.rb +0 -2
  27. data/lib/zakuro/calculation/range/transfer/gengou_scroller.rb +24 -10
  28. data/lib/zakuro/calculation/stella/solar/abstract_average.rb +3 -3
  29. data/lib/zakuro/calculation/summary/internal/option/dropped_date.rb +102 -0
  30. data/lib/zakuro/calculation/summary/internal/option/vanished_date.rb +111 -0
  31. data/lib/zakuro/calculation/summary/internal/option.rb +4 -137
  32. data/lib/zakuro/calculation/summary/japan/range.rb +4 -5
  33. data/lib/zakuro/calculation/summary/western/single.rb +0 -2
  34. data/lib/zakuro/context/version_class_resolver.rb +5 -5
  35. data/lib/zakuro/era/japan/calendar.rb +4 -4
  36. data/lib/zakuro/era/japan/gengou/alignment/division.rb +2 -2
  37. data/lib/zakuro/era/japan/gengou/alignment/linear_gengou.rb +2 -2
  38. data/lib/zakuro/era/japan/gengou/alignment.rb +5 -3
  39. data/lib/zakuro/era/japan/gengou/resource/parser.rb +17 -16
  40. data/lib/zakuro/era/japan/gengou/resource/validator.rb +3 -394
  41. data/lib/zakuro/era/japan/gengou/resource/yaml/set-001-until-south.yaml +2 -2
  42. data/lib/zakuro/era/japan/gengou.rb +3 -3
  43. data/lib/zakuro/era/japan/type/base/both/date.rb +51 -0
  44. data/lib/zakuro/era/japan/type/base/both/year.rb +53 -0
  45. data/lib/zakuro/era/japan/type/base/gengou.rb +177 -0
  46. data/lib/zakuro/era/japan/type/base/gengou_set.rb +78 -0
  47. data/lib/zakuro/era/japan/type/base/switch_date.rb +74 -0
  48. data/lib/zakuro/era/japan/type/base/version_range.rb +189 -0
  49. data/lib/zakuro/era/japan/type/validation/both/date.rb +99 -0
  50. data/lib/zakuro/era/japan/type/validation/both/year.rb +75 -0
  51. data/lib/zakuro/era/japan/type/validation/gengou.rb +93 -0
  52. data/lib/zakuro/era/japan/type/validation/gengou_set.rb +133 -0
  53. data/lib/zakuro/era/japan/type/validation/switch_date.rb +73 -0
  54. data/lib/zakuro/era/japan/type/validation/version_range.rb +109 -0
  55. data/lib/zakuro/era/japan/type/validation/version_root.rb +102 -0
  56. data/lib/zakuro/era/japan/version/resource/parser.rb +266 -0
  57. data/lib/zakuro/era/japan/version/resource/validator.rb +37 -0
  58. data/lib/zakuro/era/japan/version/resource/yaml/version.yaml +80 -0
  59. data/lib/zakuro/era/japan/version/resource.rb +22 -0
  60. data/lib/zakuro/era/japan/version.rb +4 -115
  61. data/lib/zakuro/era/western/calendar.rb +2 -2
  62. data/lib/zakuro/exception/zakuro_error.rb +1 -1
  63. data/lib/zakuro/merchant.rb +5 -5
  64. data/lib/zakuro/operation/month/parser.rb +2 -2
  65. data/lib/zakuro/operation/yaml/month.yaml +5 -5
  66. data/lib/zakuro/output/logger.rb +4 -4
  67. data/lib/zakuro/parameter/catalog/basis_date.rb +55 -0
  68. data/lib/zakuro/parameter/catalog/column.rb +57 -0
  69. data/lib/zakuro/parameter/catalog/option.rb +60 -0
  70. data/lib/zakuro/parameter/catalog/range.rb +81 -0
  71. data/lib/zakuro/parameter/condition.rb +108 -0
  72. data/lib/zakuro/result/core.rb +2 -2
  73. data/lib/zakuro/{tools → tool}/remainder_comparer.rb +2 -4
  74. data/lib/zakuro/{tools → tool}/stringifier.rb +3 -3
  75. data/lib/zakuro/{tools → tool}/typeconv.rb +2 -2
  76. data/lib/zakuro/{tools → tool}/typeof.rb +2 -2
  77. data/lib/zakuro/version/daien/const/number.rb +42 -39
  78. data/lib/zakuro/version/daien/const/remainder.rb +38 -35
  79. data/lib/zakuro/version/daien/cycle/remainder.rb +77 -74
  80. data/lib/zakuro/version/daien/cycle/solar_term.rb +18 -15
  81. data/lib/zakuro/version/daien/daien.rb +8 -5
  82. data/lib/zakuro/version/daien/monthly/lunar_phase.rb +67 -64
  83. data/lib/zakuro/version/daien/option/dropped_date/parameter.rb +15 -12
  84. data/lib/zakuro/version/daien/option/vanished_date/parameter.rb +15 -12
  85. data/lib/zakuro/version/daien/range/annual_range.rb +27 -24
  86. data/lib/zakuro/version/daien/stella/lunar/adjustment.rb +209 -206
  87. data/lib/zakuro/version/daien/stella/lunar/localization.rb +32 -29
  88. data/lib/zakuro/version/daien/stella/lunar/location.rb +53 -50
  89. data/lib/zakuro/version/daien/stella/lunar/value.rb +65 -62
  90. data/lib/zakuro/version/daien/stella/origin/average_november.rb +23 -20
  91. data/lib/zakuro/version/daien/stella/origin/lunar_age.rb +42 -39
  92. data/lib/zakuro/version/daien/stella/origin/winter_solstice.rb +44 -41
  93. data/lib/zakuro/version/daien/stella/solar/adjustment.rb +74 -71
  94. data/lib/zakuro/version/daien/stella/solar/average.rb +68 -65
  95. data/lib/zakuro/version/daien/stella/solar/interval.rb +95 -92
  96. data/lib/zakuro/version/daien/stella/solar/location.rb +41 -38
  97. data/lib/zakuro/version/daien/stella/solar/value.rb +21 -18
  98. data/lib/zakuro/version/genka/const/number.rb +31 -28
  99. data/lib/zakuro/version/genka/const/remainder.rb +20 -17
  100. data/lib/zakuro/version/genka/cycle/remainder.rb +72 -69
  101. data/lib/zakuro/version/genka/cycle/solar_term.rb +18 -15
  102. data/lib/zakuro/version/genka/genka.rb +8 -5
  103. data/lib/zakuro/version/genka/monthly/lunar_phase.rb +82 -79
  104. data/lib/zakuro/version/genka/option/dropped_date/parameter.rb +13 -10
  105. data/lib/zakuro/version/genka/option/vanished_date/parameter.rb +13 -10
  106. data/lib/zakuro/version/genka/range/annual_range.rb +57 -54
  107. data/lib/zakuro/version/genka/stella/origin/first_term.rb +44 -41
  108. data/lib/zakuro/version/genka/stella/origin/january.rb +38 -35
  109. data/lib/zakuro/version/genka/stella/solar/average.rb +24 -21
  110. data/lib/zakuro/version/gihou/const/number.rb +40 -37
  111. data/lib/zakuro/version/gihou/const/remainder.rb +32 -29
  112. data/lib/zakuro/version/gihou/cycle/remainder.rb +38 -35
  113. data/lib/zakuro/version/gihou/cycle/solar_term.rb +18 -15
  114. data/lib/zakuro/version/gihou/gihou.rb +8 -5
  115. data/lib/zakuro/version/gihou/monthly/lunar_phase.rb +68 -65
  116. data/lib/zakuro/version/gihou/option/dropped_date/parameter.rb +13 -10
  117. data/lib/zakuro/version/gihou/option/vanished_date/parameter.rb +13 -10
  118. data/lib/zakuro/version/gihou/range/annual_range.rb +27 -24
  119. data/lib/zakuro/version/gihou/stella/lunar/adjustment.rb +212 -209
  120. data/lib/zakuro/version/gihou/stella/lunar/localization.rb +32 -29
  121. data/lib/zakuro/version/gihou/stella/lunar/location.rb +53 -50
  122. data/lib/zakuro/version/gihou/stella/lunar/value.rb +65 -62
  123. data/lib/zakuro/version/gihou/stella/origin/average_november.rb +23 -20
  124. data/lib/zakuro/version/gihou/stella/origin/lunar_age.rb +42 -39
  125. data/lib/zakuro/version/gihou/stella/origin/winter_solstice.rb +44 -41
  126. data/lib/zakuro/version/gihou/stella/solar/adjustment.rb +74 -71
  127. data/lib/zakuro/version/gihou/stella/solar/average.rb +67 -64
  128. data/lib/zakuro/version/gihou/stella/solar/interval.rb +95 -92
  129. data/lib/zakuro/version/gihou/stella/solar/location.rb +41 -38
  130. data/lib/zakuro/version/gihou/stella/solar/value.rb +21 -18
  131. data/lib/zakuro/version/gregorio/gregorio.rb +8 -5
  132. data/lib/zakuro/version/houryaku/houryaku.rb +8 -5
  133. data/lib/zakuro/version/joukyou/joukyou.rb +8 -5
  134. data/lib/zakuro/version/kansei/kansei.rb +8 -5
  135. data/lib/zakuro/version/senmyou/const/number.rb +40 -37
  136. data/lib/zakuro/version/senmyou/const/remainder.rb +35 -32
  137. data/lib/zakuro/version/senmyou/cycle/remainder.rb +74 -71
  138. data/lib/zakuro/version/senmyou/cycle/solar_term.rb +18 -15
  139. data/lib/zakuro/version/senmyou/monthly/lunar_phase.rb +69 -66
  140. data/lib/zakuro/version/senmyou/option/dropped_date/parameter.rb +15 -12
  141. data/lib/zakuro/version/senmyou/option/vanished_date/parameter.rb +15 -12
  142. data/lib/zakuro/version/senmyou/range/annual_range.rb +27 -24
  143. data/lib/zakuro/version/senmyou/senmyou.rb +8 -5
  144. data/lib/zakuro/version/senmyou/stella/lunar/adjustment.rb +206 -203
  145. data/lib/zakuro/version/senmyou/stella/lunar/localization.rb +32 -29
  146. data/lib/zakuro/version/senmyou/stella/lunar/location.rb +60 -57
  147. data/lib/zakuro/version/senmyou/stella/lunar/value.rb +66 -63
  148. data/lib/zakuro/version/senmyou/stella/origin/average_november.rb +23 -20
  149. data/lib/zakuro/version/senmyou/stella/origin/lunar_age.rb +42 -39
  150. data/lib/zakuro/version/senmyou/stella/origin/winter_solstice.rb +44 -41
  151. data/lib/zakuro/version/senmyou/stella/solar/adjustment.rb +74 -71
  152. data/lib/zakuro/version/senmyou/stella/solar/average.rb +67 -64
  153. data/lib/zakuro/version/senmyou/stella/solar/interval.rb +93 -90
  154. data/lib/zakuro/version/senmyou/stella/solar/location.rb +41 -38
  155. data/lib/zakuro/version/senmyou/stella/solar/value.rb +23 -20
  156. data/lib/zakuro/version/tenpou/tenpou.rb +8 -5
  157. metadata +44 -20
  158. data/lib/zakuro/condition.rb +0 -306
  159. data/lib/zakuro/era/japan/gengou/resource/type.rb +0 -356
  160. data/lib/zakuro/tools/gengou_range_comparer.rb +0 -82
  161. /data/lib/zakuro/calculation/monthly/{operated_solar_term.rb → internal/operated_solar_term.rb} +0 -0
  162. /data/lib/zakuro/calculation/monthly/{const.rb → internal/part/const.rb} +0 -0
  163. /data/lib/zakuro/calculation/monthly/{month_label.rb → internal/part/month_label.rb} +0 -0
@@ -13,84 +13,87 @@ require_relative './location'
13
13
  # :nodoc:
14
14
  module Zakuro
15
15
  # :nodoc:
16
- module Senmyou
16
+ module Version
17
17
  # :nodoc:
18
- module Solar
19
- #
20
- # Average 平気(太陽軌道平均)
21
- #
22
- class Average < Calculation::Solar::AbstractAverage
18
+ module Senmyou
19
+ # :nodoc:
20
+ module Solar
23
21
  #
24
- # 初期化
22
+ # Average 平気(太陽軌道平均)
25
23
  #
26
- # @param [Integer] western_year 西暦年
27
- #
28
- def initialize(western_year:)
29
- solar_term = self.class.first_solar_term(western_year: western_year)
30
- super(solar_term: solar_term)
31
- end
32
-
33
- #
34
- # 冬至から数えた1年データの月ごとに二十四節気を割り当てる
35
- #
36
- # @param [Array<Month>] annual_range 1年データ
37
- #
38
- # @return [Array<Month>] 1年データ
39
- #
40
- def set(annual_range:)
41
- super(annual_range: annual_range)
42
- end
43
-
44
- class << self
24
+ class Average < Calculation::Solar::AbstractAverage
45
25
  #
46
- # 計算開始する二十四節気を求める
26
+ # 初期化
47
27
  #
48
28
  # @param [Integer] western_year 西暦年
49
29
  #
50
- # @return [SolarTerm] 二十四節気
51
- #
52
- def first_solar_term(western_year:)
53
- # 天正冬至
54
- winter_solstice = Origin::WinterSolstice.get(western_year: western_year)
55
-
56
- # 二十四節気(冬至)
57
- solar_term = Cycle::SolarTerm.new(index: 0, remainder: winter_solstice)
58
-
59
- first_solar_term_index = calc_first_solar_term_index(western_year: western_year)
60
-
61
- # 対象の二十四節気まで戻す
62
- solar_term.prev_by_index(first_solar_term_index)
63
-
64
- solar_term
30
+ def initialize(western_year:)
31
+ solar_term = self.class.first_solar_term(western_year: western_year)
32
+ super(solar_term: solar_term)
65
33
  end
66
34
 
67
- # :reek:TooManyStatements { max_statements: 6 }
68
-
69
- #
70
- # 計算開始する二十四節気番号を求める
71
35
  #
72
- # * 前提として入定気は冬至の手前にある
73
- # * 例えば、定気が大雪であれば入定気は大雪の範囲内にある
74
- # * 入定気は、定気の開始位置に重複しない限り、常に定気より後にある
75
- # * 基本的に定気の一つ前から起算すれば、当時から求めた11月(閏10/閏11月)に二十四節気を割り当てられる
36
+ # 冬至から数えた1年データの月ごとに二十四節気を割り当てる
76
37
  #
77
- # @param [Integer] western_year 西暦年
38
+ # @param [Array<Month>] annual_range 1年データ
78
39
  #
79
- # @return [Integer] 二十四節気番号
40
+ # @return [Array<Month>] 1年データ
80
41
  #
81
- def calc_first_solar_term_index(western_year:)
82
- # 天正閏余
83
- lunar_age = Origin::LunarAge.get(western_year: western_year)
84
-
85
- solar_location = Solar::Location.new(lunar_age: lunar_age)
86
- solar_location.run
87
-
88
- solar_term_index = solar_location.index
89
-
90
- # 入定気の一つ後の二十四節気まで戻す(ただし11月経朔が二十四節気上にある場合は戻さない)
91
- solar_term_index += 1 unless solar_location.remainder.day.zero?
42
+ def set(annual_range:)
43
+ super(annual_range: annual_range)
44
+ end
92
45
 
93
- solar_term_index
46
+ class << self
47
+ #
48
+ # 計算開始する二十四節気を求める
49
+ #
50
+ # @param [Integer] western_year 西暦年
51
+ #
52
+ # @return [SolarTerm] 二十四節気
53
+ #
54
+ def first_solar_term(western_year:)
55
+ # 天正冬至
56
+ winter_solstice = Origin::WinterSolstice.get(western_year: western_year)
57
+
58
+ # 二十四節気(冬至)
59
+ solar_term = Cycle::SolarTerm.new(index: 0, remainder: winter_solstice)
60
+
61
+ first_solar_term_index = calc_first_solar_term_index(western_year: western_year)
62
+
63
+ # 対象の二十四節気まで戻す
64
+ solar_term.prev_by_index(first_solar_term_index)
65
+
66
+ solar_term
67
+ end
68
+
69
+ # :reek:TooManyStatements { max_statements: 6 }
70
+
71
+ #
72
+ # 計算開始する二十四節気番号を求める
73
+ #
74
+ # * 前提として入定気は冬至の手前にある
75
+ # * 例えば、定気が大雪であれば入定気は大雪の範囲内にある
76
+ # * 入定気は、定気の開始位置に重複しない限り、常に定気より後にある
77
+ # * 基本的に定気の一つ前から起算すれば、当時から求めた11月(閏10/閏11月)に二十四節気を割り当てられる
78
+ #
79
+ # @param [Integer] western_year 西暦年
80
+ #
81
+ # @return [Integer] 二十四節気番号
82
+ #
83
+ def calc_first_solar_term_index(western_year:)
84
+ # 天正閏余
85
+ lunar_age = Origin::LunarAge.get(western_year: western_year)
86
+
87
+ solar_location = Solar::Location.new(lunar_age: lunar_age)
88
+ solar_location.run
89
+
90
+ solar_term_index = solar_location.index
91
+
92
+ # 入定気の一つ後の二十四節気まで戻す(ただし11月経朔が二十四節気上にある場合は戻さない)
93
+ solar_term_index += 1 unless solar_location.remainder.day.zero?
94
+
95
+ solar_term_index
96
+ end
94
97
  end
95
98
  end
96
99
  end
@@ -3,100 +3,103 @@
3
3
  # :nodoc:
4
4
  module Zakuro
5
5
  # :nodoc:
6
- module Senmyou
6
+ module Version
7
7
  # :nodoc:
8
- module Solar
9
- #
10
- # Interval 入気定日加減数(二十四節気の間隔)
11
- #
12
- module Interval
13
- # @return [Hash<Symbol, Cycle::Remainder>] 一覧
14
- MAP = {
15
- # 冬至(とうじ)・大雪(たいせつ)
16
- touji: Cycle::Remainder.new(day: 14, minute: 4235, second: 5),
17
- taisetsu: Cycle::Remainder.new(day: 14, minute: 4235, second: 5),
18
- # 小寒(しょうかん)・小雪(しょうせつ)
19
- shoukan: Cycle::Remainder.new(day: 14, minute: 5235, second: 5),
20
- shousetsu: Cycle::Remainder.new(day: 14, minute: 5235, second: 5),
21
- # 大寒(だいかん)・立冬(りっとう)
22
- daikan: Cycle::Remainder.new(day: 14, minute: 6235, second: 5),
23
- rittou: Cycle::Remainder.new(day: 14, minute: 6235, second: 5),
24
- # 立春(りっしゅん)・霜降(そうこう)
25
- risshun: Cycle::Remainder.new(day: 14, minute: 7235, second: 5),
26
- soukou: Cycle::Remainder.new(day: 14, minute: 7235, second: 5),
27
- # 雨水(うすい)・寒露(かんろ)
28
- usui: Cycle::Remainder.new(day: 15, minute: 35, second: 5),
29
- kanro: Cycle::Remainder.new(day: 15, minute: 35, second: 5),
30
- # 啓蟄(けいちつ)・秋分(しゅうぶん)
31
- keichitsu: Cycle::Remainder.new(day: 15, minute: 1235, second: 5),
32
- shuubun: Cycle::Remainder.new(day: 15, minute: 1235, second: 5),
33
- # 春分(しゅんぶん)・白露(はくろ)
34
- shunbun: Cycle::Remainder.new(day: 15, minute: 2435, second: 5),
35
- hakuro: Cycle::Remainder.new(day: 15, minute: 2435, second: 5),
36
- # 清明(せいめい)・処暑(しょしょ)
37
- seimei: Cycle::Remainder.new(day: 15, minute: 3635, second: 5),
38
- shosho: Cycle::Remainder.new(day: 15, minute: 3635, second: 5),
39
- # 穀雨(こくう)・立秋(りっしゅう)
40
- kokuu: Cycle::Remainder.new(day: 15, minute: 4835, second: 5),
41
- risshuu: Cycle::Remainder.new(day: 15, minute: 4835, second: 5),
42
- # 立夏(りっか)・大暑(たいしょ)
43
- rikka: Cycle::Remainder.new(day: 15, minute: 5835, second: 5),
44
- taisho: Cycle::Remainder.new(day: 15, minute: 5835, second: 5),
45
- # 小満(しょうまん)・小暑(しょうしょ)
46
- shouman: Cycle::Remainder.new(day: 15, minute: 6835, second: 5),
47
- shousho: Cycle::Remainder.new(day: 15, minute: 6835, second: 5),
48
- # 芒種(ぼうしゅ)・夏至(げし)
49
- boushu: Cycle::Remainder.new(day: 15, minute: 7835, second: 5),
50
- geshi: Cycle::Remainder.new(day: 15, minute: 7835, second: 5)
51
- }.freeze
8
+ module Senmyou
9
+ # :nodoc:
10
+ module Solar
11
+ #
12
+ # Interval 入気定日加減数(二十四節気の間隔)
13
+ #
14
+ module Interval
15
+ # @return [Hash<Symbol, Cycle::Remainder>] 一覧
16
+ MAP = {
17
+ # 冬至(とうじ)・大雪(たいせつ)
18
+ touji: Cycle::Remainder.new(day: 14, minute: 4235, second: 5),
19
+ taisetsu: Cycle::Remainder.new(day: 14, minute: 4235, second: 5),
20
+ # 小寒(しょうかん)・小雪(しょうせつ)
21
+ shoukan: Cycle::Remainder.new(day: 14, minute: 5235, second: 5),
22
+ shousetsu: Cycle::Remainder.new(day: 14, minute: 5235, second: 5),
23
+ # 大寒(だいかん)・立冬(りっとう)
24
+ daikan: Cycle::Remainder.new(day: 14, minute: 6235, second: 5),
25
+ rittou: Cycle::Remainder.new(day: 14, minute: 6235, second: 5),
26
+ # 立春(りっしゅん)・霜降(そうこう)
27
+ risshun: Cycle::Remainder.new(day: 14, minute: 7235, second: 5),
28
+ soukou: Cycle::Remainder.new(day: 14, minute: 7235, second: 5),
29
+ # 雨水(うすい)・寒露(かんろ)
30
+ usui: Cycle::Remainder.new(day: 15, minute: 35, second: 5),
31
+ kanro: Cycle::Remainder.new(day: 15, minute: 35, second: 5),
32
+ # 啓蟄(けいちつ)・秋分(しゅうぶん)
33
+ keichitsu: Cycle::Remainder.new(day: 15, minute: 1235, second: 5),
34
+ shuubun: Cycle::Remainder.new(day: 15, minute: 1235, second: 5),
35
+ # 春分(しゅんぶん)・白露(はくろ)
36
+ shunbun: Cycle::Remainder.new(day: 15, minute: 2435, second: 5),
37
+ hakuro: Cycle::Remainder.new(day: 15, minute: 2435, second: 5),
38
+ # 清明(せいめい)・処暑(しょしょ)
39
+ seimei: Cycle::Remainder.new(day: 15, minute: 3635, second: 5),
40
+ shosho: Cycle::Remainder.new(day: 15, minute: 3635, second: 5),
41
+ # 穀雨(こくう)・立秋(りっしゅう)
42
+ kokuu: Cycle::Remainder.new(day: 15, minute: 4835, second: 5),
43
+ risshuu: Cycle::Remainder.new(day: 15, minute: 4835, second: 5),
44
+ # 立夏(りっか)・大暑(たいしょ)
45
+ rikka: Cycle::Remainder.new(day: 15, minute: 5835, second: 5),
46
+ taisho: Cycle::Remainder.new(day: 15, minute: 5835, second: 5),
47
+ # 小満(しょうまん)・小暑(しょうしょ)
48
+ shouman: Cycle::Remainder.new(day: 15, minute: 6835, second: 5),
49
+ shousho: Cycle::Remainder.new(day: 15, minute: 6835, second: 5),
50
+ # 芒種(ぼうしゅ)・夏至(げし)
51
+ boushu: Cycle::Remainder.new(day: 15, minute: 7835, second: 5),
52
+ geshi: Cycle::Remainder.new(day: 15, minute: 7835, second: 5)
53
+ }.freeze
52
54
 
53
- # @return [Array<Remainder>] 索引
54
- LIST = [
55
- MAP[:touji], # 0
56
- MAP[:shoukan], # 1
57
- MAP[:daikan], # 2
58
- MAP[:risshun], # 3
59
- MAP[:usui], # 4
60
- MAP[:keichitsu], # 5
61
- MAP[:shunbun], # 6
62
- MAP[:seimei], # 7
63
- MAP[:kokuu], # 8
64
- MAP[:rikka], # 9
65
- MAP[:shouman], # 10
66
- MAP[:boushu], # 11
67
- MAP[:geshi], # 12
68
- MAP[:shousho], # 13
69
- MAP[:taisho], # 14
70
- MAP[:risshuu], # 15
71
- MAP[:shosho], # 16
72
- MAP[:hakuro], # 17
73
- MAP[:shuubun], # 18
74
- MAP[:kanro], # 19
75
- MAP[:soukou], # 20
76
- MAP[:rittou], # 21
77
- MAP[:shousetsu], # 22
78
- MAP[:taisetsu] # 23
79
- ].freeze
55
+ # @return [Array<Remainder>] 索引
56
+ LIST = [
57
+ MAP[:touji], # 0
58
+ MAP[:shoukan], # 1
59
+ MAP[:daikan], # 2
60
+ MAP[:risshun], # 3
61
+ MAP[:usui], # 4
62
+ MAP[:keichitsu], # 5
63
+ MAP[:shunbun], # 6
64
+ MAP[:seimei], # 7
65
+ MAP[:kokuu], # 8
66
+ MAP[:rikka], # 9
67
+ MAP[:shouman], # 10
68
+ MAP[:boushu], # 11
69
+ MAP[:geshi], # 12
70
+ MAP[:shousho], # 13
71
+ MAP[:taisho], # 14
72
+ MAP[:risshuu], # 15
73
+ MAP[:shosho], # 16
74
+ MAP[:hakuro], # 17
75
+ MAP[:shuubun], # 18
76
+ MAP[:kanro], # 19
77
+ MAP[:soukou], # 20
78
+ MAP[:rittou], # 21
79
+ MAP[:shousetsu], # 22
80
+ MAP[:taisetsu] # 23
81
+ ].freeze
80
82
 
81
- class << self
82
- #
83
- # 入気定日加減数を引き当てる
84
- #
85
- # @param [Integer] index 二十四節気番号
86
- #
87
- # @return [Cycle::Remainder] 入気定日加減数
88
- #
89
- def index_of(index)
90
- LIST[index]
91
- end
83
+ class << self
84
+ #
85
+ # 入気定日加減数を引き当てる
86
+ #
87
+ # @param [Integer] index 二十四節気番号
88
+ #
89
+ # @return [Cycle::Remainder] 入気定日加減数
90
+ #
91
+ def index_of(index)
92
+ LIST[index]
93
+ end
92
94
 
93
- #
94
- # 入気定日加減数の総数を返す
95
- #
96
- # @return [Integer] 入気定日加減数の総数
97
- #
98
- def size
99
- LIST.size
95
+ #
96
+ # 入気定日加減数の総数を返す
97
+ #
98
+ # @return [Integer] 入気定日加減数の総数
99
+ #
100
+ def size
101
+ LIST.size
102
+ end
100
103
  end
101
104
  end
102
105
  end
@@ -9,51 +9,54 @@ require_relative './interval'
9
9
  # :nodoc:
10
10
  module Zakuro
11
11
  # :nodoc:
12
- module Senmyou
12
+ module Version
13
13
  # :nodoc:
14
- module Solar
15
- #
16
- # Location 入定気
17
- #
18
- class Location < Calculation::Solar::AbstractLocation
19
- # @return [Cycle::Remainder] 弦
20
- QUARTER = Const::Remainder::Solar::QUARTER
21
-
22
- #
23
- # 初期化
14
+ module Senmyou
15
+ # :nodoc:
16
+ module Solar
24
17
  #
25
- # @param [Cycle::Remainder] lunar_age 天正閏余(大余小余)
18
+ # Location 入定気
26
19
  #
27
- def initialize(lunar_age:)
28
- super(lunar_age: lunar_age, quarter: QUARTER)
29
- end
20
+ class Location < Calculation::Solar::AbstractLocation
21
+ # @return [Cycle::Remainder]
22
+ QUARTER = Const::Remainder::Solar::QUARTER
30
23
 
31
- # :reek:UtilityFunction
24
+ #
25
+ # 初期化
26
+ #
27
+ # @param [Cycle::Remainder] lunar_age 天正閏余(大余小余)
28
+ #
29
+ def initialize(lunar_age:)
30
+ super(lunar_age: lunar_age, quarter: QUARTER)
31
+ end
32
32
 
33
- #
34
- # 二十四節気番号に対応する入気定日加減数を返す
35
- #
36
- # @note 継承のためクラスメソッドにしない
37
- #
38
- # @param [Integer] index 二十四節気番号
39
- #
40
- # @return [Cycle::Remainder] 入気定日加減数
41
- #
42
- def interval(index:)
43
- Interval.index_of(index)
44
- end
33
+ # :reek:UtilityFunction
45
34
 
46
- # :reek:UtilityFunction
35
+ #
36
+ # 二十四節気番号に対応する入気定日加減数を返す
37
+ #
38
+ # @note 継承のためクラスメソッドにしない
39
+ #
40
+ # @param [Integer] index 二十四節気番号
41
+ #
42
+ # @return [Cycle::Remainder] 入気定日加減数
43
+ #
44
+ def interval(index:)
45
+ Interval.index_of(index)
46
+ end
47
47
 
48
- #
49
- # 入気定日加減数の要素数を返す
50
- #
51
- # @note 継承のためクラスメソッドにしない
52
- #
53
- # @return [Integer] 入気定日加減数の要素数
54
- #
55
- def interval_size
56
- Interval.size
48
+ # :reek:UtilityFunction
49
+
50
+ #
51
+ # 入気定日加減数の要素数を返す
52
+ #
53
+ # @note 継承のためクラスメソッドにしない
54
+ #
55
+ # @return [Integer] 入気定日加減数の要素数
56
+ #
57
+ def interval_size
58
+ Interval.size
59
+ end
57
60
  end
58
61
  end
59
62
  end
@@ -9,30 +9,33 @@ require_relative './adjustment'
9
9
  # :nodoc:
10
10
  module Zakuro
11
11
  # :nodoc:
12
- module Senmyou
12
+ module Version
13
13
  # :nodoc:
14
- module Solar
15
- #
16
- # Value 太陽補正値
17
- #
18
- module Value
19
- # @return [Integer] 1日
20
- DAY = Const::Number::Cycle::DAY
14
+ module Senmyou
15
+ # :nodoc:
16
+ module Solar
17
+ #
18
+ # Value 太陽補正値
19
+ #
20
+ module Value
21
+ # @return [Integer] 1日
22
+ DAY = Const::Number::Cycle::DAY
21
23
 
22
- class << self
23
- #
24
- # 太陽の運行による補正値を算出する
25
- #
26
- # @param [SolarTerm] solar_location 入定気
27
- #
28
- # @return [Integer] 補正値
29
- #
30
- def get(solar_location:)
31
- remainder = solar_location.remainder
24
+ class << self
25
+ #
26
+ # 太陽の運行による補正値を算出する
27
+ #
28
+ # @param [SolarTerm] solar_location 入定気
29
+ #
30
+ # @return [Integer] 補正値
31
+ #
32
+ def get(solar_location:)
33
+ remainder = solar_location.remainder
32
34
 
33
- row = Adjustment.specify(index: solar_location.index)
35
+ row = Adjustment.specify(index: solar_location.index)
34
36
 
35
- Calculation::Solar::ChoukeiValue.get(remainder: remainder, row: row)
37
+ Calculation::Solar::ChoukeiValue.get(remainder: remainder, row: row)
38
+ end
36
39
  end
37
40
  end
38
41
  end
@@ -2,10 +2,13 @@
2
2
 
3
3
  # :nodoc:
4
4
  module Zakuro
5
- #
6
- # Tenpou 天保暦
7
- #
8
- module Tenpou
9
- # none
5
+ # :nodoc:
6
+ module Version
7
+ #
8
+ # Tenpou 天保暦
9
+ #
10
+ module Tenpou
11
+ # none
12
+ end
10
13
  end
11
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zakuro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pldb
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-01 00:00:00.000000000 Z
11
+ date: 2023-07-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: mainly lunar solar calendar
14
14
  email:
@@ -52,6 +52,7 @@ files:
52
52
  - doc/version/senmyou.md
53
53
  - images/12月以降の入定気.png
54
54
  - images/12月以降の月の進退.png
55
+ - images/logo-text.png
55
56
  - images/source/description.numbers
56
57
  - images/入定気の起算.png
57
58
  - images/各月の求め方.png
@@ -83,16 +84,18 @@ files:
83
84
  - lib/zakuro/calculation/era/version/internal/range.rb
84
85
  - lib/zakuro/calculation/era/version/version.rb
85
86
  - lib/zakuro/calculation/monthly/abstract_lunar_phase.rb
86
- - lib/zakuro/calculation/monthly/const.rb
87
- - lib/zakuro/calculation/monthly/first_day.rb
88
87
  - lib/zakuro/calculation/monthly/initialized_month.rb
89
- - lib/zakuro/calculation/monthly/meta.rb
90
- - lib/zakuro/calculation/monthly/meta/all_solar_term.rb
91
- - lib/zakuro/calculation/monthly/meta/meta_collector.rb
88
+ - lib/zakuro/calculation/monthly/internal/date_comparer.rb
89
+ - lib/zakuro/calculation/monthly/internal/meta/all_solar_term.rb
90
+ - lib/zakuro/calculation/monthly/internal/meta/meta_collector.rb
91
+ - lib/zakuro/calculation/monthly/internal/operated_solar_term.rb
92
+ - lib/zakuro/calculation/monthly/internal/part/const.rb
93
+ - lib/zakuro/calculation/monthly/internal/part/first_day.rb
94
+ - lib/zakuro/calculation/monthly/internal/part/meta.rb
95
+ - lib/zakuro/calculation/monthly/internal/part/month_label.rb
96
+ - lib/zakuro/calculation/monthly/internal/solar_term_selector.rb
92
97
  - lib/zakuro/calculation/monthly/month.rb
93
- - lib/zakuro/calculation/monthly/month_label.rb
94
98
  - lib/zakuro/calculation/monthly/operated_month.rb
95
- - lib/zakuro/calculation/monthly/operated_solar_term.rb
96
99
  - lib/zakuro/calculation/option/dropped_date/abstract_parameter.rb
97
100
  - lib/zakuro/calculation/option/dropped_date/location.rb
98
101
  - lib/zakuro/calculation/option/vanished_date/abstract_parameter.rb
@@ -116,6 +119,8 @@ files:
116
119
  - lib/zakuro/calculation/summary/internal/month.rb
117
120
  - lib/zakuro/calculation/summary/internal/operation.rb
118
121
  - lib/zakuro/calculation/summary/internal/option.rb
122
+ - lib/zakuro/calculation/summary/internal/option/dropped_date.rb
123
+ - lib/zakuro/calculation/summary/internal/option/vanished_date.rb
119
124
  - lib/zakuro/calculation/summary/japan/range.rb
120
125
  - lib/zakuro/calculation/summary/japan/single.rb
121
126
  - lib/zakuro/calculation/summary/japan/specifier/single_day.rb
@@ -126,7 +131,6 @@ files:
126
131
  - lib/zakuro/calculation/summary/western/specifier/single_day.rb
127
132
  - lib/zakuro/calculation/type/old_float.rb
128
133
  - lib/zakuro/calculation/type/optional.rb
129
- - lib/zakuro/condition.rb
130
134
  - lib/zakuro/context/context.rb
131
135
  - lib/zakuro/context/option.rb
132
136
  - lib/zakuro/context/version_class_resolver.rb
@@ -139,12 +143,28 @@ files:
139
143
  - lib/zakuro/era/japan/gengou/alignment/linear_gengou.rb
140
144
  - lib/zakuro/era/japan/gengou/resource.rb
141
145
  - lib/zakuro/era/japan/gengou/resource/parser.rb
142
- - lib/zakuro/era/japan/gengou/resource/type.rb
143
146
  - lib/zakuro/era/japan/gengou/resource/validator.rb
144
147
  - lib/zakuro/era/japan/gengou/resource/yaml/set-001-until-south.yaml
145
148
  - lib/zakuro/era/japan/gengou/resource/yaml/set-002-from-north.yaml
146
149
  - lib/zakuro/era/japan/gengou/resource/yaml/set-003-modern.yaml
150
+ - lib/zakuro/era/japan/type/base/both/date.rb
151
+ - lib/zakuro/era/japan/type/base/both/year.rb
152
+ - lib/zakuro/era/japan/type/base/gengou.rb
153
+ - lib/zakuro/era/japan/type/base/gengou_set.rb
154
+ - lib/zakuro/era/japan/type/base/switch_date.rb
155
+ - lib/zakuro/era/japan/type/base/version_range.rb
156
+ - lib/zakuro/era/japan/type/validation/both/date.rb
157
+ - lib/zakuro/era/japan/type/validation/both/year.rb
158
+ - lib/zakuro/era/japan/type/validation/gengou.rb
159
+ - lib/zakuro/era/japan/type/validation/gengou_set.rb
160
+ - lib/zakuro/era/japan/type/validation/switch_date.rb
161
+ - lib/zakuro/era/japan/type/validation/version_range.rb
162
+ - lib/zakuro/era/japan/type/validation/version_root.rb
147
163
  - lib/zakuro/era/japan/version.rb
164
+ - lib/zakuro/era/japan/version/resource.rb
165
+ - lib/zakuro/era/japan/version/resource/parser.rb
166
+ - lib/zakuro/era/japan/version/resource/validator.rb
167
+ - lib/zakuro/era/japan/version/resource/yaml/version.yaml
148
168
  - lib/zakuro/era/western/calendar.rb
149
169
  - lib/zakuro/era/western/date_text.rb
150
170
  - lib/zakuro/exception/case/pattern.rb
@@ -166,6 +186,11 @@ files:
166
186
  - lib/zakuro/output/error.rb
167
187
  - lib/zakuro/output/logger.rb
168
188
  - lib/zakuro/output/response.rb
189
+ - lib/zakuro/parameter/catalog/basis_date.rb
190
+ - lib/zakuro/parameter/catalog/column.rb
191
+ - lib/zakuro/parameter/catalog/option.rb
192
+ - lib/zakuro/parameter/catalog/range.rb
193
+ - lib/zakuro/parameter/condition.rb
169
194
  - lib/zakuro/result/core.rb
170
195
  - lib/zakuro/result/data/day.rb
171
196
  - lib/zakuro/result/data/gengou.rb
@@ -184,11 +209,10 @@ files:
184
209
  - lib/zakuro/result/operation/month/annotation.rb
185
210
  - lib/zakuro/result/operation/month/history.rb
186
211
  - lib/zakuro/result/result.rb
187
- - lib/zakuro/tools/gengou_range_comparer.rb
188
- - lib/zakuro/tools/remainder_comparer.rb
189
- - lib/zakuro/tools/stringifier.rb
190
- - lib/zakuro/tools/typeconv.rb
191
- - lib/zakuro/tools/typeof.rb
212
+ - lib/zakuro/tool/remainder_comparer.rb
213
+ - lib/zakuro/tool/stringifier.rb
214
+ - lib/zakuro/tool/typeconv.rb
215
+ - lib/zakuro/tool/typeof.rb
192
216
  - lib/zakuro/version/daien/const/number.rb
193
217
  - lib/zakuro/version/daien/const/remainder.rb
194
218
  - lib/zakuro/version/daien/cycle/remainder.rb
@@ -278,7 +302,7 @@ metadata:
278
302
  homepage_uri: https://github.com/pldb/zakuro
279
303
  source_code_uri: https://github.com/pldb/zakuro
280
304
  changelog_uri: https://github.com/pldb/zakuro
281
- post_install_message:
305
+ post_install_message:
282
306
  rdoc_options: []
283
307
  require_paths:
284
308
  - lib
@@ -293,8 +317,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
293
317
  - !ruby/object:Gem::Version
294
318
  version: '0'
295
319
  requirements: []
296
- rubygems_version: 3.1.4
297
- signing_key:
320
+ rubygems_version: 3.1.2
321
+ signing_key:
298
322
  specification_version: 4
299
323
  summary: japanese calendar library.
300
324
  test_files: []