From 54fad14ff3681081ac287a1a66c8ac8d8e15babd Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Mon, 6 Mar 2023 15:11:10 -0800 Subject: [PATCH] Fix module_function errors --- Library/Homebrew/cmd/--prefix.rb | 8 +++----- Library/Homebrew/cmd/log.rb | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/cmd/--prefix.rb b/Library/Homebrew/cmd/--prefix.rb index 55d2205fd2..7204cfade7 100644 --- a/Library/Homebrew/cmd/--prefix.rb +++ b/Library/Homebrew/cmd/--prefix.rb @@ -6,10 +6,8 @@ require "cli/parser" module Homebrew extend T::Sig - module_function - sig { returns(CLI::Parser) } - def __prefix_args + def self.__prefix_args Homebrew::CLI::Parser.new do description <<~EOS Display Homebrew's install path. *Default:* @@ -30,7 +28,7 @@ module Homebrew end end - def __prefix + def self.__prefix args = __prefix_args.parse raise UsageError, "`--installed` requires a formula argument." if args.installed? && args.no_named? @@ -89,7 +87,7 @@ module Homebrew texlive/* ].freeze - def list_unbrewed + def self.list_unbrewed dirs = HOMEBREW_PREFIX.subdirs.map { |dir| dir.basename.to_s } dirs -= %w[Library Cellar Caskroom .git] diff --git a/Library/Homebrew/cmd/log.rb b/Library/Homebrew/cmd/log.rb index acf813df0a..b598f00a3c 100644 --- a/Library/Homebrew/cmd/log.rb +++ b/Library/Homebrew/cmd/log.rb @@ -6,10 +6,8 @@ require "cli/parser" module Homebrew extend T::Sig - module_function - sig { returns(CLI::Parser) } - def log_args + def self.log_args Homebrew::CLI::Parser.new do description <<~EOS Show the `git log` for or , or show the log for the Homebrew repository @@ -37,7 +35,7 @@ module Homebrew end end - def log + def self.log args = log_args.parse # As this command is simplifying user-run commands then let's just use a @@ -53,7 +51,7 @@ module Homebrew end end - def git_log(cd_dir, path = nil, tap = nil, args:) + def self.git_log(cd_dir, path = nil, tap = nil, args:) cd cd_dir do repo = Utils.popen_read("git", "rev-parse", "--show-toplevel").chomp if tap