fog 0.0.42 → 0.0.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. data/README.rdoc +1 -1
  2. data/Rakefile +1 -0
  3. data/VERSION.yml +2 -2
  4. data/bin/fog +23 -102
  5. data/fog.gemspec +48 -2
  6. data/lib/fog.rb +17 -46
  7. data/lib/fog/aws.rb +10 -4
  8. data/lib/fog/aws/bin.rb +69 -0
  9. data/lib/fog/aws/ec2.rb +82 -86
  10. data/lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb +20 -16
  11. data/lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb +19 -15
  12. data/lib/fog/aws/requests/s3/get_object.rb +4 -0
  13. data/lib/fog/aws/requests/simpledb/select.rb +42 -24
  14. data/lib/fog/aws/s3.rb +28 -25
  15. data/lib/fog/aws/simpledb.rb +21 -17
  16. data/lib/fog/bin.rb +79 -0
  17. data/lib/fog/collection.rb +20 -9
  18. data/lib/fog/model.rb +9 -4
  19. data/lib/fog/rackspace.rb +10 -3
  20. data/lib/fog/rackspace/bin.rb +44 -0
  21. data/lib/fog/rackspace/files.rb +16 -9
  22. data/lib/fog/rackspace/requests/files/delete_container.rb +2 -1
  23. data/lib/fog/rackspace/requests/files/delete_object.rb +2 -1
  24. data/lib/fog/rackspace/requests/files/get_container.rb +2 -1
  25. data/lib/fog/rackspace/requests/files/get_containers.rb +2 -1
  26. data/lib/fog/rackspace/requests/files/head_container.rb +2 -1
  27. data/lib/fog/rackspace/requests/files/head_containers.rb +2 -1
  28. data/lib/fog/rackspace/requests/files/put_container.rb +2 -1
  29. data/lib/fog/rackspace/requests/files/put_object.rb +2 -1
  30. data/lib/fog/rackspace/requests/servers/get_flavor_details.rb +1 -0
  31. data/lib/fog/rackspace/requests/servers/list_flavors.rb +1 -0
  32. data/lib/fog/rackspace/requests/servers/list_flavors_detail.rb +1 -0
  33. data/lib/fog/rackspace/requests/servers/list_images.rb +0 -1
  34. data/lib/fog/rackspace/requests/servers/reboot_server.rb +2 -1
  35. data/lib/fog/rackspace/servers.rb +31 -26
  36. data/lib/fog/slicehost.rb +35 -17
  37. data/lib/fog/slicehost/bin.rb +42 -0
  38. data/lib/fog/slicehost/models/flavor.rb +41 -0
  39. data/lib/fog/slicehost/models/flavors.rb +33 -0
  40. data/lib/fog/slicehost/models/image.rb +13 -0
  41. data/lib/fog/slicehost/models/images.rb +35 -0
  42. data/lib/fog/slicehost/models/server.rb +55 -0
  43. data/lib/fog/slicehost/models/servers.rb +37 -0
  44. data/lib/fog/slicehost/parsers/get_flavor.rb +24 -0
  45. data/lib/fog/slicehost/parsers/get_image.rb +24 -0
  46. data/lib/fog/slicehost/parsers/get_slice.rb +29 -0
  47. data/lib/fog/slicehost/requests/create_slice.rb +2 -1
  48. data/lib/fog/slicehost/requests/delete_slice.rb +2 -1
  49. data/lib/fog/slicehost/requests/get_backups.rb +1 -0
  50. data/lib/fog/slicehost/requests/get_flavor.rb +42 -0
  51. data/lib/fog/slicehost/requests/get_flavors.rb +1 -0
  52. data/lib/fog/slicehost/requests/get_image.rb +40 -0
  53. data/lib/fog/slicehost/requests/get_images.rb +1 -0
  54. data/lib/fog/slicehost/requests/get_slice.rb +48 -0
  55. data/lib/fog/slicehost/requests/get_slices.rb +1 -0
  56. data/lib/fog/slicehost/requests/reboot_slice.rb +49 -0
  57. data/lib/fog/terremark.rb +71 -0
  58. data/lib/fog/terremark/bin.rb +30 -0
  59. data/lib/fog/terremark/parsers/get_catalog.rb +43 -0
  60. data/lib/fog/terremark/parsers/get_catalog_item.rb +44 -0
  61. data/lib/fog/terremark/parsers/get_organization.rb +44 -0
  62. data/lib/fog/terremark/parsers/get_organizations.rb +26 -0
  63. data/lib/fog/terremark/parsers/get_vapp_template.rb +44 -0
  64. data/lib/fog/terremark/parsers/get_vdc.rb +105 -0
  65. data/lib/fog/terremark/requests/get_catalog.rb +44 -0
  66. data/lib/fog/terremark/requests/get_catalog_item.rb +47 -0
  67. data/lib/fog/terremark/requests/get_organization.rb +46 -0
  68. data/lib/fog/terremark/requests/get_organizations.rb +42 -0
  69. data/lib/fog/terremark/requests/get_vapp_template.rb +47 -0
  70. data/lib/fog/terremark/requests/get_vdc.rb +47 -0
  71. data/spec/slicehost/models/server_spec.rb +51 -0
  72. data/spec/slicehost/models/servers_spec.rb +22 -0
  73. data/spec/slicehost/requests/get_flavor_spec.rb +24 -0
  74. data/spec/slicehost/requests/get_image_spec.rb +24 -0
  75. data/spec/slicehost/requests/get_slice_spec.rb +41 -0
  76. data/spec/slicehost/requests/get_slices_spec.rb +20 -9
  77. data/spec/slicehost/requests/reboot_slice_spec.rb +41 -0
  78. data/spec/spec_helper.rb +10 -0
  79. metadata +55 -2
