Merge pull request #1145 from reitermarkus/module-function
Use `module_function` for `Homebrew` module.
This commit is contained in:
commit
cafe149780
@ -66,7 +66,7 @@ Metrics/BlockNesting:
|
|||||||
# Offense count: 19
|
# Offense count: 19
|
||||||
# Configuration parameters: CountComments.
|
# Configuration parameters: CountComments.
|
||||||
Metrics/ModuleLength:
|
Metrics/ModuleLength:
|
||||||
Max: 366
|
Max: 400
|
||||||
|
|
||||||
# Offense count: 2
|
# Offense count: 2
|
||||||
# Configuration parameters: CountKeywordArgs.
|
# Configuration parameters: CountKeywordArgs.
|
||||||
|
|||||||
@ -32,6 +32,8 @@ module BuildEnvironmentDSL
|
|||||||
end
|
end
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def build_env_keys(env)
|
def build_env_keys(env)
|
||||||
%w[
|
%w[
|
||||||
CC CXX LD OBJC OBJCXX
|
CC CXX LD OBJC OBJCXX
|
||||||
|
|||||||
@ -7,6 +7,8 @@
|
|||||||
require "cmd/fetch"
|
require "cmd/fetch"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def __cache
|
def __cache
|
||||||
if ARGV.named.empty?
|
if ARGV.named.empty?
|
||||||
puts HOMEBREW_CACHE
|
puts HOMEBREW_CACHE
|
||||||
|
|||||||
@ -7,6 +7,8 @@
|
|||||||
#: without any sort of versioned directory as the last path.
|
#: without any sort of versioned directory as the last path.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def __cellar
|
def __cellar
|
||||||
if ARGV.named.empty?
|
if ARGV.named.empty?
|
||||||
puts HOMEBREW_CELLAR
|
puts HOMEBREW_CELLAR
|
||||||
|
|||||||
@ -6,6 +6,8 @@ require "build_environment"
|
|||||||
require "utils/shell"
|
require "utils/shell"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def __env
|
def __env
|
||||||
ENV.activate_extensions!
|
ENV.activate_extensions!
|
||||||
ENV.deps = ARGV.formulae if superenv?
|
ENV.deps = ARGV.formulae if superenv?
|
||||||
|
|||||||
@ -5,6 +5,8 @@
|
|||||||
#: Display the location in the cellar where <formula> is or would be installed.
|
#: Display the location in the cellar where <formula> is or would be installed.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def __prefix
|
def __prefix
|
||||||
if ARGV.named.empty?
|
if ARGV.named.empty?
|
||||||
puts HOMEBREW_PREFIX
|
puts HOMEBREW_PREFIX
|
||||||
|
|||||||
@ -8,6 +8,8 @@
|
|||||||
require "tap"
|
require "tap"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def __repository
|
def __repository
|
||||||
if ARGV.named.empty?
|
if ARGV.named.empty?
|
||||||
puts HOMEBREW_REPOSITORY
|
puts HOMEBREW_REPOSITORY
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
#: Print the version number of Homebrew to standard output and exit.
|
#: Print the version number of Homebrew to standard output and exit.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def __version
|
def __version
|
||||||
# As a special case, `--version` is implemented directly in `brew.rb`. This
|
# As a special case, `--version` is implemented directly in `brew.rb`. This
|
||||||
# file merely serves as a container for the documentation. It also catches
|
# file merely serves as a container for the documentation. It also catches
|
||||||
|
|||||||
@ -9,6 +9,8 @@
|
|||||||
#: Regenerate UUID used in Homebrew's analytics.
|
#: Regenerate UUID used in Homebrew's analytics.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def analytics
|
def analytics
|
||||||
config_file = HOMEBREW_REPOSITORY/".git/config"
|
config_file = HOMEBREW_REPOSITORY/".git/config"
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
#: Display the source to <formula>.
|
#: Display the source to <formula>.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def cat
|
def cat
|
||||||
# do not "fix" this to support multiple arguments, the output would be
|
# do not "fix" this to support multiple arguments, the output would be
|
||||||
# unparsable, if the user wants to cat multiple formula they can call
|
# unparsable, if the user wants to cat multiple formula they can call
|
||||||
|
|||||||
@ -15,6 +15,8 @@ require "cleanup"
|
|||||||
require "utils"
|
require "utils"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def cleanup
|
def cleanup
|
||||||
if ARGV.named.empty?
|
if ARGV.named.empty?
|
||||||
Cleanup.cleanup
|
Cleanup.cleanup
|
||||||
|
|||||||
@ -4,6 +4,8 @@
|
|||||||
require "commands"
|
require "commands"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def command
|
def command
|
||||||
abort "This command requires a command argument" if ARGV.empty?
|
abort "This command requires a command argument" if ARGV.empty?
|
||||||
cmd = ARGV.first
|
cmd = ARGV.first
|
||||||
|
|||||||
@ -5,6 +5,8 @@
|
|||||||
#: With `--include-aliases`, the aliases of internal commands will be included.
|
#: With `--include-aliases`, the aliases of internal commands will be included.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def commands
|
def commands
|
||||||
if ARGV.include? "--quiet"
|
if ARGV.include? "--quiet"
|
||||||
cmds = internal_commands + external_commands
|
cmds = internal_commands + external_commands
|
||||||
@ -48,8 +50,6 @@ module Homebrew
|
|||||||
end.sort
|
end.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def find_internal_commands(directory)
|
def find_internal_commands(directory)
|
||||||
directory.children.each_with_object([]) do |f, cmds|
|
directory.children.each_with_object([]) do |f, cmds|
|
||||||
cmds << f.basename.to_s.sub(/\.(?:rb|sh)$/, "") if f.file?
|
cmds << f.basename.to_s.sub(/\.(?:rb|sh)$/, "") if f.file?
|
||||||
|
|||||||
@ -6,6 +6,8 @@
|
|||||||
require "system_config"
|
require "system_config"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def config
|
def config
|
||||||
SystemConfig.dump_verbose_config
|
SystemConfig.dump_verbose_config
|
||||||
end
|
end
|
||||||
|
|||||||
@ -42,6 +42,8 @@ require "formula"
|
|||||||
require "ostruct"
|
require "ostruct"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def deps
|
def deps
|
||||||
mode = OpenStruct.new(
|
mode = OpenStruct.new(
|
||||||
installed?: ARGV.include?("--installed"),
|
installed?: ARGV.include?("--installed"),
|
||||||
|
|||||||
@ -12,6 +12,8 @@ require "descriptions"
|
|||||||
require "cmd/search"
|
require "cmd/search"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def desc
|
def desc
|
||||||
search_type = []
|
search_type = []
|
||||||
search_type << :either if ARGV.flag? "--search"
|
search_type << :either if ARGV.flag? "--search"
|
||||||
|
|||||||
@ -11,6 +11,8 @@
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def diy
|
def diy
|
||||||
path = Pathname.getwd
|
path = Pathname.getwd
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,8 @@
|
|||||||
require "diagnostic"
|
require "diagnostic"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def doctor
|
def doctor
|
||||||
inject_dump_stats!(Diagnostic::Checks, /^check_*/) if ARGV.switch? "D"
|
inject_dump_stats!(Diagnostic::Checks, /^check_*/) if ARGV.switch? "D"
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,8 @@
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def fetch
|
def fetch
|
||||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
@ -93,8 +95,6 @@ module Homebrew
|
|||||||
opoo "Patch reports different #{e.hash_type}: #{e.expected}"
|
opoo "Patch reports different #{e.hash_type}: #{e.expected}"
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def retry_fetch?(f)
|
def retry_fetch?(f)
|
||||||
@fetch_failed ||= Set.new
|
@fetch_failed ||= Set.new
|
||||||
if ARGV.include?("--retry") && @fetch_failed.add?(f)
|
if ARGV.include?("--retry") && @fetch_failed.add?(f)
|
||||||
|
|||||||
@ -15,6 +15,8 @@ require "stringio"
|
|||||||
require "socket"
|
require "socket"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def gistify_logs(f)
|
def gistify_logs(f)
|
||||||
files = load_logs(f.logs)
|
files = load_logs(f.logs)
|
||||||
build_time = f.logs.ctime
|
build_time = f.logs.ctime
|
||||||
|
|||||||
@ -34,6 +34,8 @@ EOS
|
|||||||
require "commands"
|
require "commands"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def help(cmd = nil, flags = {})
|
def help(cmd = nil, flags = {})
|
||||||
# Resolve command aliases and find file containing the implementation.
|
# Resolve command aliases and find file containing the implementation.
|
||||||
if cmd
|
if cmd
|
||||||
@ -71,8 +73,6 @@ module Homebrew
|
|||||||
exit 0
|
exit 0
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def command_help(path)
|
def command_help(path)
|
||||||
help_lines = path.read.lines.grep(/^#:/)
|
help_lines = path.read.lines.grep(/^#:/)
|
||||||
if help_lines.empty?
|
if help_lines.empty?
|
||||||
|
|||||||
@ -5,6 +5,8 @@
|
|||||||
#: Open <formula>'s homepage in a browser.
|
#: Open <formula>'s homepage in a browser.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def home
|
def home
|
||||||
if ARGV.named.empty?
|
if ARGV.named.empty?
|
||||||
exec_browser HOMEBREW_WWW
|
exec_browser HOMEBREW_WWW
|
||||||
|
|||||||
@ -25,6 +25,8 @@ require "tab"
|
|||||||
require "utils/json"
|
require "utils/json"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def info
|
def info
|
||||||
# eventually we'll solidify an API, but we'll keep old versions
|
# eventually we'll solidify an API, but we'll keep old versions
|
||||||
# awhile around for compatibility
|
# awhile around for compatibility
|
||||||
|
|||||||
@ -64,6 +64,8 @@ require "hardware"
|
|||||||
require "development_tools"
|
require "development_tools"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def install
|
def install
|
||||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,8 @@ class String
|
|||||||
end
|
end
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def irb
|
def irb
|
||||||
if ARGV.include? "--examples"
|
if ARGV.include? "--examples"
|
||||||
puts "'v8'.f # => instance of the v8 formula"
|
puts "'v8'.f # => instance of the v8 formula"
|
||||||
|
|||||||
@ -6,6 +6,8 @@ require "tab"
|
|||||||
require "set"
|
require "set"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def leaves
|
def leaves
|
||||||
installed = Formula.installed
|
installed = Formula.installed
|
||||||
deps_of_installed = Set.new
|
deps_of_installed = Set.new
|
||||||
|
|||||||
@ -15,6 +15,8 @@
|
|||||||
require "ostruct"
|
require "ostruct"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def link
|
def link
|
||||||
raise KegUnspecifiedError if ARGV.named.empty?
|
raise KegUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
@ -71,8 +73,6 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def keg_only?(rack)
|
def keg_only?(rack)
|
||||||
Formulary.from_rack(rack).keg_only?
|
Formulary.from_rack(rack).keg_only?
|
||||||
rescue FormulaUnavailableError, TapFormulaAmbiguityError, TapFormulaWithOldnameAmbiguityError
|
rescue FormulaUnavailableError, TapFormulaAmbiguityError, TapFormulaWithOldnameAmbiguityError
|
||||||
|
|||||||
@ -11,6 +11,8 @@ require "keg"
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def linkapps
|
def linkapps
|
||||||
target_dir = linkapps_target(local: ARGV.include?("--local"))
|
target_dir = linkapps_target(local: ARGV.include?("--local"))
|
||||||
|
|
||||||
@ -55,8 +57,6 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def linkapps_target(opts = {})
|
def linkapps_target(opts = {})
|
||||||
local = opts.fetch(:local, false)
|
local = opts.fetch(:local, false)
|
||||||
Pathname.new(local ? "~/Applications" : "/Applications").expand_path
|
Pathname.new(local ? "~/Applications" : "/Applications").expand_path
|
||||||
|
|||||||
@ -22,6 +22,8 @@ require "metafiles"
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def list
|
def list
|
||||||
# Use of exec means we don't explicitly exit
|
# Use of exec means we don't explicitly exit
|
||||||
list_unbrewed if ARGV.flag? "--unbrewed"
|
list_unbrewed if ARGV.flag? "--unbrewed"
|
||||||
@ -58,8 +60,6 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
UNBREWED_EXCLUDE_FILES = %w[.DS_Store].freeze
|
UNBREWED_EXCLUDE_FILES = %w[.DS_Store].freeze
|
||||||
UNBREWED_EXCLUDE_PATHS = %w[
|
UNBREWED_EXCLUDE_PATHS = %w[
|
||||||
.github/*
|
.github/*
|
||||||
|
|||||||
@ -5,6 +5,8 @@
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def log
|
def log
|
||||||
if ARGV.named.empty?
|
if ARGV.named.empty?
|
||||||
cd HOMEBREW_REPOSITORY
|
cd HOMEBREW_REPOSITORY
|
||||||
@ -16,8 +18,6 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def git_log(path = nil)
|
def git_log(path = nil)
|
||||||
if File.exist? "#{`git rev-parse --show-toplevel`.chomp}/.git/shallow"
|
if File.exist? "#{`git rev-parse --show-toplevel`.chomp}/.git/shallow"
|
||||||
opoo <<-EOS.undent
|
opoo <<-EOS.undent
|
||||||
|
|||||||
@ -8,6 +8,8 @@
|
|||||||
require "migrator"
|
require "migrator"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def migrate
|
def migrate
|
||||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,8 @@ require "tab"
|
|||||||
require "diagnostic"
|
require "diagnostic"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def missing
|
def missing
|
||||||
return unless HOMEBREW_CELLAR.exist?
|
return unless HOMEBREW_CELLAR.exist?
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,8 @@ require "formula"
|
|||||||
require "options"
|
require "options"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def options
|
def options
|
||||||
if ARGV.include? "--all"
|
if ARGV.include? "--all"
|
||||||
puts_options Formula.to_a
|
puts_options Formula.to_a
|
||||||
|
|||||||
@ -21,6 +21,8 @@ require "formula"
|
|||||||
require "keg"
|
require "keg"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def outdated
|
def outdated
|
||||||
formulae = if ARGV.resolved_formulae.empty?
|
formulae = if ARGV.resolved_formulae.empty?
|
||||||
Formula.installed
|
Formula.installed
|
||||||
|
|||||||
@ -5,6 +5,8 @@
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def pin
|
def pin
|
||||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,8 @@
|
|||||||
require "sandbox"
|
require "sandbox"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def postinstall
|
def postinstall
|
||||||
ARGV.resolved_formulae.each { |f| run_post_install(f) if f.post_install_defined? }
|
ARGV.resolved_formulae.each { |f| run_post_install(f) if f.post_install_defined? }
|
||||||
end
|
end
|
||||||
|
|||||||
@ -12,6 +12,8 @@ require "cmd/tap"
|
|||||||
require "cmd/unlinkapps"
|
require "cmd/unlinkapps"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def prune
|
def prune
|
||||||
ObserverPathnameExtension.reset_counts!
|
ObserverPathnameExtension.reset_counts!
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,8 @@
|
|||||||
require "readall"
|
require "readall"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def readall
|
def readall
|
||||||
if ARGV.include?("--syntax")
|
if ARGV.include?("--syntax")
|
||||||
ruby_files = []
|
ruby_files = []
|
||||||
|
|||||||
@ -5,6 +5,8 @@ require "formula_installer"
|
|||||||
require "development_tools"
|
require "development_tools"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def reinstall
|
def reinstall
|
||||||
FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed?
|
FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed?
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,8 @@ require "official_taps"
|
|||||||
require "descriptions"
|
require "descriptions"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
SEARCH_ERROR_QUEUE = Queue.new
|
SEARCH_ERROR_QUEUE = Queue.new
|
||||||
|
|
||||||
def search
|
def search
|
||||||
|
|||||||
@ -9,6 +9,8 @@ require "extend/ENV"
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def sh
|
def sh
|
||||||
ENV.activate_extensions!
|
ENV.activate_extensions!
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,8 @@ require "utils"
|
|||||||
require "utils/json"
|
require "utils/json"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def style
|
def style
|
||||||
target = if ARGV.named.empty?
|
target = if ARGV.named.empty?
|
||||||
nil
|
nil
|
||||||
|
|||||||
@ -6,6 +6,8 @@ require "keg"
|
|||||||
require "cmd/link"
|
require "cmd/link"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def switch
|
def switch
|
||||||
if ARGV.named.length != 2
|
if ARGV.named.length != 2
|
||||||
onoe "Usage: brew switch <name> <version>"
|
onoe "Usage: brew switch <name> <version>"
|
||||||
|
|||||||
@ -18,6 +18,8 @@
|
|||||||
require "tap"
|
require "tap"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def tap_info
|
def tap_info
|
||||||
if ARGV.include? "--installed"
|
if ARGV.include? "--installed"
|
||||||
taps = Tap
|
taps = Tap
|
||||||
@ -34,8 +36,6 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def print_tap_info(taps)
|
def print_tap_info(taps)
|
||||||
if taps.none?
|
if taps.none?
|
||||||
tap_count = 0
|
tap_count = 0
|
||||||
|
|||||||
@ -5,6 +5,8 @@
|
|||||||
require "tap"
|
require "tap"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def tap_pin
|
def tap_pin
|
||||||
ARGV.named.each do |name|
|
ARGV.named.each do |name|
|
||||||
tap = Tap.fetch(name)
|
tap = Tap.fetch(name)
|
||||||
|
|||||||
@ -4,6 +4,8 @@
|
|||||||
require "tap"
|
require "tap"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def tap_unpin
|
def tap_unpin
|
||||||
ARGV.named.each do |name|
|
ARGV.named.each do |name|
|
||||||
tap = Tap.fetch(name)
|
tap = Tap.fetch(name)
|
||||||
|
|||||||
@ -34,6 +34,8 @@
|
|||||||
require "tap"
|
require "tap"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def tap
|
def tap
|
||||||
if ARGV.include? "--repair"
|
if ARGV.include? "--repair"
|
||||||
Tap.each(&:link_manpages)
|
Tap.each(&:link_manpages)
|
||||||
|
|||||||
@ -9,6 +9,8 @@ require "formula"
|
|||||||
require "migrator"
|
require "migrator"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def uninstall
|
def uninstall
|
||||||
raise KegUnspecifiedError if ARGV.named.empty?
|
raise KegUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,8 @@
|
|||||||
require "ostruct"
|
require "ostruct"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def unlink
|
def unlink
|
||||||
raise KegUnspecifiedError if ARGV.named.empty?
|
raise KegUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
|
|||||||
@ -12,14 +12,14 @@
|
|||||||
require "cmd/linkapps"
|
require "cmd/linkapps"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def unlinkapps
|
def unlinkapps
|
||||||
target_dir = linkapps_target(local: ARGV.include?("--local"))
|
target_dir = linkapps_target(local: ARGV.include?("--local"))
|
||||||
|
|
||||||
unlinkapps_from_dir(target_dir, dry_run: ARGV.dry_run?)
|
unlinkapps_from_dir(target_dir, dry_run: ARGV.dry_run?)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def unlinkapps_prune(opts = {})
|
def unlinkapps_prune(opts = {})
|
||||||
opts = opts.merge(prune: true)
|
opts = opts.merge(prune: true)
|
||||||
unlinkapps_from_dir(linkapps_target(local: false), opts)
|
unlinkapps_from_dir(linkapps_target(local: false), opts)
|
||||||
|
|||||||
@ -13,6 +13,8 @@ require "stringio"
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def unpack
|
def unpack
|
||||||
formulae = ARGV.formulae
|
formulae = ARGV.formulae
|
||||||
raise FormulaUnspecifiedError if formulae.empty?
|
raise FormulaUnspecifiedError if formulae.empty?
|
||||||
|
|||||||
@ -5,6 +5,8 @@
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def unpin
|
def unpin
|
||||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,8 @@
|
|||||||
require "tap"
|
require "tap"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def untap
|
def untap
|
||||||
raise "Usage is `brew untap <tap-name>`" if ARGV.empty?
|
raise "Usage is `brew untap <tap-name>`" if ARGV.empty?
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,8 @@ require "cleanup"
|
|||||||
require "utils"
|
require "utils"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def update_preinstall_header
|
def update_preinstall_header
|
||||||
@header_already_printed ||= begin
|
@header_already_printed ||= begin
|
||||||
ohai "Auto-updated Homebrew!" if ARGV.include?("--preinstall")
|
ohai "Auto-updated Homebrew!" if ARGV.include?("--preinstall")
|
||||||
@ -106,8 +108,6 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def shorten_revision(revision)
|
def shorten_revision(revision)
|
||||||
Utils.popen_read("git", "-C", HOMEBREW_REPOSITORY, "rev-parse", "--short", revision).chomp
|
Utils.popen_read("git", "-C", HOMEBREW_REPOSITORY, "rev-parse", "--short", revision).chomp
|
||||||
end
|
end
|
||||||
|
|||||||
@ -18,6 +18,8 @@ require "cleanup"
|
|||||||
require "development_tools"
|
require "development_tools"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def upgrade
|
def upgrade
|
||||||
FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed?
|
FormulaInstaller.prevent_build_flags unless DevelopmentTools.installed?
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,8 @@ require "formula"
|
|||||||
# The intersection is harder to achieve with shell tools.
|
# The intersection is harder to achieve with shell tools.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def uses
|
def uses
|
||||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ require "compat/fails_with_llvm"
|
|||||||
require "compat/tap"
|
require "compat/tap"
|
||||||
require "compat/formula"
|
require "compat/formula"
|
||||||
require "compat/formula_specialties"
|
require "compat/formula_specialties"
|
||||||
|
require "compat/global"
|
||||||
require "compat/hardware"
|
require "compat/hardware"
|
||||||
require "compat/macos"
|
require "compat/macos"
|
||||||
require "compat/md5"
|
require "compat/md5"
|
||||||
|
|||||||
16
Library/Homebrew/compat/global.rb
Normal file
16
Library/Homebrew/compat/global.rb
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
|
def method_missing(method, *args, &block)
|
||||||
|
if instance_methods.include?(method)
|
||||||
|
# odeprecated "#{self}##{method}", "'module_function' or 'def self.#{method}' to convert it to a class method"
|
||||||
|
return instance_method(method).bind(self).call(*args, &block)
|
||||||
|
end
|
||||||
|
super
|
||||||
|
end
|
||||||
|
|
||||||
|
def respond_to_missing?(method, include_private = false)
|
||||||
|
return true if method_defined?(method)
|
||||||
|
super(method, include_private)
|
||||||
|
end
|
||||||
|
end
|
||||||
@ -7,6 +7,8 @@ require "resource"
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def aspell_dictionaries
|
def aspell_dictionaries
|
||||||
dict_url = "http://ftpmirror.gnu.org/aspell/dict"
|
dict_url = "http://ftpmirror.gnu.org/aspell/dict"
|
||||||
dict_mirror = "https://ftp.gnu.org/gnu/aspell/dict"
|
dict_mirror = "https://ftp.gnu.org/gnu/aspell/dict"
|
||||||
|
|||||||
@ -37,6 +37,8 @@ require "cmd/style"
|
|||||||
require "date"
|
require "date"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def audit
|
def audit
|
||||||
Homebrew.inject_dump_stats!(FormulaAuditor, /^audit_/) if ARGV.switch? "D"
|
Homebrew.inject_dump_stats!(FormulaAuditor, /^audit_/) if ARGV.switch? "D"
|
||||||
|
|
||||||
|
|||||||
@ -19,6 +19,8 @@ rescue LoadError
|
|||||||
end
|
end
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def boneyard_formula_pr
|
def boneyard_formula_pr
|
||||||
local_only = ARGV.include?("--local")
|
local_only = ARGV.include?("--local")
|
||||||
formula = ARGV.formulae.first
|
formula = ARGV.formulae.first
|
||||||
|
|||||||
@ -41,6 +41,8 @@ EOS
|
|||||||
MAXIMUM_STRING_MATCHES = 100
|
MAXIMUM_STRING_MATCHES = 100
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def keg_contain?(string, keg, ignores)
|
def keg_contain?(string, keg, ignores)
|
||||||
@put_string_exists_header, @put_filenames = nil
|
@put_string_exists_header, @put_filenames = nil
|
||||||
|
|
||||||
|
|||||||
@ -35,6 +35,8 @@
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def inreplace_pairs(path, replacement_pairs)
|
def inreplace_pairs(path, replacement_pairs)
|
||||||
if ARGV.dry_run?
|
if ARGV.dry_run?
|
||||||
contents = path.open("r") { |f| Formulary.ensure_utf8_encoding(f).read }
|
contents = path.open("r") { |f| Formulary.ensure_utf8_encoding(f).read }
|
||||||
|
|||||||
@ -24,6 +24,8 @@ require "digest"
|
|||||||
require "erb"
|
require "erb"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
# Create a formula from a tarball URL
|
# Create a formula from a tarball URL
|
||||||
def create
|
def create
|
||||||
# Allow searching MacPorts or Fink.
|
# Allow searching MacPorts or Fink.
|
||||||
|
|||||||
@ -7,6 +7,8 @@
|
|||||||
require "formula"
|
require "formula"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
unless (HOMEBREW_REPOSITORY/".git").directory?
|
unless (HOMEBREW_REPOSITORY/".git").directory?
|
||||||
raise <<-EOS.undent
|
raise <<-EOS.undent
|
||||||
|
|||||||
@ -13,6 +13,8 @@
|
|||||||
require "os/mac/linkage_checker"
|
require "os/mac/linkage_checker"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def linkage
|
def linkage
|
||||||
ARGV.kegs.each do |keg|
|
ARGV.kegs.each do |keg|
|
||||||
ohai "Checking #{keg.name} linkage" if ARGV.kegs.size > 1
|
ohai "Checking #{keg.name} linkage" if ARGV.kegs.size > 1
|
||||||
|
|||||||
@ -12,6 +12,8 @@ require "erb"
|
|||||||
require "ostruct"
|
require "ostruct"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
SOURCE_PATH = HOMEBREW_LIBRARY_PATH/"manpages"
|
SOURCE_PATH = HOMEBREW_LIBRARY_PATH/"manpages"
|
||||||
TARGET_MAN_PATH = HOMEBREW_REPOSITORY/"manpages"
|
TARGET_MAN_PATH = HOMEBREW_REPOSITORY/"manpages"
|
||||||
TARGET_DOC_PATH = HOMEBREW_REPOSITORY/"docs"
|
TARGET_DOC_PATH = HOMEBREW_REPOSITORY/"docs"
|
||||||
@ -32,8 +34,6 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def regenerate_man_pages
|
def regenerate_man_pages
|
||||||
Homebrew.install_gem_setup_path! "ronn"
|
Homebrew.install_gem_setup_path! "ronn"
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,8 @@
|
|||||||
#: Reuploads the stable URL for a formula to Bintray to use it as a mirror.
|
#: Reuploads the stable URL for a formula to Bintray to use it as a mirror.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def mirror
|
def mirror
|
||||||
odie "This command requires at least formula argument!" if ARGV.named.empty?
|
odie "This command requires at least formula argument!" if ARGV.named.empty?
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,8 @@ require "version"
|
|||||||
require "pkg_version"
|
require "pkg_version"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def pull
|
def pull
|
||||||
odie "You meant `git pull --rebase`." if ARGV[0] == "--rebase"
|
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)
|
str.force_encoding("UTF-8") if str.respond_to?(:force_encoding)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def publish_changed_formula_bottles(_tap, changed_formulae_names)
|
def publish_changed_formula_bottles(_tap, changed_formulae_names)
|
||||||
if ENV["HOMEBREW_DISABLE_LOAD_FORMULA"]
|
if ENV["HOMEBREW_DISABLE_LOAD_FORMULA"]
|
||||||
raise "Need to load formulae to publish them!"
|
raise "Need to load formulae to publish them!"
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
#: Generate the README.md file for a new tap.
|
#: Generate the README.md file for a new tap.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def tap_readme
|
def tap_readme
|
||||||
name = ARGV.first
|
name = ARGV.first
|
||||||
raise "A name is required" if name.nil?
|
raise "A name is required" if name.nil?
|
||||||
|
|||||||
@ -21,6 +21,8 @@ require "sandbox"
|
|||||||
require "timeout"
|
require "timeout"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def test
|
def test
|
||||||
raise FormulaUnspecifiedError if ARGV.named.empty?
|
raise FormulaUnspecifiedError if ARGV.named.empty?
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,8 @@ require "fileutils"
|
|||||||
require "tap"
|
require "tap"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def tests
|
def tests
|
||||||
(HOMEBREW_LIBRARY/"Homebrew").cd do
|
(HOMEBREW_LIBRARY/"Homebrew").cd do
|
||||||
ENV.delete "HOMEBREW_VERBOSE"
|
ENV.delete "HOMEBREW_VERBOSE"
|
||||||
|
|||||||
@ -15,6 +15,8 @@
|
|||||||
#: the new repository clone.
|
#: the new repository clone.
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def update_test
|
def update_test
|
||||||
ENV["HOMEBREW_UPDATE_TEST"] = "1"
|
ENV["HOMEBREW_UPDATE_TEST"] = "1"
|
||||||
|
|
||||||
|
|||||||
@ -39,14 +39,21 @@ HOMEBREW_CURL_ARGS = [
|
|||||||
require "tap_constants"
|
require "tap_constants"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
include FileUtils
|
extend FileUtils
|
||||||
extend self
|
|
||||||
|
|
||||||
attr_accessor :failed
|
class << self
|
||||||
alias failed? failed
|
attr_writer :failed
|
||||||
|
|
||||||
attr_accessor :raise_deprecation_exceptions
|
def failed?
|
||||||
alias raise_deprecation_exceptions? raise_deprecation_exceptions
|
@failed == true
|
||||||
|
end
|
||||||
|
|
||||||
|
attr_writer :raise_deprecation_exceptions
|
||||||
|
|
||||||
|
def raise_deprecation_exceptions?
|
||||||
|
@raise_deprecation_exceptions == true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
HOMEBREW_PULL_API_REGEX = %r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}
|
HOMEBREW_PULL_API_REGEX = %r{https://api\.github\.com/repos/([\w-]+)/([\w-]+)?/pulls/(\d+)}
|
||||||
|
|||||||
@ -114,6 +114,8 @@ class Options
|
|||||||
end
|
end
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
|
module_function
|
||||||
|
|
||||||
def dump_options_for_formula(f)
|
def dump_options_for_formula(f)
|
||||||
f.options.sort_by(&:flag).each do |opt|
|
f.options.sort_by(&:flag).each do |opt|
|
||||||
puts "#{opt.flag}\n\t#{opt.description}"
|
puts "#{opt.flag}\n\t#{opt.description}"
|
||||||
|
|||||||
@ -60,7 +60,7 @@ class UtilTests < Homebrew::TestCase
|
|||||||
|
|
||||||
def test_ofail
|
def test_ofail
|
||||||
shutup { ofail "foo" }
|
shutup { ofail "foo" }
|
||||||
assert Homebrew.failed
|
assert Homebrew.failed?
|
||||||
ensure
|
ensure
|
||||||
Homebrew.failed = false
|
Homebrew.failed = false
|
||||||
end
|
end
|
||||||
|
|||||||
@ -151,7 +151,9 @@ def interactive_shell(f = nil)
|
|||||||
end
|
end
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
def self._system(cmd, *args)
|
module_function
|
||||||
|
|
||||||
|
def _system(cmd, *args)
|
||||||
pid = fork do
|
pid = fork do
|
||||||
yield if block_given?
|
yield if block_given?
|
||||||
args.collect!(&:to_s)
|
args.collect!(&:to_s)
|
||||||
@ -166,12 +168,12 @@ module Homebrew
|
|||||||
$?.success?
|
$?.success?
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.system(cmd, *args)
|
def system(cmd, *args)
|
||||||
puts "#{cmd} #{args*" "}" if ARGV.verbose?
|
puts "#{cmd} #{args*" "}" if ARGV.verbose?
|
||||||
_system(cmd, *args)
|
_system(cmd, *args)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.core_tap_version_string
|
def core_tap_version_string
|
||||||
require "tap"
|
require "tap"
|
||||||
tap = CoreTap.instance
|
tap = CoreTap.instance
|
||||||
return "N/A" unless tap.installed?
|
return "N/A" unless tap.installed?
|
||||||
@ -183,7 +185,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.install_gem_setup_path!(name, version = nil, executable = name)
|
def install_gem_setup_path!(name, version = nil, executable = name)
|
||||||
# Respect user's preferences for where gems should be installed.
|
# Respect user's preferences for where gems should be installed.
|
||||||
ENV["GEM_HOME"] = ENV["GEM_OLD_HOME"].to_s
|
ENV["GEM_HOME"] = ENV["GEM_OLD_HOME"].to_s
|
||||||
ENV["GEM_HOME"] = Gem.user_dir if ENV["GEM_HOME"].empty?
|
ENV["GEM_HOME"] = Gem.user_dir if ENV["GEM_HOME"].empty?
|
||||||
@ -218,20 +220,19 @@ module Homebrew
|
|||||||
odie "Failed to install/update the '#{name}' gem." if exit_code.nonzero?
|
odie "Failed to install/update the '#{name}' gem." if exit_code.nonzero?
|
||||||
end
|
end
|
||||||
|
|
||||||
unless which executable
|
return if which(executable)
|
||||||
odie <<-EOS.undent
|
odie <<-EOS.undent
|
||||||
The '#{name}' gem is installed but couldn't find '#{executable}' in the PATH:
|
The '#{name}' gem is installed but couldn't find '#{executable}' in the PATH:
|
||||||
#{ENV["PATH"]}
|
#{ENV["PATH"]}
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
# Hash of Module => Set(method_names)
|
# Hash of Module => Set(method_names)
|
||||||
@@injected_dump_stat_modules = {}
|
@injected_dump_stat_modules = {}
|
||||||
|
|
||||||
def inject_dump_stats!(the_module, pattern)
|
def inject_dump_stats!(the_module, pattern)
|
||||||
@@injected_dump_stat_modules[the_module] ||= []
|
@injected_dump_stat_modules[the_module] ||= []
|
||||||
injected_methods = @@injected_dump_stat_modules[the_module]
|
injected_methods = @injected_dump_stat_modules[the_module]
|
||||||
the_module.module_eval do
|
the_module.module_eval do
|
||||||
instance_methods.grep(pattern).each do |name|
|
instance_methods.grep(pattern).each do |name|
|
||||||
next if injected_methods.include? name
|
next if injected_methods.include? name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user