Skip to content
Snippets Groups Projects
Commit 3ee3b78f authored by Shaun Jackman's avatar Shaun Jackman
Browse files

pull: Move test_bot_user to a new module GitHub

Address the style issue:
C: Module has too many lines. [364/360]
parent a7b4a457
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,18 @@ require "tap"
require "version"
require "pkg_version"
module GitHub
module_function
# Return the corresponding test-bot user name for the given GitHub organization.
def test_bot_user(user)
test_bot = ARGV.value "test-bot-user"
return test_bot if test_bot
return "BrewTestBot" if user.casecmp("homebrew").zero?
"#{user.capitalize}TestBot"
end
end
module Homebrew
module_function
......@@ -231,7 +243,7 @@ module Homebrew
url
else
bottle_branch = "pull-bottle-#{issue}"
"https://github.com/#{test_bot_user user}/homebrew-#{tap.repo}/compare/#{user}:master...pr-#{issue}"
"https://github.com/#{GitHub.test_bot_user user}/homebrew-#{tap.repo}/compare/#{user}:master...pr-#{issue}"
end
curl "--silent", "--fail", "--output", "/dev/null", "--head", bottle_commit_url
......@@ -259,13 +271,6 @@ module Homebrew
verify_bintray_published(bintray_published_formulae)
end
def test_bot_user(user)
test_bot = ARGV.value "test-bot-user"
return test_bot if test_bot
return "BrewTestBot" if user.casecmp("homebrew").zero?
"#{user.capitalize}TestBot"
end
def force_utf8!(str)
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment