thor-tropo 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/changelog.md +4 -0
- data/lib/thor-tropo/uploader.rb +12 -11
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.1
|
data/changelog.md
CHANGED
data/lib/thor-tropo/uploader.rb
CHANGED
@@ -11,9 +11,11 @@ module ThorTropo
|
|
11
11
|
|
12
12
|
def initialize(opts={})
|
13
13
|
@debug_mode = opts[:debug_mode]
|
14
|
+
@use_iam = opts[:use_iam]
|
15
|
+
|
14
16
|
@connection = setup_connection(opts[:access_key],opts[:secret_key])
|
15
17
|
@bucket_name = get_bucket( opts[:bucket] || 'artifacts.voxeolabs.net' )
|
16
|
-
|
18
|
+
|
17
19
|
end
|
18
20
|
|
19
21
|
def upload(opts={})
|
@@ -57,19 +59,18 @@ module ThorTropo
|
|
57
59
|
private
|
58
60
|
|
59
61
|
def setup_connection(u,p)
|
62
|
+
|
63
|
+
fog_args = { :provider => 'AWS' }
|
64
|
+
|
60
65
|
if @use_iam
|
61
|
-
|
62
|
-
:provider => 'AWS',
|
63
|
-
:use_iam_profile => true
|
64
|
-
}
|
66
|
+
fog_args[:use_iam_profile] = true
|
65
67
|
else
|
66
|
-
|
67
|
-
|
68
|
-
:aws_access_key_id => u,
|
69
|
-
:aws_secret_access_key => p
|
70
|
-
}
|
68
|
+
fog_args[:aws_access_key_id] = u
|
69
|
+
fog_args[:aws_secret_access_key] = p
|
71
70
|
end
|
72
|
-
|
71
|
+
|
72
|
+
Fog::Storage.new fog_args
|
73
|
+
|
73
74
|
end
|
74
75
|
|
75
76
|
def get_bucket(bucket_name)
|