data/lib/fog/aws/ec2.rb CHANGED
@@ -19,94 +19,80 @@ module Fog
19
19
  end
20
20
  end
21
21
 
22
- def self.reload
23
- load "fog/aws/models/ec2/address.rb"
24
- load "fog/aws/models/ec2/addresses.rb"
25
- load "fog/aws/models/ec2/flavor.rb"
26
- load "fog/aws/models/ec2/flavors.rb"
27
- load "fog/aws/models/ec2/image.rb"
28
- load "fog/aws/models/ec2/images.rb"
29
- load "fog/aws/models/ec2/key_pair.rb"
30
- load "fog/aws/models/ec2/key_pairs.rb"
31
- load "fog/aws/models/ec2/security_group.rb"
32
- load "fog/aws/models/ec2/security_groups.rb"
33
- load "fog/aws/models/ec2/server.rb"
34
- load "fog/aws/models/ec2/servers.rb"
35
- load "fog/aws/models/ec2/snapshot.rb"
36
- load "fog/aws/models/ec2/snapshots.rb"
37
- load "fog/aws/models/ec2/volume.rb"
38
- load "fog/aws/models/ec2/volumes.rb"
39
-
40
- load "fog/aws/parsers/ec2/allocate_address.rb"
41
- load "fog/aws/parsers/ec2/attach_volume.rb"
42
- load "fog/aws/parsers/ec2/basic.rb"
43
- load "fog/aws/parsers/ec2/create_key_pair.rb"
44
- load "fog/aws/parsers/ec2/create_snapshot.rb"
45
- load "fog/aws/parsers/ec2/create_volume.rb"
46
- load "fog/aws/parsers/ec2/describe_addresses.rb"
47
- load "fog/aws/parsers/ec2/describe_availability_zones.rb"
48
- load "fog/aws/parsers/ec2/describe_images.rb"
49
- load "fog/aws/parsers/ec2/describe_instances.rb"
50
- load "fog/aws/parsers/ec2/describe_key_pairs.rb"
51
- load "fog/aws/parsers/ec2/describe_regions.rb"
52
- load "fog/aws/parsers/ec2/describe_security_groups.rb"
53
- load "fog/aws/parsers/ec2/describe_snapshots.rb"
54
- load "fog/aws/parsers/ec2/describe_volumes.rb"
55
- load "fog/aws/parsers/ec2/detach_volume.rb"
56
- load "fog/aws/parsers/ec2/get_console_output.rb"
57
- load "fog/aws/parsers/ec2/run_instances.rb"
58
- load "fog/aws/parsers/ec2/terminate_instances.rb"
59
-
60
- load "fog/aws/requests/ec2/allocate_address.rb"
61
- load "fog/aws/requests/ec2/associate_address.rb"
62
- load "fog/aws/requests/ec2/attach_volume.rb"
63
- load "fog/aws/requests/ec2/authorize_security_group_ingress.rb"
64
- # TODO: require "fog/aws/requests/ec2/bundle_instance.rb"
65
- # TODO: require "fog/aws/requests/ec2/cancel_bundle_task.rb"
66
- # TODO: require "fog/aws/requests/ec2/confirm_product_instance.rb"
67
- load "fog/aws/requests/ec2/create_key_pair.rb"
68
- load "fog/aws/requests/ec2/create_security_group.rb"
69
- load "fog/aws/requests/ec2/create_snapshot.rb"
70
- load "fog/aws/requests/ec2/create_volume.rb"
71
- load "fog/aws/requests/ec2/delete_key_pair.rb"
72
- load "fog/aws/requests/ec2/delete_security_group.rb"
73
- load "fog/aws/requests/ec2/delete_snapshot.rb"
74
- load "fog/aws/requests/ec2/delete_volume.rb"
75
- # TODO: require "fog/aws/requests/ec2/deregister_image.rb"
76
- load "fog/aws/requests/ec2/describe_addresses.rb"
77
- load "fog/aws/requests/ec2/describe_availability_zones.rb"
78
- # TODO: require "fog/aws/requests/ec2/describe_bundle_tasks.rb"
79
- # TODO: require "fog/aws/requests/ec2/describe_image_attribute.rb"
80
- load "fog/aws/requests/ec2/describe_images.rb"
81
- load "fog/aws/requests/ec2/describe_instances.rb"
82
- load "fog/aws/requests/ec2/describe_key_pairs.rb"
83
- load "fog/aws/requests/ec2/describe_regions.rb"
84
- # TODO: require "fog/aws/requests/ec2/describe_reserved_instances.rb"
85
- # TODO: require "fog/aws/requests/ec2/describe_reserved_instances_offerings.rb"
86
- load "fog/aws/requests/ec2/describe_security_groups.rb"
87
- load "fog/aws/requests/ec2/describe_snapshots.rb"
88
- load "fog/aws/requests/ec2/describe_volumes.rb"
89
- load "fog/aws/requests/ec2/detach_volume.rb"
90
- load "fog/aws/requests/ec2/disassociate_address.rb"
91
- load "fog/aws/requests/ec2/get_console_output.rb"
92
- # TODO: require "fog/aws/requests/ec2/modify_image_attribute.rb"
93
- # TODO: require "fog/aws/requests/ec2/modify_snapshot_attribute.rb"
94
- # TODO: require "fog/aws/requests/ec2/monitor_instances.rb"
95
- # TODO: require "fog/aws/requests/ec2/purchase_reserved_instances_offering.rb"
96
- load "fog/aws/requests/ec2/reboot_instances.rb"
97
- # TODO: require "fog/aws/requests/ec2/register_image.rb"
98
- load "fog/aws/requests/ec2/release_address.rb"
99
- # TODO: require "fog/aws/requests/ec2/reset_image_attributes.rb"
100
- # TODO: require "fog/aws/requests/ec2/reset_snapshot_attributes.rb"
101
- load "fog/aws/requests/ec2/revoke_security_group_ingress.rb"
102
- load "fog/aws/requests/ec2/run_instances.rb"
103
- load "fog/aws/requests/ec2/terminate_instances.rb"
104
- # TODO: require "fog/aws/requests/ec2/unmonitor_instances.rb"
22
+ def self.dependencies
23
+ [
24
+ "fog/aws/models/ec2/address.rb",
25
+ "fog/aws/models/ec2/addresses.rb",
26
+ "fog/aws/models/ec2/flavor.rb",
27
+ "fog/aws/models/ec2/flavors.rb",
28
+ "fog/aws/models/ec2/image.rb",
29
+ "fog/aws/models/ec2/images.rb",
30
+ "fog/aws/models/ec2/key_pair.rb",
31
+ "fog/aws/models/ec2/key_pairs.rb",
32
+ "fog/aws/models/ec2/security_group.rb",
33
+ "fog/aws/models/ec2/security_groups.rb",
34
+ "fog/aws/models/ec2/server.rb",
35
+ "fog/aws/models/ec2/servers.rb",
36
+ "fog/aws/models/ec2/snapshot.rb",
37
+ "fog/aws/models/ec2/snapshots.rb",
38
+ "fog/aws/models/ec2/volume.rb",
39
+ "fog/aws/models/ec2/volumes.rb",
40
+ "fog/aws/parsers/ec2/allocate_address.rb",
41
+ "fog/aws/parsers/ec2/attach_volume.rb",
42
+ "fog/aws/parsers/ec2/basic.rb",
43
+ "fog/aws/parsers/ec2/create_key_pair.rb",
44
+ "fog/aws/parsers/ec2/create_snapshot.rb",
45
+ "fog/aws/parsers/ec2/create_volume.rb",
46
+ "fog/aws/parsers/ec2/describe_addresses.rb",
47
+ "fog/aws/parsers/ec2/describe_availability_zones.rb",
48
+ "fog/aws/parsers/ec2/describe_images.rb",
49
+ "fog/aws/parsers/ec2/describe_instances.rb",
50
+ "fog/aws/parsers/ec2/describe_key_pairs.rb",
51
+ "fog/aws/parsers/ec2/describe_regions.rb",
52
+ "fog/aws/parsers/ec2/describe_security_groups.rb",
53
+ "fog/aws/parsers/ec2/describe_snapshots.rb",
54
+ "fog/aws/parsers/ec2/describe_volumes.rb",
55
+ "fog/aws/parsers/ec2/detach_volume.rb",
56
+ "fog/aws/parsers/ec2/get_console_output.rb",
57
+ "fog/aws/parsers/ec2/run_instances.rb",
58
+ "fog/aws/parsers/ec2/terminate_instances.rb",
59
+ "fog/aws/requests/ec2/allocate_address.rb",
60
+ "fog/aws/requests/ec2/associate_address.rb",
61
+ "fog/aws/requests/ec2/attach_volume.rb",
62
+ "fog/aws/requests/ec2/authorize_security_group_ingress.rb",
63
+ "fog/aws/requests/ec2/create_key_pair.rb",
64
+ "fog/aws/requests/ec2/create_security_group.rb",
65
+ "fog/aws/requests/ec2/create_snapshot.rb",
66
+ "fog/aws/requests/ec2/create_volume.rb",
67
+ "fog/aws/requests/ec2/delete_key_pair.rb",
68
+ "fog/aws/requests/ec2/delete_security_group.rb",
69
+ "fog/aws/requests/ec2/delete_snapshot.rb",
70
+ "fog/aws/requests/ec2/delete_volume.rb",
71
+ "fog/aws/requests/ec2/describe_addresses.rb",
72
+ "fog/aws/requests/ec2/describe_availability_zones.rb",
73
+ "fog/aws/requests/ec2/describe_images.rb",
74
+ "fog/aws/requests/ec2/describe_instances.rb",
75
+ "fog/aws/requests/ec2/describe_key_pairs.rb",
76
+ "fog/aws/requests/ec2/describe_regions.rb",
77
+ "fog/aws/requests/ec2/describe_security_groups.rb",
78
+ "fog/aws/requests/ec2/describe_snapshots.rb",
79
+ "fog/aws/requests/ec2/describe_volumes.rb",
80
+ "fog/aws/requests/ec2/detach_volume.rb",
81
+ "fog/aws/requests/ec2/disassociate_address.rb",
82
+ "fog/aws/requests/ec2/get_console_output.rb",
83
+ "fog/aws/requests/ec2/reboot_instances.rb",
84
+ "fog/aws/requests/ec2/release_address.rb",
85
+ "fog/aws/requests/ec2/revoke_security_group_ingress.rb",
86
+ "fog/aws/requests/ec2/run_instances.rb",
87
+ "fog/aws/requests/ec2/terminate_instances.rb"
88
+ ]
89
+ end
105
90
 
