Clean up compat.

This commit is contained in:
Markus Reiter 2018-05-17 19:13:37 +02:00
parent c28f56b7da
commit a6d9d45ec3
5 changed files with 32 additions and 40 deletions

View File

@ -7,8 +7,7 @@ require "compat/hbc/dsl"
module Hbc
class << self
prepend(
Module.new do
module Compat
def init
Cache.delete_legacy_cache
@ -17,7 +16,8 @@ module Hbc
super
end
end,
)
end
prepend Compat
end
end

View File

@ -1,4 +1,9 @@
module CaskLoaderCompatibilityLayer
module Hbc
module CaskLoader
class FromContentLoader; end
class FromPathLoader < FromContentLoader
module Compat
private
def cask(header_token, **options, &block)
@ -9,14 +14,9 @@ module CaskLoaderCompatibilityLayer
super(header_token, **options, &block)
end
end
end
module Hbc
module CaskLoader
class FromContentLoader; end
class FromPathLoader < FromContentLoader
prepend CaskLoaderCompatibilityLayer
prepend Compat
end
end
end

View File

@ -4,20 +4,12 @@ module Hbc
class CLI
class Update < AbstractCommand
def self.run(*_ignored)
odeprecated "`brew cask update`", "`brew update`", disable_on: Time.utc(2017, 7, 1)
result = SystemCommand.run(HOMEBREW_BREW_FILE, args: ["update"],
print_stderr: true,
print_stdout: true)
exit result.exit_status
odisabled "`brew cask update`", "`brew update`"
end
def self.visible
false
end
def self.help
"a synonym for 'brew update'"
end
end
end
end

View File

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

View File

@ -74,8 +74,8 @@ describe Hbc::CLI, :cask do
end
end
it "provides a help message for all commands" do
described_class.command_classes.each do |command_class|
it "provides a help message for all visible commands" do
described_class.command_classes.select(&:visible).each do |command_class|
expect(command_class.help).to match(/\w+/), command_class.name
end
end