Merge pull request #15259 from dduugg/revert-mixin-changes
Revert language mixins back to module_function
This commit is contained in:
commit
d039f46faa
@ -8,7 +8,9 @@ module Language
|
|||||||
module Perl
|
module Perl
|
||||||
# Helper module for replacing `perl` shebangs.
|
# Helper module for replacing `perl` shebangs.
|
||||||
module Shebang
|
module Shebang
|
||||||
def self.detected_perl_shebang(formula = self)
|
module_function
|
||||||
|
|
||||||
|
def detected_perl_shebang(formula = self)
|
||||||
perl_path = if formula.deps.map(&:name).include? "perl"
|
perl_path = if formula.deps.map(&:name).include? "perl"
|
||||||
Formula["perl"].opt_bin/"perl"
|
Formula["perl"].opt_bin/"perl"
|
||||||
elsif formula.uses_from_macos_names.include? "perl"
|
elsif formula.uses_from_macos_names.include? "perl"
|
||||||
|
9
Library/Homebrew/language/perl.rbi
Normal file
9
Library/Homebrew/language/perl.rbi
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# typed: strict
|
||||||
|
|
||||||
|
module Language
|
||||||
|
module Perl
|
||||||
|
module Shebang
|
||||||
|
include Kernel
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -92,8 +92,10 @@ module Language
|
|||||||
|
|
||||||
# Mixin module for {Formula} adding shebang rewrite features.
|
# Mixin module for {Formula} adding shebang rewrite features.
|
||||||
module Shebang
|
module Shebang
|
||||||
|
module_function
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
def self.python_shebang_rewrite_info(python_path)
|
def python_shebang_rewrite_info(python_path)
|
||||||
Utils::Shebang::RewriteInfo.new(
|
Utils::Shebang::RewriteInfo.new(
|
||||||
%r{^#! ?/usr/bin/(?:env )?python(?:[23](?:\.\d{1,2})?)?( |$)},
|
%r{^#! ?/usr/bin/(?:env )?python(?:[23](?:\.\d{1,2})?)?( |$)},
|
||||||
28, # the length of "#! /usr/bin/env pythonx.yyy "
|
28, # the length of "#! /usr/bin/env pythonx.yyy "
|
||||||
@ -101,7 +103,7 @@ module Language
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.detected_python_shebang(formula = self, use_python_from_path: false)
|
def detected_python_shebang(formula = self, use_python_from_path: false)
|
||||||
python_path = if use_python_from_path
|
python_path = if use_python_from_path
|
||||||
"/usr/bin/env python3"
|
"/usr/bin/env python3"
|
||||||
else
|
else
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
# typed: strict
|
# typed: strict
|
||||||
|
|
||||||
module Language::Python::Virtualenv
|
module Language::Python
|
||||||
requires_ancestor { Formula }
|
module Shebang
|
||||||
|
include Kernel
|
||||||
|
end
|
||||||
|
|
||||||
|
module Virtualenv
|
||||||
|
requires_ancestor { Formula }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user