Use module Compat for everything.

This commit is contained in:
Markus Reiter 2018-05-18 13:35:41 +02:00
parent a6d9d45ec3
commit 5b7831f06f
10 changed files with 134 additions and 95 deletions

View File

@ -1,4 +1,5 @@
module SharedEnvExtension module SharedEnvExtension
module Compat
def j1 def j1
odisabled "ENV.j1", "ENV.deparallelize" odisabled "ENV.j1", "ENV.deparallelize"
end end
@ -7,3 +8,6 @@ module SharedEnvExtension
odisabled "ENV.java_cache" odisabled "ENV.java_cache"
end end
end end
prepend Compat
end

View File

@ -1,6 +1,10 @@
module Dependable module Dependable
module Compat
def run? def run?
odeprecated "Dependable#run?" odeprecated "Dependable#run?"
tags.include? :run tags.include? :run
end end
end end
prepend Compat
end

View File

@ -1,4 +1,5 @@
class String class String
module Compat
def undent def undent
odisabled "<<-EOS.undent", "<<~EOS" odisabled "<<-EOS.undent", "<<~EOS"
self self
@ -17,3 +18,6 @@ class String
# EOS # EOS
alias undent_________________________________________________________72 undent alias undent_________________________________________________________72 undent
end end
prepend Compat
end

View File

@ -1,5 +1,9 @@
class Formula class Formula
module Compat
def rake(*) def rake(*)
odisabled "FileUtils#rake", "system \"rake\"" odisabled "FileUtils#rake", "system \"rake\""
end end
end end
prepend Compat
end

View File

@ -1,7 +1,6 @@
module Gpg module Gpg
module_function class << self
module Compat
def executable def executable
odisabled "Gpg.executable", 'which "gpg"' odisabled "Gpg.executable", 'which "gpg"'
end end
@ -10,7 +9,7 @@ module Gpg
odisabled "Gpg.available?", 'which "gpg"' odisabled "Gpg.available?", 'which "gpg"'
end end
def create_test_key(_) def create_test_key(*)
odisabled "Gpg.create_test_key" odisabled "Gpg.create_test_key"
end end
@ -18,7 +17,11 @@ module Gpg
odisabled "Gpg.cleanup_test_processes!" odisabled "Gpg.cleanup_test_processes!"
end end
def test(_) def test(*)
odisabled "Gpg.test" odisabled "Gpg.test"
end end
end end
prepend Compat
end
end

View File

@ -1,7 +1,7 @@
module Hbc module Hbc
module Cache module Cache
module_function class << self
module Compat
def delete_legacy_cache def delete_legacy_cache
legacy_cache = HOMEBREW_CACHE.join("Casks") legacy_cache = HOMEBREW_CACHE.join("Casks")
return unless legacy_cache.exist? return unless legacy_cache.exist?
@ -10,4 +10,8 @@ module Hbc
FileUtils.remove_entry_secure(legacy_cache) FileUtils.remove_entry_secure(legacy_cache)
end end
end end
prepend Compat
end
end
end end

View File

@ -1,7 +1,7 @@
module Hbc module Hbc
module Caskroom module Caskroom
module_function class << self
module Compat
def migrate_legacy_caskroom def migrate_legacy_caskroom
return if Hbc.caskroom.exist? return if Hbc.caskroom.exist?
@ -42,4 +42,8 @@ module Hbc
end end
end end
end end
prepend Compat
end
end
end end

View File

@ -2,6 +2,7 @@ require "cask/lib/hbc/cli/abstract_command"
module Hbc module Hbc
class CLI class CLI
module Compat
class Update < AbstractCommand class Update < AbstractCommand
def self.run(*_ignored) def self.run(*_ignored)
odisabled "`brew cask update`", "`brew update`" odisabled "`brew cask update`", "`brew update`"
@ -12,4 +13,7 @@ module Hbc
end end
end end
end end
prepend Compat
end
end end

View File

@ -1,7 +1,11 @@
module Hbc module Hbc
class DSL class DSL
module Compat
def license(*) def license(*)
odeprecated "Hbc::DSL#license" odeprecated "Hbc::DSL#license"
end end
end end
prepend Compat
end
end end

View File

@ -1,10 +1,14 @@
module OS module OS
module Mac module Mac
module_function class << self
module Compat
def release def release
odeprecated "MacOS.release", "MacOS.version" odeprecated "MacOS.release", "MacOS.version"
version version
end end
end end
prepend Compat
end
end
end end