diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index f8cb56e89f..66372ad3e9 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -31,8 +31,15 @@ class Resource @downloader ||= download_strategy.new(download_name, self) end + # Removes /s from resource names; this allows go package names + # to be used as resource names without confusing software that + # interacts with download_name, e.g. github.com/foo/bar + def escaped_name + name.gsub("/", '-') + end + def download_name - name.nil? ? owner.name : "#{owner.name}--#{name}" + name.nil? ? owner.name : "#{owner.name}--#{escaped_name}" end def cached_download