fog 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fog.gemspec +275 -0
- data/lib/fog/aws/models/s3/bucket.rb +1 -3
- data/lib/fog/aws/models/s3/buckets.rb +5 -6
- data/lib/fog/aws/models/s3/object.rb +0 -3
- data/lib/fog/aws/models/s3/objects.rb +5 -8
- data/lib/fog/collection.rb +1 -1
- data/spec/aws/models/s3/bucket_spec.rb +2 -2
- data/spec/aws/models/s3/buckets_spec.rb +3 -3
- metadata +2 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.4
|
data/fog.gemspec
ADDED
@@ -0,0 +1,275 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{fog}
|
8
|
+
s.version = "0.0.4"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Wesley Beary"]
|
12
|
+
s.date = %q{2009-09-04}
|
13
|
+
s.description = %q{brings clouds to you}
|
14
|
+
s.email = %q{me@geemus.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"LICENSE",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"benchs/fog_vs.rb",
|
27
|
+
"benchs/headers_split_vs_match.rb",
|
28
|
+
"benchs/params.rb",
|
29
|
+
"benchs/parse_vs_push.rb",
|
30
|
+
"benchs/stripping.rb",
|
31
|
+
"fog.gemspec",
|
32
|
+
"lib/fog.rb",
|
33
|
+
"lib/fog/aws.rb",
|
34
|
+
"lib/fog/aws/ec2.rb",
|
35
|
+
"lib/fog/aws/models/ec2/address.rb",
|
36
|
+
"lib/fog/aws/models/ec2/addresses.rb",
|
37
|
+
"lib/fog/aws/models/ec2/key_pair.rb",
|
38
|
+
"lib/fog/aws/models/ec2/key_pairs.rb",
|
39
|
+
"lib/fog/aws/models/ec2/volume.rb",
|
40
|
+
"lib/fog/aws/models/ec2/volumes.rb",
|
41
|
+
"lib/fog/aws/models/s3/bucket.rb",
|
42
|
+
"lib/fog/aws/models/s3/buckets.rb",
|
43
|
+
"lib/fog/aws/models/s3/object.rb",
|
44
|
+
"lib/fog/aws/models/s3/objects.rb",
|
45
|
+
"lib/fog/aws/models/s3/owner.rb",
|
46
|
+
"lib/fog/aws/parsers/ec2/allocate_address.rb",
|
47
|
+
"lib/fog/aws/parsers/ec2/attach_volume.rb",
|
48
|
+
"lib/fog/aws/parsers/ec2/basic.rb",
|
49
|
+
"lib/fog/aws/parsers/ec2/create_key_pair.rb",
|
50
|
+
"lib/fog/aws/parsers/ec2/create_snapshot.rb",
|
51
|
+
"lib/fog/aws/parsers/ec2/create_volume.rb",
|
52
|
+
"lib/fog/aws/parsers/ec2/describe_addresses.rb",
|
53
|
+
"lib/fog/aws/parsers/ec2/describe_availability_zones.rb",
|
54
|
+
"lib/fog/aws/parsers/ec2/describe_images.rb",
|
55
|
+
"lib/fog/aws/parsers/ec2/describe_instances.rb",
|
56
|
+
"lib/fog/aws/parsers/ec2/describe_key_pairs.rb",
|
57
|
+
"lib/fog/aws/parsers/ec2/describe_regions.rb",
|
58
|
+
"lib/fog/aws/parsers/ec2/describe_security_groups.rb",
|
59
|
+
"lib/fog/aws/parsers/ec2/describe_snapshots.rb",
|
60
|
+
"lib/fog/aws/parsers/ec2/describe_volumes.rb",
|
61
|
+
"lib/fog/aws/parsers/ec2/detach_volume.rb",
|
62
|
+
"lib/fog/aws/parsers/ec2/get_console_output.rb",
|
63
|
+
"lib/fog/aws/parsers/ec2/run_instances.rb",
|
64
|
+
"lib/fog/aws/parsers/ec2/terminate_instances.rb",
|
65
|
+
"lib/fog/aws/parsers/s3/copy_object.rb",
|
66
|
+
"lib/fog/aws/parsers/s3/get_bucket.rb",
|
67
|
+
"lib/fog/aws/parsers/s3/get_bucket_location.rb",
|
68
|
+
"lib/fog/aws/parsers/s3/get_request_payment.rb",
|
69
|
+
"lib/fog/aws/parsers/s3/get_service.rb",
|
70
|
+
"lib/fog/aws/parsers/simpledb/basic.rb",
|
71
|
+
"lib/fog/aws/parsers/simpledb/domain_metadata.rb",
|
72
|
+
"lib/fog/aws/parsers/simpledb/get_attributes.rb",
|
73
|
+
"lib/fog/aws/parsers/simpledb/list_domains.rb",
|
74
|
+
"lib/fog/aws/parsers/simpledb/select.rb",
|
75
|
+
"lib/fog/aws/requests/ec2/allocate_address.rb",
|
76
|
+
"lib/fog/aws/requests/ec2/associate_address.rb",
|
77
|
+
"lib/fog/aws/requests/ec2/attach_volume.rb",
|
78
|
+
"lib/fog/aws/requests/ec2/authorize_security_group_ingress.rb",
|
79
|
+
"lib/fog/aws/requests/ec2/create_key_pair.rb",
|
80
|
+
"lib/fog/aws/requests/ec2/create_security_group.rb",
|
81
|
+
"lib/fog/aws/requests/ec2/create_snapshot.rb",
|
82
|
+
"lib/fog/aws/requests/ec2/create_volume.rb",
|
83
|
+
"lib/fog/aws/requests/ec2/delete_key_pair.rb",
|
84
|
+
"lib/fog/aws/requests/ec2/delete_security_group.rb",
|
85
|
+
"lib/fog/aws/requests/ec2/delete_snapshot.rb",
|
86
|
+
"lib/fog/aws/requests/ec2/delete_volume.rb",
|
87
|
+
"lib/fog/aws/requests/ec2/describe_addresses.rb",
|
88
|
+
"lib/fog/aws/requests/ec2/describe_availability_zones.rb",
|
89
|
+
"lib/fog/aws/requests/ec2/describe_images.rb",
|
90
|
+
"lib/fog/aws/requests/ec2/describe_instances.rb",
|
91
|
+
"lib/fog/aws/requests/ec2/describe_key_pairs.rb",
|
92
|
+
"lib/fog/aws/requests/ec2/describe_regions.rb",
|
93
|
+
"lib/fog/aws/requests/ec2/describe_security_groups.rb",
|
94
|
+
"lib/fog/aws/requests/ec2/describe_snapshots.rb",
|
95
|
+
"lib/fog/aws/requests/ec2/describe_volumes.rb",
|
96
|
+
"lib/fog/aws/requests/ec2/detach_volume.rb",
|
97
|
+
"lib/fog/aws/requests/ec2/disassociate_address.rb",
|
98
|
+
"lib/fog/aws/requests/ec2/get_console_output.rb",
|
99
|
+
"lib/fog/aws/requests/ec2/reboot_instances.rb",
|
100
|
+
"lib/fog/aws/requests/ec2/release_address.rb",
|
101
|
+
"lib/fog/aws/requests/ec2/revoke_security_group_ingress.rb",
|
102
|
+
"lib/fog/aws/requests/ec2/run_instances.rb",
|
103
|
+
"lib/fog/aws/requests/ec2/terminate_instances.rb",
|
104
|
+
"lib/fog/aws/requests/s3/copy_object.rb",
|
105
|
+
"lib/fog/aws/requests/s3/delete_bucket.rb",
|
106
|
+
"lib/fog/aws/requests/s3/delete_object.rb",
|
107
|
+
"lib/fog/aws/requests/s3/get_bucket.rb",
|
108
|
+
"lib/fog/aws/requests/s3/get_bucket_location.rb",
|
109
|
+
"lib/fog/aws/requests/s3/get_object.rb",
|
110
|
+
"lib/fog/aws/requests/s3/get_request_payment.rb",
|
111
|
+
"lib/fog/aws/requests/s3/get_service.rb",
|
112
|
+
"lib/fog/aws/requests/s3/head_object.rb",
|
113
|
+
"lib/fog/aws/requests/s3/put_bucket.rb",
|
114
|
+
"lib/fog/aws/requests/s3/put_object.rb",
|
115
|
+
"lib/fog/aws/requests/s3/put_request_payment.rb",
|
116
|
+
"lib/fog/aws/requests/simpledb/batch_put_attributes.rb",
|
117
|
+
"lib/fog/aws/requests/simpledb/create_domain.rb",
|
118
|
+
"lib/fog/aws/requests/simpledb/delete_attributes.rb",
|
119
|
+
"lib/fog/aws/requests/simpledb/delete_domain.rb",
|
120
|
+
"lib/fog/aws/requests/simpledb/domain_metadata.rb",
|
121
|
+
"lib/fog/aws/requests/simpledb/get_attributes.rb",
|
122
|
+
"lib/fog/aws/requests/simpledb/list_domains.rb",
|
123
|
+
"lib/fog/aws/requests/simpledb/put_attributes.rb",
|
124
|
+
"lib/fog/aws/requests/simpledb/select.rb",
|
125
|
+
"lib/fog/aws/s3.rb",
|
126
|
+
"lib/fog/aws/simpledb.rb",
|
127
|
+
"lib/fog/collection.rb",
|
128
|
+
"lib/fog/connection.rb",
|
129
|
+
"lib/fog/errors.rb",
|
130
|
+
"lib/fog/model.rb",
|
131
|
+
"lib/fog/parser.rb",
|
132
|
+
"lib/fog/response.rb",
|
133
|
+
"spec/aws/models/s3/bucket_spec.rb",
|
134
|
+
"spec/aws/models/s3/buckets_spec.rb",
|
135
|
+
"spec/aws/models/s3/object_spec.rb",
|
136
|
+
"spec/aws/models/s3/objects_spec.rb",
|
137
|
+
"spec/aws/models/s3/owner_spec.rb",
|
138
|
+
"spec/aws/requests/ec2/allocate_address_spec.rb",
|
139
|
+
"spec/aws/requests/ec2/associate_address_spec.rb",
|
140
|
+
"spec/aws/requests/ec2/attach_volume_spec.rb",
|
141
|
+
"spec/aws/requests/ec2/authorize_security_group_ingress_spec.rb",
|
142
|
+
"spec/aws/requests/ec2/create_key_pair_spec.rb",
|
143
|
+
"spec/aws/requests/ec2/create_security_group_spec.rb",
|
144
|
+
"spec/aws/requests/ec2/create_snapshot_spec.rb",
|
145
|
+
"spec/aws/requests/ec2/create_volume_spec.rb",
|
146
|
+
"spec/aws/requests/ec2/delete_key_pair_spec.rb",
|
147
|
+
"spec/aws/requests/ec2/delete_security_group_spec.rb",
|
148
|
+
"spec/aws/requests/ec2/delete_snapshot_spec.rb",
|
149
|
+
"spec/aws/requests/ec2/delete_volume_spec.rb",
|
150
|
+
"spec/aws/requests/ec2/describe_addresses_spec.rb",
|
151
|
+
"spec/aws/requests/ec2/describe_availability_zones_spec.rb",
|
152
|
+
"spec/aws/requests/ec2/describe_images_spec.rb",
|
153
|
+
"spec/aws/requests/ec2/describe_instances_spec.rb",
|
154
|
+
"spec/aws/requests/ec2/describe_key_pairs_spec.rb",
|
155
|
+
"spec/aws/requests/ec2/describe_regions_spec.rb",
|
156
|
+
"spec/aws/requests/ec2/describe_security_groups_spec.rb",
|
157
|
+
"spec/aws/requests/ec2/describe_snapshots_spec.rb",
|
158
|
+
"spec/aws/requests/ec2/describe_volumes_spec.rb",
|
159
|
+
"spec/aws/requests/ec2/detach_volume_spec.rb",
|
160
|
+
"spec/aws/requests/ec2/disassociate_address_spec.rb",
|
161
|
+
"spec/aws/requests/ec2/get_console_output_spec.rb",
|
162
|
+
"spec/aws/requests/ec2/reboot_instances_spec.rb",
|
163
|
+
"spec/aws/requests/ec2/release_address_spec.rb",
|
164
|
+
"spec/aws/requests/ec2/revoke_security_group_ingress_spec.rb",
|
165
|
+
"spec/aws/requests/ec2/run_instances_spec.rb",
|
166
|
+
"spec/aws/requests/ec2/terminate_instances_spec.rb",
|
167
|
+
"spec/aws/requests/s3/copy_object_spec.rb",
|
168
|
+
"spec/aws/requests/s3/delete_bucket_spec.rb",
|
169
|
+
"spec/aws/requests/s3/delete_object_spec.rb",
|
170
|
+
"spec/aws/requests/s3/get_bucket_location_spec.rb",
|
171
|
+
"spec/aws/requests/s3/get_bucket_spec.rb",
|
172
|
+
"spec/aws/requests/s3/get_object_spec.rb",
|
173
|
+
"spec/aws/requests/s3/get_request_payment_spec.rb",
|
174
|
+
"spec/aws/requests/s3/get_service_spec.rb",
|
175
|
+
"spec/aws/requests/s3/head_object_spec.rb",
|
176
|
+
"spec/aws/requests/s3/put_bucket_spec.rb",
|
177
|
+
"spec/aws/requests/s3/put_object_spec.rb",
|
178
|
+
"spec/aws/requests/s3/put_request_payment_spec.rb",
|
179
|
+
"spec/aws/requests/simpledb/batch_put_attributes_spec.rb",
|
180
|
+
"spec/aws/requests/simpledb/create_domain_spec.rb",
|
181
|
+
"spec/aws/requests/simpledb/delete_attributes_spec.rb",
|
182
|
+
"spec/aws/requests/simpledb/delete_domain_spec.rb",
|
183
|
+
"spec/aws/requests/simpledb/domain_metadata_spec.rb",
|
184
|
+
"spec/aws/requests/simpledb/get_attributes_spec.rb",
|
185
|
+
"spec/aws/requests/simpledb/list_domains_spec.rb",
|
186
|
+
"spec/aws/requests/simpledb/put_attributes_spec.rb",
|
187
|
+
"spec/aws/requests/simpledb/select_spec.rb",
|
188
|
+
"spec/lorem.txt",
|
189
|
+
"spec/spec.opts",
|
190
|
+
"spec/spec_helper.rb"
|
191
|
+
]
|
192
|
+
s.homepage = %q{http://github.com/geemus/fog}
|
193
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
194
|
+
s.require_paths = ["lib"]
|
195
|
+
s.rubyforge_project = %q{fog}
|
196
|
+
s.rubygems_version = %q{1.3.5}
|
197
|
+
s.summary = %q{fog = clouds + you}
|
198
|
+
s.test_files = [
|
199
|
+
"spec/aws/models/s3/bucket_spec.rb",
|
200
|
+
"spec/aws/models/s3/buckets_spec.rb",
|
201
|
+
"spec/aws/models/s3/object_spec.rb",
|
202
|
+
"spec/aws/models/s3/objects_spec.rb",
|
203
|
+
"spec/aws/models/s3/owner_spec.rb",
|
204
|
+
"spec/aws/requests/ec2/allocate_address_spec.rb",
|
205
|
+
"spec/aws/requests/ec2/associate_address_spec.rb",
|
206
|
+
"spec/aws/requests/ec2/attach_volume_spec.rb",
|
207
|
+
"spec/aws/requests/ec2/authorize_security_group_ingress_spec.rb",
|
208
|
+
"spec/aws/requests/ec2/create_key_pair_spec.rb",
|
209
|
+
"spec/aws/requests/ec2/create_security_group_spec.rb",
|
210
|
+
"spec/aws/requests/ec2/create_snapshot_spec.rb",
|
211
|
+
"spec/aws/requests/ec2/create_volume_spec.rb",
|
212
|
+
"spec/aws/requests/ec2/delete_key_pair_spec.rb",
|
213
|
+
"spec/aws/requests/ec2/delete_security_group_spec.rb",
|
214
|
+
"spec/aws/requests/ec2/delete_snapshot_spec.rb",
|
215
|
+
"spec/aws/requests/ec2/delete_volume_spec.rb",
|
216
|
+
"spec/aws/requests/ec2/describe_addresses_spec.rb",
|
217
|
+
"spec/aws/requests/ec2/describe_availability_zones_spec.rb",
|
218
|
+
"spec/aws/requests/ec2/describe_images_spec.rb",
|
219
|
+
"spec/aws/requests/ec2/describe_instances_spec.rb",
|
220
|
+
"spec/aws/requests/ec2/describe_key_pairs_spec.rb",
|
221
|
+
"spec/aws/requests/ec2/describe_regions_spec.rb",
|
222
|
+
"spec/aws/requests/ec2/describe_security_groups_spec.rb",
|
223
|
+
"spec/aws/requests/ec2/describe_snapshots_spec.rb",
|
224
|
+
"spec/aws/requests/ec2/describe_volumes_spec.rb",
|
225
|
+
"spec/aws/requests/ec2/detach_volume_spec.rb",
|
226
|
+
"spec/aws/requests/ec2/disassociate_address_spec.rb",
|
227
|
+
"spec/aws/requests/ec2/get_console_output_spec.rb",
|
228
|
+
"spec/aws/requests/ec2/reboot_instances_spec.rb",
|
229
|
+
"spec/aws/requests/ec2/release_address_spec.rb",
|
230
|
+
"spec/aws/requests/ec2/revoke_security_group_ingress_spec.rb",
|
231
|
+
"spec/aws/requests/ec2/run_instances_spec.rb",
|
232
|
+
"spec/aws/requests/ec2/terminate_instances_spec.rb",
|
233
|
+
"spec/aws/requests/s3/copy_object_spec.rb",
|
234
|
+
"spec/aws/requests/s3/delete_bucket_spec.rb",
|
235
|
+
"spec/aws/requests/s3/delete_object_spec.rb",
|
236
|
+
"spec/aws/requests/s3/get_bucket_location_spec.rb",
|
237
|
+
"spec/aws/requests/s3/get_bucket_spec.rb",
|
238
|
+
"spec/aws/requests/s3/get_object_spec.rb",
|
239
|
+
"spec/aws/requests/s3/get_request_payment_spec.rb",
|
240
|
+
"spec/aws/requests/s3/get_service_spec.rb",
|
241
|
+
"spec/aws/requests/s3/head_object_spec.rb",
|
242
|
+
"spec/aws/requests/s3/put_bucket_spec.rb",
|
243
|
+
"spec/aws/requests/s3/put_object_spec.rb",
|
244
|
+
"spec/aws/requests/s3/put_request_payment_spec.rb",
|
245
|
+
"spec/aws/requests/simpledb/batch_put_attributes_spec.rb",
|
246
|
+
"spec/aws/requests/simpledb/create_domain_spec.rb",
|
247
|
+
"spec/aws/requests/simpledb/delete_attributes_spec.rb",
|
248
|
+
"spec/aws/requests/simpledb/delete_domain_spec.rb",
|
249
|
+
"spec/aws/requests/simpledb/domain_metadata_spec.rb",
|
250
|
+
"spec/aws/requests/simpledb/get_attributes_spec.rb",
|
251
|
+
"spec/aws/requests/simpledb/list_domains_spec.rb",
|
252
|
+
"spec/aws/requests/simpledb/put_attributes_spec.rb",
|
253
|
+
"spec/aws/requests/simpledb/select_spec.rb",
|
254
|
+
"spec/spec_helper.rb"
|
255
|
+
]
|
256
|
+
|
257
|
+
if s.respond_to? :specification_version then
|
258
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
259
|
+
s.specification_version = 3
|
260
|
+
|
261
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
262
|
+
s.add_runtime_dependency(%q<mime-types>, [">= 0"])
|
263
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
264
|
+
s.add_runtime_dependency(%q<ruby-hmac>, [">= 0"])
|
265
|
+
else
|
266
|
+
s.add_dependency(%q<mime-types>, [">= 0"])
|
267
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
268
|
+
s.add_dependency(%q<ruby-hmac>, [">= 0"])
|
269
|
+
end
|
270
|
+
else
|
271
|
+
s.add_dependency(%q<mime-types>, [">= 0"])
|
272
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
273
|
+
s.add_dependency(%q<ruby-hmac>, [">= 0"])
|
274
|
+
end
|
275
|
+
end
|
@@ -19,14 +19,13 @@ module Fog
|
|
19
19
|
|
20
20
|
def destroy
|
21
21
|
connection.delete_bucket(@name)
|
22
|
-
buckets.delete(name)
|
23
22
|
true
|
24
23
|
rescue Fog::Errors::NotFound
|
25
24
|
false
|
26
25
|
end
|
27
26
|
|
28
27
|
def location
|
29
|
-
data =
|
28
|
+
data = connection.get_bucket_location(@name)
|
30
29
|
data.body['LocationConstraint']
|
31
30
|
end
|
32
31
|
|
@@ -60,7 +59,6 @@ module Fog
|
|
60
59
|
options['LocationConstraint'] = @location
|
61
60
|
end
|
62
61
|
connection.put_bucket(@name, options)
|
63
|
-
buckets[name] = self
|
64
62
|
true
|
65
63
|
end
|
66
64
|
|
@@ -11,15 +11,15 @@ module Fog
|
|
11
11
|
def all
|
12
12
|
data = connection.get_service.body
|
13
13
|
owner = Fog::AWS::S3::Owner.new(data.delete('Owner').merge!(:connection => connection))
|
14
|
-
|
14
|
+
buckets = Fog::AWS::S3::Buckets.new(:connection => connection)
|
15
15
|
data['Buckets'].each do |bucket|
|
16
|
-
|
17
|
-
:buckets =>
|
16
|
+
buckets << Fog::AWS::S3::Bucket.new({
|
17
|
+
:buckets => buckets,
|
18
18
|
:connection => connection,
|
19
19
|
:owner => owner
|
20
20
|
}.merge!(bucket))
|
21
21
|
end
|
22
|
-
|
22
|
+
buckets
|
23
23
|
end
|
24
24
|
|
25
25
|
def create(attributes = {})
|
@@ -41,7 +41,6 @@ module Fog
|
|
41
41
|
:connection => connection,
|
42
42
|
:name => data['Name']
|
43
43
|
})
|
44
|
-
self[bucket.name] = bucket
|
45
44
|
objects_data = {}
|
46
45
|
for key, value in data
|
47
46
|
if ['IsTruncated', 'Marker', 'MaxKeys', 'Prefix'].include?(key)
|
@@ -51,7 +50,7 @@ module Fog
|
|
51
50
|
bucket.objects.merge_attributes(objects_data)
|
52
51
|
data['Contents'].each do |object|
|
53
52
|
owner = Fog::AWS::S3::Owner.new(object.delete('Owner').merge!(:connection => connection))
|
54
|
-
bucket.objects
|
53
|
+
bucket.objects << Fog::AWS::S3::Object.new({
|
55
54
|
:bucket => bucket,
|
56
55
|
:connection => connection,
|
57
56
|
:objects => self,
|
@@ -33,13 +33,11 @@ module Fog
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
target_object.merge_attributes(copy_data)
|
36
|
-
target_object.objects[target_object_key] = target_object
|
37
36
|
target_object
|
38
37
|
end
|
39
38
|
|
40
39
|
def destroy
|
41
40
|
connection.delete_object(bucket.name, @key)
|
42
|
-
objects.delete(@key)
|
43
41
|
true
|
44
42
|
end
|
45
43
|
|
@@ -55,7 +53,6 @@ module Fog
|
|
55
53
|
def save(options = {})
|
56
54
|
data = connection.put_object(bucket.name, @key, @body, options)
|
57
55
|
@etag = data.headers['ETag']
|
58
|
-
objects[@key] = self
|
59
56
|
true
|
60
57
|
end
|
61
58
|
|
@@ -15,12 +15,7 @@ module Fog
|
|
15
15
|
|
16
16
|
def all(options = {})
|
17
17
|
merge_attributes(options)
|
18
|
-
|
19
|
-
objects = bucket.buckets.get(bucket.name, attributes).objects
|
20
|
-
objects.keys.each do |key|
|
21
|
-
self[key] = objects[key]
|
22
|
-
end
|
23
|
-
self
|
18
|
+
bucket.buckets.get(bucket.name, attributes).objects
|
24
19
|
end
|
25
20
|
|
26
21
|
def bucket
|
@@ -44,11 +39,12 @@ module Fog
|
|
44
39
|
object_data[key] = value
|
45
40
|
end
|
46
41
|
end
|
47
|
-
|
42
|
+
object = Fog::AWS::S3::Object.new({
|
48
43
|
:bucket => bucket,
|
49
44
|
:connection => connection,
|
50
45
|
:objects => self
|
51
46
|
}.merge!(object_data))
|
47
|
+
object
|
52
48
|
rescue Fog::Errors::NotFound
|
53
49
|
nil
|
54
50
|
end
|
@@ -63,11 +59,12 @@ module Fog
|
|
63
59
|
object_data[key] = value
|
64
60
|
end
|
65
61
|
end
|
66
|
-
|
62
|
+
object = Fog::AWS::S3::Object.new({
|
67
63
|
:bucket => bucket,
|
68
64
|
:connection => connection,
|
69
65
|
:objects => self
|
70
66
|
}.merge!(object_data))
|
67
|
+
object
|
71
68
|
rescue Fog::Errors::NotFound
|
72
69
|
nil
|
73
70
|
end
|
data/lib/fog/collection.rb
CHANGED
@@ -116,12 +116,12 @@ describe 'Fog::AWS::S3::Bucket' do
|
|
116
116
|
end
|
117
117
|
|
118
118
|
it "should not exist in buckets before save" do
|
119
|
-
@bucket.buckets.
|
119
|
+
@bucket.buckets.all.map {|bucket| bucket.name}.include?(@bucket.name).should be_false
|
120
120
|
end
|
121
121
|
|
122
122
|
it "should exist in buckets after save" do
|
123
123
|
@bucket.save
|
124
|
-
@bucket.buckets.
|
124
|
+
@bucket.buckets.all.map {|bucket| bucket.name}.include?(@bucket.name).should be_true
|
125
125
|
@bucket.destroy
|
126
126
|
end
|
127
127
|
|
@@ -9,9 +9,9 @@ describe 'Fog::AWS::S3::Buckets' do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should include persisted buckets" do
|
12
|
-
bucket = s3.buckets.create(:name => 'fogbucketname')
|
13
|
-
s3.buckets.all.
|
14
|
-
bucket.destroy
|
12
|
+
@bucket = s3.buckets.create(:name => 'fogbucketname')
|
13
|
+
s3.buckets.all.map {|bucket| bucket.name}.should include('fogbucketname')
|
14
|
+
@bucket.destroy
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wesley Beary
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- benchs/params.rb
|
64
64
|
- benchs/parse_vs_push.rb
|
65
65
|
- benchs/stripping.rb
|
66
|
+
- fog.gemspec
|
66
67
|
- lib/fog.rb
|
67
68
|
- lib/fog/aws.rb
|
68
69
|
- lib/fog/aws/ec2.rb
|