aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaun Jackman2017-10-17 17:08:11 -0700
committerShaun Jackman2017-10-17 17:11:26 -0700
commit3ee3b78fbda48821e878feeafc313a9391c5729c (patch)
treeedd02a0db9b1e38c889d106dbc16e3b08f45c58d
parenta7b4a4572b2efc0b4ddc52d8e10b4b7f6593fb2b (diff)
downloadbrew-3ee3b78fbda48821e878feeafc313a9391c5729c.tar.bz2
pull: Move test_bot_user to a new module GitHub
Address the style issue: C: Module has too many lines. [364/360]
-rw-r--r--Library/Homebrew/dev-cmd/pull.rb21
1 files changed, 13 insertions, 8 deletions
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb
index 0e3b37e3f..79b9da9eb 100644
--- a/Library/Homebrew/dev-cmd/pull.rb
+++ b/Library/Homebrew/dev-cmd/pull.rb
@@ -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