From 0ab750bf24dac2cb411d76c05a0edb9b1f1b9333 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 26 Sep 2016 01:44:51 +0200 Subject: Use `module_function` for commands. --- Library/Homebrew/dev-cmd/pull.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Library/Homebrew/dev-cmd/pull.rb') 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 -- cgit v1.2.3 From c36f42ce953b4610b2ba62a2b860720ae6d59e01 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 1 Oct 2016 20:33:08 +0200 Subject: Remove `private_class_method` from commands. --- Library/Homebrew/dev-cmd/pull.rb | 8 -------- 1 file changed, 8 deletions(-) (limited to 'Library/Homebrew/dev-cmd/pull.rb') diff --git a/Library/Homebrew/dev-cmd/pull.rb b/Library/Homebrew/dev-cmd/pull.rb index d64ebd4d1..7e6e86a85 100644 --- a/Library/Homebrew/dev-cmd/pull.rb +++ b/Library/Homebrew/dev-cmd/pull.rb @@ -257,12 +257,10 @@ 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 @@ -342,7 +340,6 @@ 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 @@ -359,7 +356,6 @@ module Homebrew end versions end - private_class_method :current_versions_from_info_external def subject_for_bump(formula, old, new) if old[:nonexistent] @@ -399,12 +395,10 @@ 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) @@ -421,7 +415,6 @@ 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 @@ -582,5 +575,4 @@ module Homebrew end end end - private_class_method :verify_bintray_published end -- cgit v1.2.3