Skip to content

Commit

Permalink
download wasn't working on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
maxdemarzi committed Jul 17, 2013
1 parent 13f7632 commit da45cb3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/neography/tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'os'
require 'httpclient'
require 'zip/zip'
require 'net/http'

namespace :neo4j do
desc "Install Neo4j"
Expand All @@ -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
Expand Down

0 comments on commit da45cb3

Please sign in to comment.