91
+ def self.reload
92
+ self.dependencies.each {|dependency| load(dependency)}
106
93
  if Fog.mocking?
107
94
  reset_data
108
95
  end
109
-
110
96
  end
111
97
 
112
98
  # Initialize connection to EC2
@@ -123,6 +109,7 @@ module Fog
123
109
  #
124
110
  # ==== Parameters
125
111
  # * options<~Hash> - config arguments for connection. Defaults to {}.
112
+ # * region<~String> - optional region to use, in ['eu-west-1', 'us-east-1', 'us-west-1']
126
113
  #
127
114
  # ==== Returns
128
115
  # * EC2 object with connection to aws.
@@ -134,7 +121,16 @@ module Fog
134
121
  raise ArgumentError.new('aws_secret_access_key is required to access ec2')
135
122
  end
136
123
  @hmac = HMAC::SHA256.new(@aws_secret_access_key)
137
- @host = options[:host] || 'ec2.amazonaws.com'
124
+ @host = options[:host] || case options[:region]
125
+ when 'eu-west-1'
126
+ 'ec2.eu-west-1.amazonaws.com'
127
+ when 'us-east-1'
128
+ 'ec2.us-east-1.amazonaws.com'
129
+ when 'us-west-1'
130
+ 'ec2.us-west-1.amazonaws.com'
131
+ else
132
+ 'ec2.amazonaws.com'
133
+ end
138
134
  @port = options[:port] || 443
