titanic 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/titanic.rb +11 -15
  2. data/lib/titanic/version.rb +1 -1
  3. metadata +2 -2
@@ -133,23 +133,19 @@ module Titanic
133
133
 
134
134
  build_path = archive_path uuid
135
135
  verify ['url', 'prefix']
136
- uri = URI File.join(@url,build_path)
137
- log.debug "trying to get @{uri}"
136
+ full_path = File.join(@url,build_path)
138
137
  begin
139
- Net::HTTP.start(uri.host, uri.port) do |http|
140
- request = Net::HTTP::Get.new uri.request_uri
141
- http.request request do |response|
142
- open path, 'w' do |io|
143
- response.read_body do |chunk|
144
- io.write chunk
145
- end
146
- end
147
- end
148
- end
149
- rescue
150
- raise "could not get #{build_path} from #{@url}"
138
+ log.debug "trying to download #{full_path}"
139
+ log.debug "full_path.inspect is #{full_path.inspect}"
140
+ log.debug "full_path.class is #{full_path.class}"
141
+ body = URI.parse(full_path).read
142
+ log.debug "writing file to #{path}"
143
+ File.open(path, 'w') {|f| f.write(body) }
144
+ rescue Object => e
145
+ log.error "could not get #{build_path} from #{@url} because #{e.inspect}"
146
+ raise e
151
147
  end
152
- log.info "downloaded #{uri} to #{path}"
148
+ log.info "downloaded #{full_path} to #{path}"
153
149
  end
154
150
 
155
151
  private
@@ -1,3 +1,3 @@
1
1
  module Titanic
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: titanic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-07 00:00:00.000000000 Z
12
+ date: 2013-10-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler