From 706d49b2590cfd70306f14cffdbadd237620a993 Mon Sep 17 00:00:00 2001 From: Gabriel Mazetto Date: Mon, 4 Sep 2017 03:58:54 +0200 Subject: Added dynamic skip reason to SystemCheck --- lib/system_check/base_check.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lib/system_check/base_check.rb') diff --git a/lib/system_check/base_check.rb b/lib/system_check/base_check.rb index 7f9e2ffffc2..0f5742dd67f 100644 --- a/lib/system_check/base_check.rb +++ b/lib/system_check/base_check.rb @@ -62,6 +62,25 @@ module SystemCheck call_or_return(@skip_reason) || 'skipped' end + # Define a reason why we skipped the SystemCheck (during runtime) + # + # This is used when you need dynamic evaluation like when you have + # multiple reasons why a check can fail + # + # @param [String] reason to be displayed + def skip_reason=(reason) + @skip_reason = reason + end + + # Skip reason defined during runtime + # + # This value have precedence over the one defined in the subclass + # + # @return [String] the reason + def skip_reason + @skip_reason + end + # Does the check support automatically repair routine? # # @return [Boolean] whether check implemented `#repair!` method or not -- cgit v1.2.1