139
135
  @scheme = options[:scheme] || 'https'
140
136
  end
@@ -178,4 +174,4 @@ module Fog
178
174
  end
179
175
  end
180
176
 
181
- Fog::AWS::EC2.reload
177
+ Fog::AWS::EC2.dependencies.each {|dependency| require(dependency)}
@@ -41,24 +41,28 @@ else
41
41
 
42
42
  # TODO: handle the GroupName/Source/Source case
43
43
  def authorize_security_group_ingress(options = {})
44
- response = Excon::Response.new
45
- group = Fog::AWS::EC2.data[:security_groups][options['GroupName']]
44
+ if options['GroupName'] && options['SourceSecurityGroupName'] && options['SourceSecurityGroupOwnerId']
45
+ raise MockNotImplemented.new("Contributions welcome!")
46
+ else
47
+ response = Excon::Response.new
48
+ group = Fog::AWS::EC2.data[:security_groups][options['GroupName']]
46
49
 
47
- group['ipPermissions'] ||= []
48
- group['ipPermissions'] << {
49
- 'groups' => [],
50
- 'fromPort' => options['FromPort'],
51
- 'ipRanges' => [{ 'cidrIp' => options['CidrIp'] }],
52
- 'ipProtocol' => options['IpProtocol'],
53
- 'toPort' => options['ToPort']
54
- }
50
+ group['ipPermissions'] ||= []
51
+ group['ipPermissions'] << {
52
+ 'groups' => [],
53
+ 'fromPort' => options['FromPort'],
54
+ 'ipRanges' => [{ 'cidrIp' => options['CidrIp'] }],
55
+ 'ipProtocol' => options['IpProtocol'],
56
+ 'toPort' => options['ToPort']
57
+ }
55
58
 
