From 351a7dc5bac091c420c80e8722fd9b74f089183e Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 19 Nov 2012 08:45:55 -0500 Subject: [PATCH] Kinda fixing rake to at least only download once --- sylvilagus/jruby/Rakefile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sylvilagus/jruby/Rakefile b/sylvilagus/jruby/Rakefile index f6a044a..b87e112 100644 --- a/sylvilagus/jruby/Rakefile +++ b/sylvilagus/jruby/Rakefile @@ -5,11 +5,11 @@ RMQV = '2.8.7' directory './tmp' -file "./tmp/rabbitmq-java-client-bin-#{RMQV}.tar.gz" => ['./tmp'] do |f| +file "./tmp/rabbitmq-java-client-bin-#{RMQV}.tar.gz" => ['./tmp'] do |t| puts "*** Downloading tarball" - open("#{RMQ_URI_BASE}/v#{RMQV}/rabbitmq-java-client-bin-#{RMQV}.tar.gz") do |f| - open('./tmp/rabbitmq-java-client-bin.tar.gz', 'w') do |out| - out.write(f.read) + open("#{RMQ_URI_BASE}/v#{RMQV}/rabbitmq-java-client-bin-#{RMQV}.tar.gz") do |dl| + open(t.name, 'w') do |out| + out.write(dl.read) end end end @@ -18,8 +18,7 @@ file "./tmp/rabbitmq-java-client-bin-#{RMQV}/rabbitmq-client.jar" => ["./tmp/rabbitmq-java-client-bin-#{RMQV}.tar.gz"] do puts "*** Extracting tarball" Dir.chdir('./tmp') do - `tar xzvf rabbitmq-java-client-bin.tar.gz` - puts "*** Extracted, exit code = #{$?}" + sh "tar xzvf rabbitmq-java-client-bin-#{RMQV}.tar.gz" end end