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 Compat
def j1
odisabled "ENV.j1", "ENV.deparallelize"
end
@ -6,4 +7,7 @@ module SharedEnvExtension
def java_cache
odisabled "ENV.java_cache"
end
end
prepend Compat
end

View File

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

View File

@ -1,4 +1,5 @@
class String
module Compat
def undent
odisabled "<<-EOS.undent", "<<~EOS"
self
@ -16,4 +17,7 @@ class String
# mollit anim id est laborum.
# EOS
alias undent_________________________________________________________72 undent
end
prepend Compat
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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