56
- response.status = 200
57
- response.body = {
58
- 'requestId' => Fog::AWS::Mock.request_id,
59
- 'return' => true
60
- }
61
- response
59
+ response.status = 200
60
+ response.body = {
61
+ 'requestId' => Fog::AWS::Mock.request_id,
62
+ 'return' => true
63
+ }
64
+ response
65
+ end
62
66
  end
63
67
 
64
68
  end
@@ -41,24 +41,28 @@ else
41
41
 
42
42
  # TODO: handle the GroupName/Source/Source case
43
43
  def revoke_security_group_ingress(options = {})
44
- response = Excon::Response.new
45
- group = Fog::AWS::EC2.data[:security_groups][options['GroupName']]
44
+ if options['GroupName'] && options['SourceSecurityGroupName'] && options['SourceSecurityGroupOwnerId']
45
+ raise MockNotImplemented.new("Contributions welcome!")
46
+ else
47
+ response = Excon::Response.new
48
+ group = Fog::AWS::EC2.data[:security_groups][options['GroupName']]
46
49
 
47
- ingress = group['ipPermissions'].select {|permission|
48
- permission['fromPort'] == options['FromPort'] &&
49
- permission['ipProtocol'] == options['IpProtocol'] &&
50
- permission['toPort'] == options['ToPort'] &&
51
- permission['ipRanges'].first['cidrIp'] == options['CidrIp']
52
- }.first
50
+ ingress = group['ipPermissions'].select {|permission|
51
+ permission['fromPort'] == options['FromPort'] &&
52
+ permission['ipProtocol'] == options['IpProtocol'] &&
53
+ permission['toPort'] == options['ToPort'] &&
54
+ permission['ipRanges'].first['cidrIp'] == options['CidrIp']
55
+ }.first
53
56
 
