diff --git a/lib/health_check.rb b/lib/health_check.rb index 669a74e..01ed440 100644 --- a/lib/health_check.rb +++ b/lib/health_check.rb @@ -95,6 +95,10 @@ class Engine < ::Rails::Engine mattr_accessor :success_callbacks mattr_accessor :failure_callbacks + # define if you want the error messages to end with a period + mattr_accessor :do_not_add_period + self.do_not_add_period = false + def self.add_custom_check(name = 'custom', &block) custom_checks[name] ||= [ ] custom_checks[name] << block diff --git a/lib/health_check/utils.rb b/lib/health_check/utils.rb index 64a8d89..1d14661 100644 --- a/lib/health_check/utils.rb +++ b/lib/health_check/utils.rb @@ -90,7 +90,7 @@ def self.process_checks(checks, called_from_middleware = false) return "invalid argument to health_test." end end - errors << '. ' unless errors == '' || errors.end_with?('. ') + errors << '. ' unless errors == '' || errors.end_with?('. ') || HealthCheck.do_not_add_period end return errors.strip rescue => e