-
The docs hint at how to do this, but don't provide an example.
But when I try to do this like so: url do
[
url,
{using: MyDownloadStrategy}
]
end I get the following error:
I'm sure there's something simple I'm doing wrong here, but I can't for the life of me figure out what. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@Homebrew/cask can you lend a hand here? |
Beta Was this translation helpful? Give feedback.
-
The trouble seems to be in this block of code in dls.rb: https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cask/dsl.rb#L184 def url(*args, **options)
caller_location = caller_locations[0]
set_unique_stanza(:url, args.empty? && options.empty? && !block_given?) do
if block_given?
LazyObject.new { URL.new(*yield, from_block: true, caller_location: caller_location) }
else
URL.new(*args, **options, caller_location: caller_location)
end
end
end
url using: MyDownloadStrategy do
some_url
end If this is actually a bug I'd be happy to open a pull request for this issue. |
Beta Was this translation helpful? Give feedback.
The trouble seems to be in this block of code in dls.rb:
https://github.com/Homebrew/brew/blob/master/Library/Homebrew/cask/dsl.rb#L184
URL.new
inside the LazyObject is missing**options
in the arguments list; adding options to the argument list allowed me to do