54
- group['ipPermissions'].delete(ingress)
57
+ group['ipPermissions'].delete(ingress)
55
58
 
56
- response.status = 200
57
- response.body = {
58
- 'requestId' => Fog::AWS::Mock.request_id,
59
- 'return' => true
60
- }
61
- response
59
+ response.status = 200
60
+ response.body = {
61
+ 'requestId' => Fog::AWS::Mock.request_id,
62
+ 'return' => true
63
+ }
64
+ response
65
+ end
62
66
  end
63
67
 
64
68
  end
@@ -114,6 +114,10 @@ else
114
114
  response
115
115
  end
116
116
 
117
+ def get_object_url(bucket_name, object_name, expires)
118
+ raise MockNotImplemented.new("Contributions welcome!")
119
+ end
120
+
117
121
  end
118
122
  end
119
123
  end
@@ -1,29 +1,47 @@
1
- module Fog
2
- module AWS
3
- class SimpleDB
4
-
5
- # Select item data from SimpleDB
6
- #
7
- # ==== Parameters
8
- # * select_expression<~String> - Expression to query domain with.
9
- # * next_token<~String> - Offset token to start list, defaults to nil.
10
- #
11
- # ==== Returns
12
- # * response<~Excon::Response>:
13
- # * body<~Hash>:
14
- # * 'BoxUsage'<~Float>
15
- # * 'RequestId'<~String>
16
- # * 'Items'<~Hash> - list of attribute name/values for the items formatted as
17
- # { 'item_name' => { 'attribute_name' => ['attribute_value'] }}
18
- # * 'NextToken'<~String> - offset to start with if there are are more domains to list
19
- def select(select_expression, next_token = nil)
20
- request({
21
- 'Action' => 'Select',
22
- 'NextToken' => next_token,
23
- 'SelectExpression' => select_expression
24
- }, Fog::Parsers::AWS::SimpleDB::Select.new(@nil_string))
1
+ unless Fog.mocking?
2
+
3
+ module Fog
4
+ module AWS
5
+ class SimpleDB
6
+
7
+ # Select item data from SimpleDB
8
+ #
9
+ # ==== Parameters
10
+ # * select_expression<~String> - Expression to query domain with.
11
+ # * next_token<~String> - Offset token to start list, defaults to nil.
12
+ #
13
+ # ==== Returns
14
+ # * response<~Excon::Response>:
15
+ # * body<~Hash>:
16
+ # * 'BoxUsage'<~Float>
17
+ # * 'RequestId'<~String>
18
+ # * 'Items'<~Hash> - list of attribute name/values for the items formatted as
19
+ # { 'item_name' => { 'attribute_name' => ['attribute_value'] }}
20
+ # * 'NextToken'<~String> - offset to start with if there are are more domains to list
21
+ def select(select_expression, next_token = nil)
22
+ request({
23
+ 'Action' => 'Select',
24
+ 'NextToken' => next_token,
25
+ 'SelectExpression' => select_expression
26
+ }, Fog::Parsers::AWS::SimpleDB::Select.new(@nil_string))
27
+ end
28
+
25
29
  end
