gitlab-org--gitlab-foss/lib/system_check/rake_task/rake_task_helpers.rb
Michael Kozono 6855e6b586 Extract system check rake task logic
These changes make the code more reusable, testable, and most
importantly, overrideable.
2018-12-03 13:51:46 -08:00

32 lines
609 B
Ruby

# frozen_string_literal: true
module SystemCheck
module RakeTask
# Provides the run! method intended to be called from system check rake tasks
module RakeTaskHelpers
include ::SystemCheck::Helpers
def run!
warn_user_is_not_gitlab
if self.respond_to?(:manual_run_checks!)
manual_run_checks!
else
run_checks!
end
end
def run_checks!
SystemCheck.run(name, checks)
end
def name
raise NotImplementedError
end
def checks
raise NotImplementedError
end
end
end
end