lib/chrysalis/vcs/http/repository.rb in chrysalis-0.1.0 vs lib/chrysalis/vcs/http/repository.rb in chrysalis-0.1.1
- old
+ new
@@ -36,10 +36,12 @@
puts ""
puts "Downloading #{@url} ..."
location = URI::parse(@url)
Net::HTTP.start(location.host, location.port) do |http|
- ::File.open(path, 'w') do |f|
+ mode = (RUBY_PLATFORM.match(/mswin/) ? 'wb' : 'w')
+
+ ::File.open(path, mode) do |f|
http.get(location.path) do |stream|
f.write stream
end
end
end