diff --git a/Library/Homebrew/cask/cask_loader.rb b/Library/Homebrew/cask/cask_loader.rb index dd6b20a3d3..0828bd9c1f 100644 --- a/Library/Homebrew/cask/cask_loader.rb +++ b/Library/Homebrew/cask/cask_loader.rb @@ -46,7 +46,7 @@ module Cask private def cask(header_token, **options, &block) - Cask.new(header_token, source: content, **options, config: @config, &block) + Cask.new(header_token, source: content, tap: tap, **options, config: @config, &block) end end @@ -146,18 +146,10 @@ module Cask super && !Tap.from_path(ref).nil? end - attr_reader :tap - def initialize(path) @tap = Tap.from_path(path) super(path) end - - private - - def cask(*args, &block) - super(*args, tap: tap, &block) - end end # Loads a cask from a specific tap. diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 9d18ca01f0..f9eedc625e 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -566,7 +566,7 @@ module Cask def load_cask_from_source_api! options = { git_head: @cask.tap_git_head, sha256: @cask.ruby_source_checksum["sha256"] } cask_source = Homebrew::API::Cask.fetch_source(@cask.token, **options) - @cask = CaskLoader::FromContentLoader.new(cask_source).load(config: @cask.config) + @cask = CaskLoader::FromContentLoader.new(cask_source, tap: @cask.tap).load(config: @cask.config) end end end