fog 0.0.46 → 0.0.47
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/fog.gemspec +13 -3
- data/lib/fog/aws/models/ec2/server.rb +4 -3
- data/lib/fog/aws/models/ec2/volume.rb +2 -0
- data/lib/fog/aws/models/ec2/volumes.rb +1 -1
- data/lib/fog/aws/requests/s3/get_object.rb +2 -2
- data/lib/fog/collection.rb +15 -1
- data/lib/fog/rackspace/bin.rb +4 -0
- data/lib/fog/rackspace/files.rb +10 -4
- data/lib/fog/rackspace/models/files/directories.rb +42 -0
- data/lib/fog/rackspace/models/files/directory.rb +39 -0
- data/lib/fog/rackspace/models/files/file.rb +59 -0
- data/lib/fog/rackspace/models/files/files.rb +88 -0
- data/lib/fog/rackspace/requests/files/get_container.rb +4 -1
- data/lib/fog/rackspace/requests/files/get_object.rb +41 -0
- data/lib/fog/rackspace/requests/files/head_object.rb +40 -0
- data/spec/rackspace/requests/files/get_object_spec.rb +21 -0
- data/spec/rackspace/requests/files/head_object_spec.rb +21 -0
- metadata +62 -29
data/VERSION.yml
CHANGED
data/fog.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{fog}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.47"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["geemus (Wesley Beary)"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-03-03}
|
13
13
|
s.default_executable = %q{fog}
|
14
14
|
s.description = %q{brings clouds to you}
|
15
15
|
s.email = %q{me@geemus.com}
|
@@ -143,6 +143,10 @@ Gem::Specification.new do |s|
|
|
143
143
|
"lib/fog/rackspace.rb",
|
144
144
|
"lib/fog/rackspace/bin.rb",
|
145
145
|
"lib/fog/rackspace/files.rb",
|
146
|
+
"lib/fog/rackspace/models/files/directories.rb",
|
147
|
+
"lib/fog/rackspace/models/files/directory.rb",
|
148
|
+
"lib/fog/rackspace/models/files/file.rb",
|
149
|
+
"lib/fog/rackspace/models/files/files.rb",
|
146
150
|
"lib/fog/rackspace/models/servers/flavor.rb",
|
147
151
|
"lib/fog/rackspace/models/servers/flavors.rb",
|
148
152
|
"lib/fog/rackspace/models/servers/image.rb",
|
@@ -153,8 +157,10 @@ Gem::Specification.new do |s|
|
|
153
157
|
"lib/fog/rackspace/requests/files/delete_object.rb",
|
154
158
|
"lib/fog/rackspace/requests/files/get_container.rb",
|
155
159
|
"lib/fog/rackspace/requests/files/get_containers.rb",
|
160
|
+
"lib/fog/rackspace/requests/files/get_object.rb",
|
156
161
|
"lib/fog/rackspace/requests/files/head_container.rb",
|
157
162
|
"lib/fog/rackspace/requests/files/head_containers.rb",
|
163
|
+
"lib/fog/rackspace/requests/files/head_object.rb",
|
158
164
|
"lib/fog/rackspace/requests/files/put_container.rb",
|
159
165
|
"lib/fog/rackspace/requests/files/put_object.rb",
|
160
166
|
"lib/fog/rackspace/requests/servers/create_image.rb",
|
@@ -291,8 +297,10 @@ Gem::Specification.new do |s|
|
|
291
297
|
"spec/rackspace/requests/files/delete_object_spec.rb",
|
292
298
|
"spec/rackspace/requests/files/get_container_spec.rb",
|
293
299
|
"spec/rackspace/requests/files/get_containers_spec.rb",
|
300
|
+
"spec/rackspace/requests/files/get_object_spec.rb",
|
294
301
|
"spec/rackspace/requests/files/head_container_spec.rb",
|
295
302
|
"spec/rackspace/requests/files/head_containers_spec.rb",
|
303
|
+
"spec/rackspace/requests/files/head_object_spec.rb",
|
296
304
|
"spec/rackspace/requests/files/put_container_spec.rb",
|
297
305
|
"spec/rackspace/requests/files/put_object_spec.rb",
|
298
306
|
"spec/rackspace/requests/servers/create_image_spec.rb",
|
@@ -367,7 +375,7 @@ Gem::Specification.new do |s|
|
|
367
375
|
s.rdoc_options = ["--charset=UTF-8"]
|
368
376
|
s.require_paths = ["lib"]
|
369
377
|
s.rubyforge_project = %q{fog}
|
370
|
-
s.rubygems_version = %q{1.3.
|
378
|
+
s.rubygems_version = %q{1.3.6}
|
371
379
|
s.summary = %q{fog = clouds + you}
|
372
380
|
s.test_files = [
|
373
381
|
"spec/aws/models/ec2/address_spec.rb",
|
@@ -445,8 +453,10 @@ Gem::Specification.new do |s|
|
|
445
453
|
"spec/rackspace/requests/files/delete_object_spec.rb",
|
446
454
|
"spec/rackspace/requests/files/get_container_spec.rb",
|
447
455
|
"spec/rackspace/requests/files/get_containers_spec.rb",
|
456
|
+
"spec/rackspace/requests/files/get_object_spec.rb",
|
448
457
|
"spec/rackspace/requests/files/head_container_spec.rb",
|
449
458
|
"spec/rackspace/requests/files/head_containers_spec.rb",
|
459
|
+
"spec/rackspace/requests/files/head_object_spec.rb",
|
450
460
|
"spec/rackspace/requests/files/put_container_spec.rb",
|
451
461
|
"spec/rackspace/requests/files/put_object_spec.rb",
|
452
462
|
"spec/rackspace/requests/servers/create_image_spec.rb",
|
@@ -31,6 +31,7 @@ module Fog
|
|
31
31
|
|
32
32
|
def initialize(attributes)
|
33
33
|
@groups ||= ["default"]
|
34
|
+
@flavor_id ||= 'm1.small'
|
34
35
|
super
|
35
36
|
end
|
36
37
|
|
@@ -56,7 +57,7 @@ module Fog
|
|
56
57
|
# end
|
57
58
|
|
58
59
|
def flavor_id
|
59
|
-
@
|
60
|
+
@flavor && @flavor.id || @flavor_id
|
60
61
|
end
|
61
62
|
|
62
63
|
def flavor=(new_flavor)
|
@@ -64,7 +65,7 @@ module Fog
|
|
64
65
|
end
|
65
66
|
|
66
67
|
def flavor
|
67
|
-
@flavor
|
68
|
+
@flavor ||= connection.flavors.all.detect {|flavor| flavor.id == @flavor_id}
|
68
69
|
end
|
69
70
|
|
70
71
|
def key_pair
|
@@ -106,7 +107,7 @@ module Fog
|
|
106
107
|
def save
|
107
108
|
requires :image_id
|
108
109
|
|
109
|
-
options = {'InstanceType' => flavor}
|
110
|
+
options = {'InstanceType' => flavor.id}
|
110
111
|
if @availability_zone
|
111
112
|
options['Placement.AvailabilityZone'] = @availability_zone
|
112
113
|
end
|
@@ -35,13 +35,13 @@ unless Fog.mocking?
|
|
35
35
|
headers['If-Unmodified-Since'] = options['If-Unmodified-Since'].utc.strftime("%a, %d %b %Y %H:%M:%S +0000") if options['If-Modified-Since']
|
36
36
|
headers.merge!(options)
|
37
37
|
request({
|
38
|
+
:block => block,
|
38
39
|
:expects => 200,
|
39
40
|
:headers => headers,
|
40
41
|
:host => "#{bucket_name}.#{@host}",
|
41
42
|
:idempotent => true,
|
42
43
|
:method => 'GET',
|
43
|
-
:path => CGI.escape(object_name)
|
44
|
-
:block => block
|
44
|
+
:path => CGI.escape(object_name)
|
45
45
|
})
|
46
46
|
end
|
47
47
|
|
data/lib/fog/collection.rb
CHANGED
@@ -10,7 +10,16 @@ module Fog
|
|
10
10
|
RUBY
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
%w[reject select].each do |method|
|
14
|
+
class_eval <<-RUBY
|
15
|
+
def #{method}(*args)
|
16
|
+
lazy_load
|
17
|
+
self.class.new(:connection => self.connection).load(super)
|
18
|
+
end
|
19
|
+
RUBY
|
20
|
+
end
|
21
|
+
|
22
|
+
def self._load(marshalled)
|
14
23
|
new(Marshal.load(marshalled))
|
15
24
|
end
|
16
25
|
|
@@ -92,6 +101,11 @@ module Fog
|
|
92
101
|
data
|
93
102
|
end
|
94
103
|
|
104
|
+
def load(array)
|
105
|
+
@loaded = true
|
106
|
+
self.clear.concat(array)
|
107
|
+
end
|
108
|
+
|
95
109
|
def model
|
96
110
|
self.class.instance_variable_get('@model')
|
97
111
|
end
|
data/lib/fog/rackspace/bin.rb
CHANGED
data/lib/fog/rackspace/files.rb
CHANGED
@@ -4,12 +4,18 @@ module Fog
|
|
4
4
|
|
5
5
|
def self.dependencies
|
6
6
|
[
|
7
|
+
"fog/rackspace/models/files/directory.rb",
|
8
|
+
"fog/rackspace/models/files/directories.rb",
|
9
|
+
"fog/rackspace/models/files/file.rb",
|
10
|
+
"fog/rackspace/models/files/files.rb",
|
7
11
|
"fog/rackspace/requests/files/delete_container.rb",
|
8
12
|
"fog/rackspace/requests/files/delete_object.rb",
|
9
13
|
"fog/rackspace/requests/files/get_container.rb",
|
10
14
|
"fog/rackspace/requests/files/get_containers.rb",
|
15
|
+
"fog/rackspace/requests/files/get_object.rb",
|
11
16
|
"fog/rackspace/requests/files/head_container.rb",
|
12
17
|
"fog/rackspace/requests/files/head_containers.rb",
|
18
|
+
"fog/rackspace/requests/files/head_object.rb",
|
13
19
|
"fog/rackspace/requests/files/put_container.rb",
|
14
20
|
"fog/rackspace/requests/files/put_object.rb"
|
15
21
|
]
|
@@ -44,12 +50,12 @@ module Fog
|
|
44
50
|
metadata[:body] = data
|
45
51
|
metadata[:headers]['Content-Length'] = metadata[:body].size.to_s
|
46
52
|
else
|
47
|
-
filename = File.basename(data.path)
|
53
|
+
filename = ::File.basename(data.path)
|
48
54
|
unless (mime_types = MIME::Types.of(filename)).empty?
|
49
55
|
metadata[:headers]['Content-Type'] = mime_types.first.content_type
|
50
56
|
end
|
51
57
|
metadata[:body] = data.read
|
52
|
-
metadata[:headers]['Content-Length'] = File.size(data.path).to_s
|
58
|
+
metadata[:headers]['Content-Length'] = ::File.size(data.path).to_s
|
53
59
|
end
|
54
60
|
# metadata[:headers]['Content-MD5'] = Base64.encode64(Digest::MD5.digest(metadata[:body])).strip
|
55
61
|
metadata
|
@@ -75,7 +81,7 @@ module Fog
|
|
75
81
|
response
|
76
82
|
end
|
77
83
|
|
78
|
-
def storage_request(params)
|
84
|
+
def storage_request(params, parse_json = true)
|
79
85
|
@storage_connection = Fog::Connection.new("#{@storage_scheme}://#{@storage_host}:#{@storage_port}")
|
80
86
|
response = @storage_connection.request({
|
81
87
|
:body => params[:body],
|
@@ -89,7 +95,7 @@ module Fog
|
|
89
95
|
:path => "#{@storage_path}/#{params[:path]}",
|
90
96
|
:query => params[:query]
|
91
97
|
})
|
92
|
-
|
98
|
+
if !response.body.empty? && parse_json
|
93
99
|
response.body = JSON.parse(response.body)
|
94
100
|
end
|
95
101
|
response
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Files
|
4
|
+
|
5
|
+
def directories
|
6
|
+
Fog::Rackspace::Files::Directories.new(:connection => self)
|
7
|
+
end
|
8
|
+
|
9
|
+
class Directories < Fog::Collection
|
10
|
+
|
11
|
+
model Fog::Rackspace::Files::Directory
|
12
|
+
|
13
|
+
def all
|
14
|
+
if @loaded
|
15
|
+
clear
|
16
|
+
end
|
17
|
+
@loaded = true
|
18
|
+
data = connection.get_containers.body
|
19
|
+
data.each do |directory|
|
20
|
+
self << new(directory)
|
21
|
+
end
|
22
|
+
self
|
23
|
+
end
|
24
|
+
|
25
|
+
def get(name, options = {})
|
26
|
+
data = connection.get_container(name, options).body
|
27
|
+
directory = new(:name => name)
|
28
|
+
directory.files.merge_attributes(options)
|
29
|
+
directory.files.instance_variable_set(:@loaded, true)
|
30
|
+
data.each do |file|
|
31
|
+
directory.files << directory.files.new(file)
|
32
|
+
end
|
33
|
+
directory
|
34
|
+
rescue Excon::Errors::NotFound
|
35
|
+
nil
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Files
|
4
|
+
|
5
|
+
class Directory < Fog::Model
|
6
|
+
|
7
|
+
identity :name
|
8
|
+
|
9
|
+
attribute :bytes
|
10
|
+
attribute :count
|
11
|
+
|
12
|
+
def destroy
|
13
|
+
requires :name
|
14
|
+
connection.delete_container(@name)
|
15
|
+
true
|
16
|
+
rescue Excon::Errors::NotFound
|
17
|
+
false
|
18
|
+
end
|
19
|
+
|
20
|
+
def files
|
21
|
+
@files ||= begin
|
22
|
+
Fog::Rackspace::Files::Files.new(
|
23
|
+
:directory => self,
|
24
|
+
:connection => connection
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def save
|
30
|
+
requires :name
|
31
|
+
connection.put_container(@name)
|
32
|
+
true
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Files
|
4
|
+
|
5
|
+
class File < Fog::Model
|
6
|
+
|
7
|
+
identity :key, 'Key'
|
8
|
+
|
9
|
+
attribute :body
|
10
|
+
attribute :content_length, 'Content-Length'
|
11
|
+
attribute :content_type, 'Content-Type'
|
12
|
+
attribute :etag, 'Etag'
|
13
|
+
attribute :last_modified, 'Last-Modified'
|
14
|
+
|
15
|
+
def body
|
16
|
+
@body ||= if last_modified
|
17
|
+
collection.get(identity).body
|
18
|
+
else
|
19
|
+
''
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def directory
|
24
|
+
@directory
|
25
|
+
end
|
26
|
+
|
27
|
+
def destroy
|
28
|
+
requires :directory, :key
|
29
|
+
connection.delete_object(directory.name, @key)
|
30
|
+
true
|
31
|
+
end
|
32
|
+
|
33
|
+
def owner=(new_owner)
|
34
|
+
if new_owner
|
35
|
+
@owner = {
|
36
|
+
:display_name => new_owner['DisplayName'],
|
37
|
+
:id => new_owner['ID']
|
38
|
+
}
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def save(options = {})
|
43
|
+
requires :body, :directory, :key
|
44
|
+
data = connection.put_object(directory.name, @key, @body, options)
|
45
|
+
@etag = data.headers['ETag']
|
46
|
+
true
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def directory=(new_directory)
|
52
|
+
@directory = new_directory
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
module Fog
|
2
|
+
module Rackspace
|
3
|
+
class Files
|
4
|
+
|
5
|
+
class Files < Fog::Collection
|
6
|
+
|
7
|
+
attribute :limit
|
8
|
+
attribute :marker
|
9
|
+
attribute :path
|
10
|
+
attribute :prefix
|
11
|
+
|
12
|
+
model Fog::Rackspace::Files::File
|
13
|
+
|
14
|
+
def all(options = {})
|
15
|
+
merge_attributes(options)
|
16
|
+
if @loaded
|
17
|
+
clear
|
18
|
+
end
|
19
|
+
@loaded = true
|
20
|
+
collection = directory.collection.get(
|
21
|
+
directory.name,
|
22
|
+
options
|
23
|
+
)
|
24
|
+
if collection
|
25
|
+
self.replace(collection.files)
|
26
|
+
else
|
27
|
+
nil
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def directory
|
32
|
+
@directory
|
33
|
+
end
|
34
|
+
|
35
|
+
def get(key, options = {}, &block)
|
36
|
+
options = {
|
37
|
+
'limit' => @limit,
|
38
|
+
'marker' => @marker,
|
39
|
+
'path' => @path,
|
40
|
+
'prefix' => @prefix
|
41
|
+
}.merge!(options)
|
42
|
+
data = connection.get_object(directory.name, key, options, &block)
|
43
|
+
file_data = {
|
44
|
+
:body => data.body,
|
45
|
+
:key => key
|
46
|
+
}
|
47
|
+
for key, value in data.headers
|
48
|
+
if ['Content-Length', 'Content-Type', 'ETag', 'Last-Modified'].include?(key)
|
49
|
+
file_data[key] = value
|
50
|
+
end
|
51
|
+
end
|
52
|
+
new(file_data)
|
53
|
+
rescue Excon::Errors::NotFound
|
54
|
+
nil
|
55
|
+
end
|
56
|
+
|
57
|
+
def get_url(key, expires)
|
58
|
+
connection.get_object_url(directory.name, key, expires)
|
59
|
+
end
|
60
|
+
|
61
|
+
def head(key, options = {})
|
62
|
+
data = connection.head_object(directory.name, key, options)
|
63
|
+
file_data = { :key => key }
|
64
|
+
for key, value in data.headers
|
65
|
+
if ['Content-Length', 'Content-Type', 'ETag', 'Last-Modified'].include?(key)
|
66
|
+
file_data[key] = value
|
67
|
+
end
|
68
|
+
end
|
69
|
+
new(file_data)
|
70
|
+
rescue Excon::Errors::NotFound
|
71
|
+
nil
|
72
|
+
end
|
73
|
+
|
74
|
+
def new(attributes = {})
|
75
|
+
super({ :directory => directory }.merge!(attributes))
|
76
|
+
end
|
77
|
+
|
78
|
+
private
|
79
|
+
|
80
|
+
def directory=(new_directory)
|
81
|
+
@directory = new_directory
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -4,7 +4,7 @@ unless Fog.mocking?
|
|
4
4
|
module Rackspace
|
5
5
|
class Files
|
6
6
|
|
7
|
-
#
|
7
|
+
# Get details for container and total bytes stored
|
8
8
|
#
|
9
9
|
# ==== Parameters
|
10
10
|
# * container<~String> - Name of container to retrieve info for
|
@@ -20,6 +20,9 @@ unless Fog.mocking?
|
|
20
20
|
# * 'X-Account-Container-Count'<~String> - Count of containers
|
21
21
|
# * 'X-Account-Bytes-Used'<~String> - Bytes used
|
22
22
|
# * body<~Array>:
|
23
|
+
# * 'bytes'<~Integer> - Number of bytes used by container
|
24
|
+
# * 'count'<~Integer> - Number of items in container
|
25
|
+
# * 'name'<~String> - Name of container
|
23
26
|
# * item<~Hash>:
|
24
27
|
# * 'bytes'<~String> - Size of object
|
25
28
|
# * 'content_type'<~String> Content-Type of object
|
@@ -0,0 +1,41 @@
|
|
1
|
+
unless Fog.mocking?
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Rackspace
|
5
|
+
class Files
|
6
|
+
|
7
|
+
# Get details for object
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# * container<~String> - Name of container to look in
|
11
|
+
# * object<~String> - Name of object to look for
|
12
|
+
#
|
13
|
+
def get_object(container, object, &block)
|
14
|
+
response = storage_request({
|
15
|
+
:block => block,
|
16
|
+
:expects => 200,
|
17
|
+
:method => 'GET',
|
18
|
+
:path => "#{CGI.escape(container)}/#{CGI.escape(object)}"
|
19
|
+
}, false)
|
20
|
+
response
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
else
|
28
|
+
|
29
|
+
module Fog
|
30
|
+
module Rackspace
|
31
|
+
class Servers
|
32
|
+
|
33
|
+
def get_object(container, object)
|
34
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
unless Fog.mocking?
|
2
|
+
|
3
|
+
module Fog
|
4
|
+
module Rackspace
|
5
|
+
class Files
|
6
|
+
|
7
|
+
# Get headers for object
|
8
|
+
#
|
9
|
+
# ==== Parameters
|
10
|
+
# * container<~String> - Name of container to look in
|
11
|
+
# * object<~String> - Name of object to look for
|
12
|
+
#
|
13
|
+
def head_object(container, object)
|
14
|
+
response = storage_request({
|
15
|
+
:expects => 200,
|
16
|
+
:method => 'GET',
|
17
|
+
:path => "#{CGI.escape(container)}/#{CGI.escape(object)}"
|
18
|
+
}, false)
|
19
|
+
response
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
else
|
27
|
+
|
28
|
+
module Fog
|
29
|
+
module Rackspace
|
30
|
+
class Servers
|
31
|
+
|
32
|
+
def head_object(container, object)
|
33
|
+
raise MockNotImplemented.new("Contributions welcome!")
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Files.get_object' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
Rackspace[:files].put_container('container_name')
|
8
|
+
Rackspace[:files].put_object('container_name', 'object_name', lorem_file)
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
Rackspace[:files].delete_object('container_name', 'object_name')
|
13
|
+
Rackspace[:files].delete_container('container_name')
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should return proper attributes" do
|
17
|
+
Rackspace[:files].get_object('container_name', 'object_name')
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
|
+
|
3
|
+
describe 'Rackspace::Files.head_object' do
|
4
|
+
describe 'success' do
|
5
|
+
|
6
|
+
before(:each) do
|
7
|
+
Rackspace[:files].put_container('container_name')
|
8
|
+
Rackspace[:files].put_object('container_name', 'object_name', lorem_file)
|
9
|
+
end
|
10
|
+
|
11
|
+
after(:each) do
|
12
|
+
Rackspace[:files].delete_object('container_name', 'object_name')
|
13
|
+
Rackspace[:files].delete_container('container_name')
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should return proper attributes" do
|
17
|
+
Rackspace[:files].head_object('container_name', 'object_name')
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 47
|
9
|
+
version: 0.0.47
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- geemus (Wesley Beary)
|
@@ -9,69 +14,85 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-03-03 00:00:00 -08:00
|
13
18
|
default_executable: fog
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: excon
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 0
|
30
|
+
- 18
|
23
31
|
version: 0.0.18
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
- !ruby/object:Gem::Dependency
|
26
35
|
name: formatador
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
38
|
requirements:
|
31
39
|
- - ">="
|
32
40
|
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 0
|
43
|
+
- 0
|
44
|
+
- 8
|
33
45
|
version: 0.0.8
|
34
|
-
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
35
48
|
- !ruby/object:Gem::Dependency
|
36
49
|
name: json
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
52
|
requirements:
|
41
53
|
- - ">="
|
42
54
|
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 0
|
43
57
|
version: "0"
|
44
|
-
|
58
|
+
type: :runtime
|
59
|
+
version_requirements: *id003
|
45
60
|
- !ruby/object:Gem::Dependency
|
46
61
|
name: mime-types
|
47
|
-
|
48
|
-
|
49
|
-
version_requirements: !ruby/object:Gem::Requirement
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
50
64
|
requirements:
|
51
65
|
- - ">="
|
52
66
|
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 0
|
53
69
|
version: "0"
|
54
|
-
|
70
|
+
type: :runtime
|
71
|
+
version_requirements: *id004
|
55
72
|
- !ruby/object:Gem::Dependency
|
56
73
|
name: nokogiri
|
57
|
-
|
58
|
-
|
59
|
-
version_requirements: !ruby/object:Gem::Requirement
|
74
|
+
prerelease: false
|
75
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
60
76
|
requirements:
|
61
77
|
- - ">="
|
62
78
|
- !ruby/object:Gem::Version
|
79
|
+
segments:
|
80
|
+
- 0
|
63
81
|
version: "0"
|
64
|
-
|
82
|
+
type: :runtime
|
83
|
+
version_requirements: *id005
|
65
84
|
- !ruby/object:Gem::Dependency
|
66
85
|
name: ruby-hmac
|
67
|
-
|
68
|
-
|
69
|
-
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
prerelease: false
|
87
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
70
88
|
requirements:
|
71
89
|
- - ">="
|
72
90
|
- !ruby/object:Gem::Version
|
91
|
+
segments:
|
92
|
+
- 0
|
73
93
|
version: "0"
|
74
|
-
|
94
|
+
type: :runtime
|
95
|
+
version_requirements: *id006
|
75
96
|
description: brings clouds to you
|
76
97
|
email: me@geemus.com
|
77
98
|
executables:
|
@@ -206,6 +227,10 @@ files:
|
|
206
227
|
- lib/fog/rackspace.rb
|
207
228
|
- lib/fog/rackspace/bin.rb
|
208
229
|
- lib/fog/rackspace/files.rb
|
230
|
+
- lib/fog/rackspace/models/files/directories.rb
|
231
|
+
- lib/fog/rackspace/models/files/directory.rb
|
232
|
+
- lib/fog/rackspace/models/files/file.rb
|
233
|
+
- lib/fog/rackspace/models/files/files.rb
|
209
234
|
- lib/fog/rackspace/models/servers/flavor.rb
|
210
235
|
- lib/fog/rackspace/models/servers/flavors.rb
|
211
236
|
- lib/fog/rackspace/models/servers/image.rb
|
@@ -216,8 +241,10 @@ files:
|
|
216
241
|
- lib/fog/rackspace/requests/files/delete_object.rb
|
217
242
|
- lib/fog/rackspace/requests/files/get_container.rb
|
218
243
|
- lib/fog/rackspace/requests/files/get_containers.rb
|
244
|
+
- lib/fog/rackspace/requests/files/get_object.rb
|
219
245
|
- lib/fog/rackspace/requests/files/head_container.rb
|
220
246
|
- lib/fog/rackspace/requests/files/head_containers.rb
|
247
|
+
- lib/fog/rackspace/requests/files/head_object.rb
|
221
248
|
- lib/fog/rackspace/requests/files/put_container.rb
|
222
249
|
- lib/fog/rackspace/requests/files/put_object.rb
|
223
250
|
- lib/fog/rackspace/requests/servers/create_image.rb
|
@@ -354,8 +381,10 @@ files:
|
|
354
381
|
- spec/rackspace/requests/files/delete_object_spec.rb
|
355
382
|
- spec/rackspace/requests/files/get_container_spec.rb
|
356
383
|
- spec/rackspace/requests/files/get_containers_spec.rb
|
384
|
+
- spec/rackspace/requests/files/get_object_spec.rb
|
357
385
|
- spec/rackspace/requests/files/head_container_spec.rb
|
358
386
|
- spec/rackspace/requests/files/head_containers_spec.rb
|
387
|
+
- spec/rackspace/requests/files/head_object_spec.rb
|
359
388
|
- spec/rackspace/requests/files/put_container_spec.rb
|
360
389
|
- spec/rackspace/requests/files/put_object_spec.rb
|
361
390
|
- spec/rackspace/requests/servers/create_image_spec.rb
|
@@ -438,18 +467,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
438
467
|
requirements:
|
439
468
|
- - ">="
|
440
469
|
- !ruby/object:Gem::Version
|
470
|
+
segments:
|
471
|
+
- 0
|
441
472
|
version: "0"
|
442
|
-
version:
|
443
473
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
444
474
|
requirements:
|
445
475
|
- - ">="
|
446
476
|
- !ruby/object:Gem::Version
|
477
|
+
segments:
|
478
|
+
- 0
|
447
479
|
version: "0"
|
448
|
-
version:
|
449
480
|
requirements: []
|
450
481
|
|
451
482
|
rubyforge_project: fog
|
452
|
-
rubygems_version: 1.3.
|
483
|
+
rubygems_version: 1.3.6
|
453
484
|
signing_key:
|
454
485
|
specification_version: 3
|
455
486
|
summary: fog = clouds + you
|
@@ -529,8 +560,10 @@ test_files:
|
|
529
560
|
- spec/rackspace/requests/files/delete_object_spec.rb
|
530
561
|
- spec/rackspace/requests/files/get_container_spec.rb
|
531
562
|
- spec/rackspace/requests/files/get_containers_spec.rb
|
563
|
+
- spec/rackspace/requests/files/get_object_spec.rb
|
532
564
|
- spec/rackspace/requests/files/head_container_spec.rb
|
533
565
|
- spec/rackspace/requests/files/head_containers_spec.rb
|
566
|
+
- spec/rackspace/requests/files/head_object_spec.rb
|
534
567
|
- spec/rackspace/requests/files/put_container_spec.rb
|
535
568
|
- spec/rackspace/requests/files/put_object_spec.rb
|
536
569
|
- spec/rackspace/requests/servers/create_image_spec.rb
|