aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/cmds/brew-pull.rb3
-rwxr-xr-xLibrary/Contributions/cmds/brew-test-bot.rb26
-rw-r--r--Library/Homebrew/global.rb1
3 files changed, 15 insertions, 15 deletions
diff --git a/Library/Contributions/cmds/brew-pull.rb b/Library/Contributions/cmds/brew-pull.rb
index e66fdf41f..8f359dab3 100755
--- a/Library/Contributions/cmds/brew-pull.rb
+++ b/Library/Contributions/cmds/brew-pull.rb
@@ -20,8 +20,7 @@ ARGV.named.each do|arg|
if arg.to_i > 0
url = 'https://github.com/mxcl/homebrew/pull/' + arg
else
- # This regex should work, if it's too precise, feel free to fix it.
- url_match = arg.match 'https:\/\/github.com\/\w+\/homebrew(-\w+)?\/(pull\/(\d+)|commit\/\w{4,40})'
+ url_match = arg.match HOMEBREW_PULL_URL_REGEX
unless url_match
ohai 'Ignoring URL:', "Not a GitHub pull request or commit: #{arg}"
next
diff --git a/Library/Contributions/cmds/brew-test-bot.rb b/Library/Contributions/cmds/brew-test-bot.rb
index 95286a72b..046c1ede4 100755
--- a/Library/Contributions/cmds/brew-test-bot.rb
+++ b/Library/Contributions/cmds/brew-test-bot.rb
@@ -107,22 +107,22 @@ class Test
return @@commit_html, @@css
end
- def initialize arg
+ def initialize argument
@start_sha1 = nil
@url = nil
@formulae = []
- url_match = arg.match 'https:\/\/github.com\/\w+\/homebrew(-\w+)?\/(pull\/(\d+)|commit\/\w{4,40})'
- formula = Formula.factory arg rescue FormulaUnavailableError
- git("rev-parse --verify #{arg} &>/dev/null")
+ url_match = argument.match HOMEBREW_PULL_URL_REGEX
+ formula = Formula.factory argument rescue FormulaUnavailableError
+ git("rev-parse --verify #{argument} &>/dev/null")
if $?.success?
- @start_sha1 = arg
+ @start_sha1 = argument
elsif url_match
@url = url_match[0]
elsif formula
- @formulae = [arg]
+ @formulae = [argument]
else
- odie "#{arg} is not a pull request URL, commit URL or formula name."
+ odie "#{argument} is not a pull request URL, commit URL or formula name."
end
@category = __method__
@@ -253,7 +253,7 @@ class Test
test "git gc"
elsif not ARGV.include? "--skip-cleanup"
git('diff --exit-code HEAD 2>/dev/null')
- odie "Uncommitted changes, aborting." unless $?.success?
+ odie "uncommitted changes, aborting." unless $?.success?
test "git reset --hard #{@start_sha1}" if @start_sha1
end
end
@@ -290,13 +290,13 @@ class Test
end
end
- def self.run arg
- test = new arg
+ def self.run argument
+ test = new argument
test.cleanup unless ARGV.include? "--skip-cleanup"
test.download
test.setup unless ARGV.include? "--skip-setup"
- test.formulae.each do |f|
- test.formula f
+ test.formulae.each do |formula|
+ test.formula formula
end
test.homebrew if test.core_changed
test.cleanup unless ARGV.include? "--skip-cleanup"
@@ -309,5 +309,5 @@ if ARGV.named.empty?
# With no arguments just build the most recent commit.
Test.run 'HEAD'
else
- ARGV.named.each { |arg| Test.run arg }
+ ARGV.named.each { |argument| Test.run argument }
end
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index 0d5a5c6a7..2bc26cf68 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -86,6 +86,7 @@ end
require 'metafiles'
FORMULA_META_FILES = Metafiles.new
ISSUES_URL = "https://github.com/mxcl/homebrew/wiki/troubleshooting"
+HOMEBREW_PULL_URL_REGEX = 'https:\/\/github.com\/\w+\/homebrew(-\w+)?\/(pull\/(\d+)|commit\/\w{4,40})'
unless ARGV.include? "--no-compat" or ENV['HOMEBREW_NO_COMPAT']
$:.unshift(File.expand_path("#{__FILE__}/../compat"))