language/python: move rewrite_python_shebang to compat

This commit is contained in:
Bo Anderson 2020-03-27 22:27:06 +00:00
parent 3955e7e13b
commit 32ab83d055
3 changed files with 18 additions and 4 deletions

View File

@ -1,5 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
require "compat/cask/dsl/version" require "compat/cask/dsl/version"
require "compat/language/python"
require "compat/requirements/macos_requirement" require "compat/requirements/macos_requirement"
require "compat/formula" require "compat/formula"

View File

@ -0,0 +1,17 @@
# frozen_string_literal: true
module Language
module Python
class << self
module Compat
def rewrite_python_shebang(python_path)
Pathname.pwd.find do |f|
Utils::Shebang.rewrite_shebang(Shebang.python_shebang_rewrite_info(python_path), f)
end
end
end
prepend Compat
end
end
end

View File

@ -87,10 +87,6 @@ module Language
] ]
end end
def self.rewrite_python_shebang(python_path)
Pathname.pwd.find { |f| Utils::Shebang.rewrite_shebang(Shebang.python_shebang_rewrite_info(python_path), f) }
end
# Mixin module for {Formula} adding shebang rewrite features. # Mixin module for {Formula} adding shebang rewrite features.
module Shebang module Shebang
module_function module_function