titanic 0.0.3 → 0.0.4

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 +8 -2
  2. data/lib/titanic/version.rb +1 -1
  3. metadata +2 -2
@@ -61,9 +61,15 @@ module Titanic
61
61
  proper_path = "/#{proper_path}" unless proper_path[0] == '/'
62
62
  begin
63
63
  log.debug "trying to get #{proper_path} from #{@url}"
64
- uri = URI File.join(@url,proper_path)
65
- return Net::HTTP.get(uri)
64
+ uri = URI.parse File.join(@url,proper_path)
65
+ http = Net::HTTP.new(uri.host, uri.port)
66
+ request = Net::HTTP::Get.new(uri.request_uri)
67
+ response = http.request(request)
68
+ log.debug "response code is #{response.code}"
69
+ raise "file does not exist" unless (response.code.to_i >= 200 && response.code.to_i < 300)
70
+ return response.body
66
71
  rescue
72
+ log.error "could not get deploy #{proper_path} from #{@url}. raising error"
67
73
  raise "could not get deploy #{proper_path} from #{@url}"
68
74
  end
69
75
  end
@@ -1,3 +1,3 @@
1
1
  module Titanic
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
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.3
4
+ version: 0.0.4
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-05-14 00:00:00.000000000 Z
12
+ date: 2013-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler