aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2013-09-17 21:25:41 -0500
committerJack Nagel2013-09-17 21:29:54 -0500
commit28cb9978ee6d9b4bcabb9b9b238c98da52411da0 (patch)
tree2ed51a747ef23ccc24fca3eab5429a3715a495df /Library
parentd46f5005567ec95fe39279ffbd746de7d816916d (diff)
downloadbrew-28cb9978ee6d9b4bcabb9b9b238c98da52411da0.tar.bz2
create: use resource for checksum detection
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/create.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb
index 3578ba93f..88e75de38 100644
--- a/Library/Homebrew/cmd/create.rb
+++ b/Library/Homebrew/cmd/create.rb
@@ -102,10 +102,11 @@ class FormulaCreator
puts "You'll need to add an explicit 'version' to the formula."
end
+ # XXX: why is "and version" here?
unless ARGV.include? "--no-fetch" and version
- spec = SoftwareSpec.new(url, version)
- strategy = spec.download_strategy
- @sha1 = strategy.new(name, spec).fetch.sha1 if strategy == CurlDownloadStrategy
+ r = Resource.new(:default, url, version)
+ r.owner = self
+ @sha1 = r.fetch.sha1 if r.download_strategy == CurlDownloadStrategy
end
path.write ERB.new(template, nil, '>').result(binding)