30
+ end
31
+ end
26
32
 
33
+ else
34
+
35
+ module Fog
36
+ module AWS
37
+ class SimpleDB
38
+
39
+ def select(select_expression, next_token = nil)
40
+ raise MockNotImplemented.new("Contributions welcome!")
41
+ end
42
+
43
+ end
27
44
  end
28
45
  end
46
+
29
47
  end
data/lib/fog/aws/s3.rb CHANGED
@@ -11,31 +11,34 @@ module Fog
11
11
  end
12
12
  end
13
13
 
14
- def self.reload
15
- load "fog/aws/models/s3/directory.rb"
16
- load "fog/aws/models/s3/directories.rb"
17
- load "fog/aws/models/s3/file.rb"
18
- load "fog/aws/models/s3/files.rb"
19
-
20
- load "fog/aws/parsers/s3/copy_object.rb"
21
- load "fog/aws/parsers/s3/get_bucket.rb"
22
- load "fog/aws/parsers/s3/get_bucket_location.rb"
23
- load "fog/aws/parsers/s3/get_request_payment.rb"
24
- load "fog/aws/parsers/s3/get_service.rb"
25
-
26
- load "fog/aws/requests/s3/copy_object.rb"
27
- load "fog/aws/requests/s3/delete_bucket.rb"
28
- load "fog/aws/requests/s3/delete_object.rb"
29
- load "fog/aws/requests/s3/get_bucket.rb"
30
- load "fog/aws/requests/s3/get_bucket_location.rb"
31
- load "fog/aws/requests/s3/get_object.rb"
32
- load "fog/aws/requests/s3/get_request_payment.rb"
33
- load "fog/aws/requests/s3/get_service.rb"
34
- load "fog/aws/requests/s3/head_object.rb"
35
- load "fog/aws/requests/s3/put_bucket.rb"
36
- load "fog/aws/requests/s3/put_object.rb"
37
- load "fog/aws/requests/s3/put_request_payment.rb"
14
+ def self.dependencies
15
+ [
16
+ "fog/aws/models/s3/directory.rb",
17
+ "fog/aws/models/s3/directories.rb",
18
+ "fog/aws/models/s3/file.rb",
19
+ "fog/aws/models/s3/files.rb",
20
+ "fog/aws/parsers/s3/copy_object.rb",
21
+ "fog/aws/parsers/s3/get_bucket.rb",
22
+ "fog/aws/parsers/s3/get_bucket_location.rb",
23
+ "fog/aws/parsers/s3/get_request_payment.rb",
24
+ "fog/aws/parsers/s3/get_service.rb",
25
+ "fog/aws/requests/s3/copy_object.rb",
26
+ "fog/aws/requests/s3/delete_bucket.rb",
27
+ "fog/aws/requests/s3/delete_object.rb",
28
+ "fog/aws/requests/s3/get_bucket.rb",
29
+ "fog/aws/requests/s3/get_bucket_location.rb",
30
+ "fog/aws/requests/s3/get_object.rb",
31
+ "fog/aws/requests/s3/get_request_payment.rb",
32
+ "fog/aws/requests/s3/get_service.rb",
33
+ "fog/aws/requests/s3/head_object.rb",
34
+ "fog/aws/requests/s3/put_bucket.rb",
35
+ "fog/aws/requests/s3/put_object.rb",
36
+ "fog/aws/requests/s3/put_request_payment.rb"
37
+ ]
38
+ end
38
39
 
