fog 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/fog.gemspec +1 -1
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/models/compute/servers.rb +2 -1
- data/lib/fog/aws/storage.rb +12 -0
- metadata +2 -2
data/Gemfile.lock
CHANGED
data/fog.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
|
|
7
7
|
## If your rubyforge_project name is different, then edit it and comment out
|
8
8
|
## the sub! line in the Rakefile
|
9
9
|
s.name = 'fog'
|
10
|
-
s.version = '0.3.
|
10
|
+
s.version = '0.3.4'
|
11
11
|
s.date = '2010-09-24'
|
12
12
|
s.rubyforge_project = 'fog'
|
13
13
|
|
data/lib/fog.rb
CHANGED
@@ -33,8 +33,9 @@ module Fog
|
|
33
33
|
|
34
34
|
# first or create fog_#{credential} keypair
|
35
35
|
unless server.key_pair = connection.key_pairs.get("fog_#{Fog.credential}")
|
36
|
+
name = Fog.respond_to?(:credential) && Fog.credential || :default
|
36
37
|
server.key_pair = connection.key_pairs.create(
|
37
|
-
:name => "fog_#{
|
38
|
+
:name => "fog_#{name}",
|
38
39
|
:public_key => server.public_key
|
39
40
|
)
|
40
41
|
end
|
data/lib/fog/aws/storage.rb
CHANGED
@@ -92,6 +92,18 @@ module Fog
|
|
92
92
|
def initialize(options={})
|
93
93
|
@aws_access_key_id = options[:aws_access_key_id]
|
94
94
|
@region = options[:region] || 'us-east-1'
|
95
|
+
@host = options[:host] || case options[:region]
|
96
|
+
when 'eu-west-1'
|
97
|
+
's3-eu-west-1.amazonaws.com'
|
98
|
+
when 'us-east-1'
|
99
|
+
's3.amazonaws.com'
|
100
|
+
when 'ap-southeast-1'
|
101
|
+
's3-ap-southeast-1.amazonaws.com'
|
102
|
+
when 'us-west-1'
|
103
|
+
's3-us-west-1.amazonaws.com'
|
104
|
+
else
|
105
|
+
raise ArgumentError, "Unknown region: #{options[:region].inspect}"
|
106
|
+
end
|
95
107
|
@data = self.class.data[@region][@aws_access_key_id]
|
96
108
|
end
|
97
109
|
|