Class: VivlioStarter::CLI::Guards::RelaxedCheck
- Defined in:
- lib/vivlio_starter/cli/guards/relaxed_check.rb
Overview
任意の Check の :error 違反を :warn に格下げするデコレータ。 コマンド × Check 対応表の「○=推奨」(違反しても停止はせず警告のみ)を表現する。
Instance Method Summary collapse
-
#initialize(check) ⇒ RelaxedCheck
constructor
A new instance of RelaxedCheck.
- #validate ⇒ Object
Constructor Details
#initialize(check) ⇒ RelaxedCheck
Returns a new instance of RelaxedCheck.
10 11 12 13 |
# File 'lib/vivlio_starter/cli/guards/relaxed_check.rb', line 10 def initialize(check) @check = check super() end |
Instance Method Details
#validate ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/vivlio_starter/cli/guards/relaxed_check.rb', line 15 def validate @check.validate.map do |violation| next violation unless violation.error? violation.with(severity: :warn) end end |