40
+ def self.reload
41
+ self.dependencies.each {|dependency| load(dependency)}
39
42
  if Fog.mocking?
40
43
  reset_data
41
44
  end
@@ -164,4 +167,4 @@ DATA
164
167
  end
165
168
  end
166
169
 
167
- Fog::AWS::S3.reload
170
+ Fog::AWS::S3.dependencies.each {|dependency| require(dependency)}
@@ -11,23 +11,27 @@ module Fog
11
11
  end
12
12
  end
13
13
 
14
- def self.reload
15
- load "fog/aws/parsers/simpledb/basic.rb"
16
- load "fog/aws/parsers/simpledb/domain_metadata.rb"
17
- load "fog/aws/parsers/simpledb/get_attributes.rb"
18
- load "fog/aws/parsers/simpledb/list_domains.rb"
19
- load "fog/aws/parsers/simpledb/select.rb"
20
-
21
- load "fog/aws/requests/simpledb/batch_put_attributes.rb"
22
- load "fog/aws/requests/simpledb/create_domain.rb"
23
- load "fog/aws/requests/simpledb/delete_attributes.rb"
24
- load "fog/aws/requests/simpledb/delete_domain.rb"
25
- load "fog/aws/requests/simpledb/domain_metadata.rb"
26
- load "fog/aws/requests/simpledb/get_attributes.rb"
27
- load "fog/aws/requests/simpledb/list_domains.rb"
28
- load "fog/aws/requests/simpledb/put_attributes.rb"
29
- load "fog/aws/requests/simpledb/select.rb"
14
+ def self.dependencies
15
+ [
16
+ "fog/aws/parsers/simpledb/basic.rb",
17
+ "fog/aws/parsers/simpledb/domain_metadata.rb",
18
+ "fog/aws/parsers/simpledb/get_attributes.rb",
19
+ "fog/aws/parsers/simpledb/list_domains.rb",
20
+ "fog/aws/parsers/simpledb/select.rb",
21
+ "fog/aws/requests/simpledb/batch_put_attributes.rb",
22
+ "fog/aws/requests/simpledb/create_domain.rb",
23
+ "fog/aws/requests/simpledb/delete_attributes.rb",
24
+ "fog/aws/requests/simpledb/delete_domain.rb",
25
+ "fog/aws/requests/simpledb/domain_metadata.rb",
26
+ "fog/aws/requests/simpledb/get_attributes.rb",
27
+ "fog/aws/requests/simpledb/list_domains.rb",
28
+ "fog/aws/requests/simpledb/put_attributes.rb",
29
+ "fog/aws/requests/simpledb/select.rb"
30
+ ]
31
+ end
30
32
 
33
+ def self.reload
34
+ self.dependencies.each {|dependency| load(dependency)}
31
35
  if Fog.mocking?
32
36
  reset_data
33
37
  end
@@ -152,4 +156,4 @@ module Fog
152
156
  end
153
157
  end
154
158
 
155
- Fog::AWS::SimpleDB.reload
159
+ Fog::AWS::SimpleDB.dependencies.each {|dependency| require(dependency)}