fog 0.0.80 → 0.0.81
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.
- data/fog.gemspec +2 -2
- data/lib/fog.rb +1 -1
- data/lib/fog/aws/models/ec2/volume.rb +8 -0
- data/lib/fog/aws/models/s3/files.rb +1 -4
- data/spec/spec_helper.rb +4 -1
- metadata +3 -3
data/fog.gemspec
CHANGED
@@ -7,8 +7,8 @@ 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.0.
|
11
|
-
s.date = '2010-04-
|
10
|
+
s.version = '0.0.81'
|
11
|
+
s.date = '2010-04-27'
|
12
12
|
s.rubyforge_project = 'fog'
|
13
13
|
|
14
14
|
## Make sure your summary is short. The description may be as long
|
data/lib/fog.rb
CHANGED
@@ -20,6 +20,8 @@ module Fog
|
|
20
20
|
attribute :state, 'status'
|
21
21
|
|
22
22
|
def initialize(attributes = {})
|
23
|
+
# assign server first to prevent race condition with new_record?
|
24
|
+
self.server = attributes.delete(:server)
|
23
25
|
if attributes['attachmentSet']
|
24
26
|
attributes.merge!(attributes.delete('attachmentSet').first || {})
|
25
27
|
end
|
@@ -33,6 +35,10 @@ module Fog
|
|
33
35
|
true
|
34
36
|
end
|
35
37
|
|
38
|
+
def ready?
|
39
|
+
state == 'available'
|
40
|
+
end
|
41
|
+
|
36
42
|
def server=(new_server)
|
37
43
|
if new_server
|
38
44
|
attach(new_server)
|
@@ -70,6 +76,7 @@ module Fog
|
|
70
76
|
@server = nil
|
71
77
|
@server_id = new_server.id
|
72
78
|
connection.attach_volume(@server_id, @id, @device)
|
79
|
+
reload
|
73
80
|
end
|
74
81
|
end
|
75
82
|
|
@@ -78,6 +85,7 @@ module Fog
|
|
78
85
|
@server_id = nil
|
79
86
|
unless new_record?
|
80
87
|
connection.detach_volume(@id)
|
88
|
+
reload
|
81
89
|
end
|
82
90
|
end
|
83
91
|
|
@@ -8,6 +8,7 @@ module Fog
|
|
8
8
|
class Files < Fog::Collection
|
9
9
|
|
10
10
|
attribute :delimiter, 'Delimiter'
|
11
|
+
attribute :directory
|
11
12
|
attribute :is_truncated, 'IsTruncated'
|
12
13
|
attribute :marker, 'Marker'
|
13
14
|
attribute :max_keys, ['MaxKeys', 'max-keys']
|
@@ -35,10 +36,6 @@ module Fog
|
|
35
36
|
end
|
36
37
|
end
|
37
38
|
|
38
|
-
def directory
|
39
|
-
@directory
|
40
|
-
end
|
41
|
-
|
42
39
|
def get(key, options = {}, &block)
|
43
40
|
data = connection.get_object(directory.name, key, options, &block)
|
44
41
|
file_data = {
|
data/spec/spec_helper.rb
CHANGED
@@ -4,7 +4,10 @@ require 'open-uri'
|
|
4
4
|
current_directory = File.dirname(__FILE__)
|
5
5
|
require "#{current_directory}/../lib/fog"
|
6
6
|
require "#{current_directory}/../lib/fog/bin"
|
7
|
-
|
7
|
+
|
8
|
+
if ENV["FOG_MOCK"] == "true"
|
9
|
+
Fog.mock!
|
10
|
+
end
|
8
11
|
|
9
12
|
unless defined?(LOADED_SPEC_OPTS)
|
10
13
|
# inlined spec.opts
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 81
|
9
|
+
version: 0.0.81
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- geemus (Wesley Beary)
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-04-
|
17
|
+
date: 2010-04-27 00:00:00 -07:00
|
18
18
|
default_executable: fog
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|