titanic 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/titanic.rb +8 -12
- data/lib/titanic/version.rb +1 -1
- metadata +2 -2
data/lib/titanic.rb
CHANGED
@@ -2,7 +2,7 @@ require "titanic/version"
|
|
2
2
|
require 'logger'
|
3
3
|
require 'aws-sdk'
|
4
4
|
require 'fileutils'
|
5
|
-
require '
|
5
|
+
require 'open-uri'
|
6
6
|
require 'json'
|
7
7
|
|
8
8
|
module Titanic
|
@@ -66,18 +66,14 @@ module Titanic
|
|
66
66
|
def get_deploy_from_http()
|
67
67
|
proper_path = deploy_path
|
68
68
|
proper_path = "/#{proper_path}" unless proper_path[0] == '/'
|
69
|
+
full_path = File.join(@url,proper_path)
|
69
70
|
begin
|
70
|
-
log.debug "trying to get #{
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
raise "file does not exist" unless (response.code.to_i >= 200 && response.code.to_i < 300)
|
77
|
-
return JSON.parse(response.body)
|
78
|
-
rescue
|
79
|
-
log.error "could not get deploy #{proper_path} from #{@url}. raising error"
|
80
|
-
raise "could not get deploy #{proper_path} from #{@url}"
|
71
|
+
log.debug "trying to get #{full_path}"
|
72
|
+
body = URI.parse(full_path).read
|
73
|
+
return JSON.parse(body)
|
74
|
+
rescue Object => e
|
75
|
+
log.error "could not get deploy #{proper_path} from #{@url} because of #{e.inspect}"
|
76
|
+
raise e, "could not get deploy #{proper_path} from #{@url}"
|
81
77
|
end
|
82
78
|
end
|
83
79
|
|
data/lib/titanic/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.7
|
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-
|
12
|
+
date: 2013-10-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|