fog 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fog (0.3.2)
4
+ fog (0.3.3)
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.2'
10
+ s.version = '0.3.3'
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.2'
35
+ VERSION = '0.3.3'
36
36
  end
37
37
 
38
38
  module Mock
@@ -67,48 +67,50 @@ module Fog
67
67
  class Mock
68
68
 
69
69
  def self.data
70
- @data ||= Hash.new do |hash, key|
70
+ @data ||= Hash.new do |hash, region|
71
71
  owner_id = Fog::AWS::Mock.owner_id
72
- hash[key] = {
73
- :deleted_at => {},
74
- :addresses => {},
75
- :instances => {},
76
- :key_pairs => {},
77
- :limits => { :addresses => 5 },
78
- :owner_id => owner_id,
79
- :security_groups => {
80
- 'default' => {
81
- 'groupDescription' => 'default group',
82
- 'groupName' => 'default',
83
- 'ipPermissions' => [
84
- {
85
- 'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
86
- 'fromPort' => -1,
87
- 'toPort' => -1,
88
- 'ipProtocol' => 'icmp',
89
- 'ipRanges' => []
90
- },
91
- {
92
- 'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
93
- 'fromPort' => 0,
94
- 'toPort' => 65535,
95
- 'ipProtocol' => 'tcp',
96
- 'ipRanges' => []
97
- },
98
- {
99
- 'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
100
- 'fromPort' => 0,
101
- 'toPort' => 65535,
102
- 'ipProtocol' => 'udp',
103
- 'ipRanges' => []
104
- }
105
- ],
106
- 'ownerId' => owner_id
107
- }
108
- },
109
- :snapshots => {},
110
- :volumes => {}
111
- }
72
+ hash[region] = Hash.new do |hash, key|
73
+ hash[key] = {
74
+ :deleted_at => {},
75
+ :addresses => {},
76
+ :instances => {},
77
+ :key_pairs => {},
78
+ :limits => { :addresses => 5 },
79
+ :owner_id => owner_id,
80
+ :security_groups => {
81
+ 'default' => {
82
+ 'groupDescription' => 'default group',
83
+ 'groupName' => 'default',
84
+ 'ipPermissions' => [
85
+ {
86
+ 'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
87
+ 'fromPort' => -1,
88
+ 'toPort' => -1,
89
+ 'ipProtocol' => 'icmp',
90
+ 'ipRanges' => []
91
+ },
92
+ {
93
+ 'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
94
+ 'fromPort' => 0,
95
+ 'toPort' => 65535,
96
+ 'ipProtocol' => 'tcp',
97
+ 'ipRanges' => []
98
+ },
99
+ {
100
+ 'groups' => [{'groupName' => 'default', 'userId' => owner_id}],
101
+ 'fromPort' => 0,
102
+ 'toPort' => 65535,
103
+ 'ipProtocol' => 'udp',
104
+ 'ipRanges' => []
105
+ }
106
+ ],
107
+ 'ownerId' => owner_id
108
+ }
109
+ },
110
+ :snapshots => {},
111
+ :volumes => {}
112
+ }
113
+ end
112
114
  end
113
115
  end
114
116
 
@@ -120,7 +122,8 @@ module Fog
120
122
 
121
123
  def initialize(options={})
122
124
  @aws_access_key_id = options[:aws_access_key_id]
123
- @data = self.class.data[@aws_access_key_id]
125
+ @region = options[:region] || 'us-east-1'
126
+ @data = self.class.data[@region][@aws_access_key_id]
124
127
  @owner_id = @data[:owner_id]
125
128
  end
126
129
 
@@ -74,10 +74,12 @@ module Fog
74
74
  include Utils
75
75
 
76
76
  def self.data
77
- @data ||= Hash.new do |hash, key|
78
- hash[key] = {
79
- :buckets => {}
80
- }
77
+ @data ||= Hash.new do |hash, region|
78
+ hash[region] = Hash.new do |hash, key|
79
+ hash[key] = {
80
+ :buckets => {}
81
+ }
82
+ end
81
83
  end
82
84
  end
83
85
 
@@ -89,7 +91,8 @@ module Fog
89
91
 
90
92
  def initialize(options={})
91
93
  @aws_access_key_id = options[:aws_access_key_id]
92
- @data = self.class.data[@aws_access_key_id]
94
+ @region = options[:region] || 'us-east-1'
95
+ @data = self.class.data[@region][@aws_access_key_id]
93
96
  end
94
97
 
95
98
  def signature(params)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 2
9
- version: 0.3.2
8
+ - 3
9
+ version: 0.3.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - geemus (Wesley Beary)