Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to define if periods are wanted #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/health_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/health_check/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down