aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/dev-cmd')
-rw-r--r--Library/Homebrew/dev-cmd/aspell-dictionaries.rb2
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb2
-rw-r--r--Library/Homebrew/dev-cmd/boneyard-formula-pr.rb2
-rw-r--r--Library/Homebrew/dev-cmd/bottle.rb2
-rw-r--r--Library/Homebrew/dev-cmd/bump-formula-pr.rb2
-rw-r--r--Library/Homebrew/dev-cmd/create.rb2
-rw-r--r--Library/Homebrew/dev-cmd/edit.rb2
-rw-r--r--Library/Homebrew/dev-cmd/linkage.rb2
-rw-r--r--Library/Homebrew/dev-cmd/man.rb10
-rw-r--r--Library/Homebrew/dev-cmd/mirror.rb2
-rw-r--r--Library/Homebrew/dev-cmd/pull.rb12
-rw-r--r--Library/Homebrew/dev-cmd/tap-readme.rb2
-rw-r--r--Library/Homebrew/dev-cmd/test.rb2
-rw-r--r--Library/Homebrew/dev-cmd/tests.rb2
-rw-r--r--Library/Homebrew/dev-cmd/update-test.rb2
15 files changed, 44 insertions, 4 deletions
diff --git a/Library/Homebrew/dev-cmd/aspell-dictionaries.rb b/Library/Homebrew/dev-cmd/aspell-dictionaries.rb
index cbb88ffe5..86ad037ce 100644
--- a/Library/Homebrew/dev-cmd/aspell-dictionaries.rb
+++ b/Library/Homebrew/dev-cmd/aspell-dictionaries.rb
@@ -7,6 +7,8 @@ require "resource"
require "formula"
module Homebrew
+ module_function
+
def aspell_dictionaries
dict_url = "http://ftpmirror.gnu.org/aspell/dict"
dict_mirror = "https://ftp.gnu.org/gnu/aspell/dict"
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 9d7a3ba92..4a86f4c04 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -37,6 +37,8 @@ require "cmd/style"
require "date"
module Homebrew
+ module_function
+
def audit
Homebrew.inject_dump_stats!(FormulaAuditor, /^audit_/) if ARGV.switch? "D"
diff --git a/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb b/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb
index 890c9c4a0..a0739dbe9 100644
--- a/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/boneyard-formula-pr.rb
@@ -19,6 +19,8 @@ rescue LoadError
end
module Homebrew
+ module_function
+
def boneyard_formula_pr
local_only = ARGV.include?("--local")
formula = ARGV.formulae.first
diff --git a/Library/Homebrew/dev-cmd/bottle.rb b/Library/Homebrew/dev-cmd/bottle.rb
index 83e40f25d..a087a5e4c 100644
--- a/Library/Homebrew/dev-cmd/bottle.rb
+++ b/Library/Homebrew/dev-cmd/bottle.rb
@@ -41,6 +41,8 @@ EOS
MAXIMUM_STRING_MATCHES = 100
module Homebrew
+ module_function
+
def keg_contain?(string, keg, ignores)
@put_string_exists_header, @put_filenames = nil
diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
index 31e9cd2c1..32e4b52a2 100644
--- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb
+++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb
@@ -35,6 +35,8 @@
require "formula"
module Homebrew
+ module_function
+
def inreplace_pairs(path, replacement_pairs)
if ARGV.dry_run?
contents = path.open("r") { |f| Formulary.ensure_utf8_encoding(f).read }
diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb
index 19fd251b7..11544dbef 100644
--- a/Library/Homebrew/dev-cmd/create.rb
+++ b/Library/Homebrew/dev-cmd/create.rb
@@ -24,6 +24,8 @@ require "digest"
require "erb"
module Homebrew
+ module_function
+
# Create a formula from a tarball URL
def create
# Allow searching MacPorts or Fink.
diff --git a/Library/Homebrew/dev-cmd/edit.rb b/Library/Homebrew/dev-cmd/edit.rb
index 2d2a5ec08..df5bc0605 100644
--- a/Library/Homebrew/dev-cmd/edit.rb
+++ b/Library/Homebrew/dev-cmd/edit.rb
@@ -7,6 +7,8 @@
require "formula"
module Homebrew
+ module_function
+
def edit
unless (HOMEBREW_REPOSITORY/".git").directory?
raise <<-EOS.undent
diff --git a/Library/Homebrew/dev-cmd/linkage.rb b/Library/Homebrew/dev-cmd/linkage.rb
index 993420c02..44e0f224e 100644
--- a/Library/Homebrew/dev-cmd/linkage.rb
+++ b/Library/Homebrew/dev-cmd/linkage.rb
@@ -13,6 +13,8 @@
require "os/mac/linkage_checker"
module Homebrew
+ module_function
+
def linkage
ARGV.kegs.each do |keg|
ohai "Checking #{keg.name} linkage" if ARGV.kegs.size > 1
diff --git a/Library/Homebrew/dev-cmd/man.rb b/Library/Homebrew/dev-cmd/man.rb
index d34d559f7..8e645d401 100644
--- a/Library/Homebrew/dev-cmd/man.rb
+++ b/Library/Homebrew/dev-cmd/man.rb
@@ -12,6 +12,8 @@ require "erb"
require "ostruct"
module Homebrew
+ module_function
+
SOURCE_PATH = HOMEBREW_LIBRARY_PATH/"manpages"
TARGET_MAN_PATH = HOMEBREW_REPOSITORY/"manpages"
TARGET_DOC_PATH = HOMEBREW_REPOSITORY/"docs"
@@ -32,8 +34,6 @@ module Homebrew
end
end
- private
-
def regenerate_man_pages
Homebrew.install_gem_setup_path! "ronn"
@@ -44,6 +44,7 @@ module Homebrew
cask_markup = (HOMEBREW_LIBRARY/"Homebrew/manpages/brew-cask.1.md").read
convert_man_page(cask_markup, TARGET_MAN_PATH/"brew-cask.1")
end
+ private_class_method :regenerate_man_pages
def path_glob_commands(glob)
Pathname.glob(glob)
@@ -56,6 +57,7 @@ module Homebrew
end
.reject { |s| s.strip.empty? || s.include?("@hide_from_man_page") }
end
+ private_class_method :path_glob_commands
def build_man_page
template = (SOURCE_PATH/"brew.1.md.erb").read
@@ -73,11 +75,13 @@ module Homebrew
ERB.new(template, nil, ">").result(variables.instance_eval { binding })
end
+ private_class_method :build_man_page
def sort_key_for_path(path)
# Options after regular commands (`~` comes after `z` in ASCII table).
path.basename.to_s.sub(/\.(rb|sh)$/, "").sub(/^--/, "~~")
end
+ private_class_method :sort_key_for_path
def convert_man_page(markup, target)
manual = target.basename(".1")
@@ -110,6 +114,7 @@ module Homebrew
target.atomic_write ronn.read
end
end
+ private_class_method :convert_man_page
def target_path_to_format(target)
case target.basename
@@ -119,4 +124,5 @@ module Homebrew
odie "Failed to infer output format from '#{target.basename}'."
end
end
+ private_class_method :target_path_to_format
end
diff --git a/Library/Homebrew/dev-cmd/mirror.rb b/Library/Homebrew/dev-cmd/mirror.rb
index 9966163f8..bd5868726 100644
--- a/Library/Homebrew/dev-cmd/mirror.rb
+++ b/Library/Homebrew/dev-cmd/mirror.rb
@@ -3,6 +3,8 @@
#: Reuploads the stable URL for a formula to Bintray to use it as a mirror.
module Homebrew
+ module_function
+
def mirror
odie "This command requires at least formula argument!" if ARGV.named.empty?
diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb
index 857c55993..d64ebd4d1 100644
--- a/Library/Homebrew/dev-cmd/pull.rb
+++ b/Library/Homebrew/dev-cmd/pull.rb
@@ -40,6 +40,8 @@ require "version"
require "pkg_version"
module Homebrew
+ module_function
+
def pull
odie "You meant `git pull --rebase`." if ARGV[0] == "--rebase"
@@ -235,8 +237,6 @@ module Homebrew
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
end
- private
-
def publish_changed_formula_bottles(_tap, changed_formulae_names)
if ENV["HOMEBREW_DISABLE_LOAD_FORMULA"]
raise "Need to load formulae to publish them!"
@@ -257,10 +257,12 @@ module Homebrew
end
published
end
+ private_class_method :publish_changed_formula_bottles
def pull_patch(url, description = nil)
PatchPuller.new(url, description).pull_patch
end
+ private_class_method :pull_patch
class PatchPuller
attr_reader :base_url
@@ -340,6 +342,7 @@ module Homebrew
end
{ files: files, formulae: formulae, others: others }
end
+ private_class_method :files_changed_in_patch
# Get current formula versions without loading formula definition in this process
# Returns info as a hash (type => version), for pull.rb's internal use
@@ -356,6 +359,7 @@ module Homebrew
end
versions
end
+ private_class_method :current_versions_from_info_external
def subject_for_bump(formula, old, new)
if old[:nonexistent]
@@ -395,10 +399,12 @@ module Homebrew
end
subject
end
+ private_class_method :subject_for_bump
def pbcopy(text)
Utils.popen_write("pbcopy") { |io| io.write text }
end
+ private_class_method :pbcopy
# Publishes the current bottle files for a given formula to Bintray
def publish_bottle_file_on_bintray(f, creds)
@@ -415,6 +421,7 @@ module Homebrew
"-d", '{"publish_wait_for_secs": 0}',
"https://api.bintray.com/content/homebrew/#{repo}/#{package}/#{version}/publish"
end
+ private_class_method :publish_bottle_file_on_bintray
# Formula info drawn from an external "brew info --json" call
class FormulaInfoFromJson
@@ -575,4 +582,5 @@ module Homebrew
end
end
end
+ private_class_method :verify_bintray_published
end
diff --git a/Library/Homebrew/dev-cmd/tap-readme.rb b/Library/Homebrew/dev-cmd/tap-readme.rb
index e1a3e0eb4..cf5af85eb 100644
--- a/Library/Homebrew/dev-cmd/tap-readme.rb
+++ b/Library/Homebrew/dev-cmd/tap-readme.rb
@@ -2,6 +2,8 @@
#: Generate the README.md file for a new tap.
module Homebrew
+ module_function
+
def tap_readme
name = ARGV.first
raise "A name is required" if name.nil?
diff --git a/Library/Homebrew/dev-cmd/test.rb b/Library/Homebrew/dev-cmd/test.rb
index c20edf804..4898629b0 100644
--- a/Library/Homebrew/dev-cmd/test.rb
+++ b/Library/Homebrew/dev-cmd/test.rb
@@ -21,6 +21,8 @@ require "sandbox"
require "timeout"
module Homebrew
+ module_function
+
def test
raise FormulaUnspecifiedError if ARGV.named.empty?
diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb
index 9b15f9f3e..1b6af2850 100644
--- a/Library/Homebrew/dev-cmd/tests.rb
+++ b/Library/Homebrew/dev-cmd/tests.rb
@@ -5,6 +5,8 @@ require "fileutils"
require "tap"
module Homebrew
+ module_function
+
def tests
(HOMEBREW_LIBRARY/"Homebrew").cd do
ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1"
diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb
index 8d0391f66..7f20104d8 100644
--- a/Library/Homebrew/dev-cmd/update-test.rb
+++ b/Library/Homebrew/dev-cmd/update-test.rb
@@ -15,6 +15,8 @@
#: the new repository clone.
module Homebrew
+ module_function
+
def update_test
ENV["HOMEBREW_UPDATE_TO_TAG"] = "1" if ARGV.include?("--to-tag")