Brew-cask artifact stanza

Hi,
I’m trying to artifacts using brew cask. However,

This works:

docs=[ 'myfile' ]
docs.each do |filename|
        artifact "#{filename}", target: "#{HOMEBREW_PREFIX}/#{filename}"
end

but this does not:

docs=Dir[ 'myfile' ]
docs.each do |filename|
        artifact "#{filename}", target: "#{HOMEBREW_PREFIX}/#{filename}"
end

Does anyone know why? The reason I want to do this is because I have all my installable artifacts in one folder and would like to use Dir[*] to quickly match them.

aren’t you better of just making the dir an artifact? (I don’t know much about casks)

Can’t, my target is a the man dir so the files need to be inserted directly or else the system can’t find them