fog 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fog (0.3.3)
4
+ fog (0.3.4)
5
5
  builder
6
6
  excon (>= 0.2.1)
7
7
  formatador (>= 0.0.15)
@@ -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.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
@@ -32,7 +32,7 @@ require 'fog/ssh'
32
32
  module Fog
33
33
 
34
34
  unless const_defined?(:VERSION)
35
- VERSION = '0.3.3'
35
+ VERSION = '0.3.4'
36
36
  end
37
37
 
38
38
  module Mock
@@ -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_#{Fog.credential}",
38
+ :name => "fog_#{name}",
38
39
  :public_key => server.public_key
39
40
  )
40
41
  end
@@ -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
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 3
9
- version: 0.3.3
8
+ - 4
9
+ version: 0.3.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - geemus (Wesley Beary)