module CheckerJobs::Notifiers::FormatterHelpers
Needs a @check instance variable and provides the methods:
-
format_entry
(a generic one)
Constants
- GITHUB_URL_FORMAT
Public Instance Methods
format_entry(entry)
click to toggle source
# File lib/checker_jobs/notifiers/formatter_helpers.rb, line 8 def format_entry(entry) entry.respond_to?(:id) ? entry.id : entry.to_s end
human_check_name()
click to toggle source
# File lib/checker_jobs/notifiers/formatter_helpers.rb, line 12 def human_check_name @check.name.tr("_", " ").capitalize end
repository_url()
click to toggle source
# File lib/checker_jobs/notifiers/formatter_helpers.rb, line 16 def repository_url if repository_configuration.is_a?(String) repository_configuration elsif repository_configuration.key?(:github) github_url end end
Private Instance Methods
github_url()
click to toggle source
# File lib/checker_jobs/notifiers/formatter_helpers.rb, line 26 def github_url filepath, line_number = @check.block.source_location filepath = filepath.sub(Dir.pwd + "/", "") GITHUB_URL_FORMAT % { repository: repository_configuration[:github], path: filepath, line: line_number, } end
repository_configuration()
click to toggle source
# File lib/checker_jobs/notifiers/formatter_helpers.rb, line 36 def repository_configuration CheckerJobs.configuration.repository_url end