From da45cb3532b1130905e587d812e2dcde8a0611dc Mon Sep 17 00:00:00 2001 From: Max De Marzi Date: Wed, 17 Jul 2013 12:40:10 -0500 Subject: [PATCH] download wasn't working on windows --- lib/neography/tasks.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/neography/tasks.rb b/lib/neography/tasks.rb index 6897cf1..a1078cc 100644 --- a/lib/neography/tasks.rb +++ b/lib/neography/tasks.rb @@ -2,6 +2,7 @@ require 'os' require 'httpclient' require 'zip/zip' +require 'net/http' namespace :neo4j do desc "Install Neo4j" @@ -14,7 +15,13 @@ unless File.exist?('neo4j.zip') df = File.open('neo4j.zip', 'wb') begin - df << HTTPClient.new.get("http://dist.neo4j.org/neo4j-#{args[:edition]}-#{args[:version]}-windows.zip") + Net::HTTP.start("dist.neo4j.org") do |http| + http.request_get("/neo4j-#{args[:edition]}-#{args[:version]}-windows.zip") do |resp| + resp.read_body do |segment| + df.write(segment) + end + end + end ensure df.close() end