Module: VivlioStarter::CLI::PreProcessCommands::IssueRegistry
- Defined in:
- lib/vivlio_starter/cli/pre_process/issue_registry.rb
Defined Under Namespace
Class Method Summary collapse
-
.counts ⇒ Counts
全体の件数を返す.
-
.issues ⇒ Object
蓄積された全指摘のコピーを返す(呼び出し側での絞り込み用).
-
.record(severity:, category:, message:, chapter: nil, line: nil) ⇒ Issue
指摘を 1 件記録する。.
-
.reset! ⇒ Object
蓄積をリセットする(preflight / build 開始時に呼ぶ).
-
.summary_by_chapter ⇒ Hash{String, nil => Counts}
章ごとの件数を返す。キーは章 basename、章に紐付かない指摘は nil キーにまとまる。.
Class Method Details
.counts ⇒ Counts
全体の件数を返す
65 |
# File 'lib/vivlio_starter/cli/pre_process/issue_registry.rb', line 65 def counts = tally(issues) |
.issues ⇒ Object
蓄積された全指摘のコピーを返す(呼び出し側での絞り込み用)
61 |
# File 'lib/vivlio_starter/cli/pre_process/issue_registry.rb', line 61 def issues = @monitor.synchronize { @issues.dup } |
.record(severity:, category:, message:, chapter: nil, line: nil) ⇒ Issue
指摘を 1 件記録する。
54 55 56 57 58 |
# File 'lib/vivlio_starter/cli/pre_process/issue_registry.rb', line 54 def record(severity:, category:, message:, chapter: nil, line: nil) issue = Issue.new(chapter: normalize_chapter(chapter), line:, severity:, category:, message:) @monitor.synchronize { @issues << issue } issue end |
.reset! ⇒ Object
蓄積をリセットする(preflight / build 開始時に呼ぶ)
43 44 45 |
# File 'lib/vivlio_starter/cli/pre_process/issue_registry.rb', line 43 def reset! @monitor.synchronize { @issues = [] } end |
.summary_by_chapter ⇒ Hash{String, nil => Counts}
章ごとの件数を返す。キーは章 basename、章に紐付かない指摘は nil キーにまとまる。
69 70 71 |
# File 'lib/vivlio_starter/cli/pre_process/issue_registry.rb', line 69 def summary_by_chapter issues.group_by(&:chapter).transform_values { tally(it) } end |