fog 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/Gemfile.lock +3 -3
- data/fog.gemspec +2 -2
- data/lib/fog.rb +1 -1
- data/lib/fog/attributes.rb +49 -4
- data/lib/fog/aws/models/s3/directories.rb +3 -3
- data/lib/fog/vcloud/collection.rb +8 -1
- data/spec/aws/models/ec2/volume_spec.rb +1 -1
- metadata +3 -3
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
shindo:
|
40
40
|
group:
|
41
41
|
- :default
|
42
|
-
version: ">= 0.1.
|
42
|
+
version: ">= 0.1.6"
|
43
43
|
nokogiri:
|
44
44
|
group:
|
45
45
|
- :default
|
@@ -68,8 +68,8 @@ specs:
|
|
68
68
|
- ruby-hmac:
|
69
69
|
version: 0.4.0
|
70
70
|
- shindo:
|
71
|
-
version: 0.1.
|
72
|
-
hash:
|
71
|
+
version: 0.1.6
|
72
|
+
hash: 83b7c53965ec61f532d9a504fcd8f5f67a285293
|
73
73
|
sources:
|
74
74
|
- Rubygems:
|
75
75
|
uri: http://gemcutter.org
|
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.1.
|
11
|
-
s.date = '2010-06-
|
10
|
+
s.version = '0.1.10'
|
11
|
+
s.date = '2010-06-18'
|
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
data/lib/fog/attributes.rb
CHANGED
@@ -14,14 +14,59 @@ module Fog
|
|
14
14
|
@attributes ||= []
|
15
15
|
end
|
16
16
|
|
17
|
-
def attribute(name,
|
17
|
+
def attribute(name, options = {})
|
18
|
+
# FIXME: handle legacy where options would have been one or more aliases
|
19
|
+
if !options.is_a?(Hash)
|
20
|
+
options = {:aliases => options}
|
21
|
+
end
|
18
22
|
class_eval <<-EOS, __FILE__, __LINE__
|
19
|
-
|
23
|
+
attr_reader :#{name}
|
20
24
|
EOS
|
25
|
+
case options[:type]
|
26
|
+
when :boolean
|
27
|
+
class_eval <<-EOS, __FILE__, __LINE__
|
28
|
+
def #{name}=(new_#{name})
|
29
|
+
@#{name} = case new_#{name}
|
30
|
+
when 'true'
|
31
|
+
true
|
32
|
+
when 'false'
|
33
|
+
false
|
34
|
+
end
|
35
|
+
end
|
36
|
+
EOS
|
37
|
+
when :float
|
38
|
+
class_eval <<-EOS, __FILE__, __LINE__
|
39
|
+
def #{name}=(new_#{name})
|
40
|
+
@#{name} = new_#{name}.to_f
|
41
|
+
end
|
42
|
+
EOS
|
43
|
+
when :integer
|
44
|
+
class_eval <<-EOS, __FILE__, __LINE__
|
45
|
+
def #{name}=(new_#{name})
|
46
|
+
@#{name} = new_#{name}.to_i
|
47
|
+
end
|
48
|
+
EOS
|
49
|
+
when :string
|
50
|
+
class_eval <<-EOS, __FILE__, __LINE__
|
51
|
+
def #{name}=(new_#{name})
|
52
|
+
@#{name} = new_#{name}.to_s
|
53
|
+
end
|
54
|
+
EOS
|
55
|
+
when :time
|
56
|
+
class_eval <<-EOS, __FILE__, __LINE__
|
57
|
+
def #{name}=(new_#{name})
|
58
|
+
@#{name} = Time.parse(new_#{name})
|
59
|
+
end
|
60
|
+
EOS
|
61
|
+
else
|
62
|
+
class_eval <<-EOS, __FILE__, __LINE__
|
63
|
+
attr_writer :#{name}
|
64
|
+
EOS
|
65
|
+
end
|
21
66
|
@attributes ||= []
|
22
67
|
@attributes |= [name]
|
23
|
-
for
|
24
|
-
aliases[
|
68
|
+
for new_alias in [*options[:aliases]]
|
69
|
+
aliases[new_alias] = name
|
25
70
|
end
|
26
71
|
end
|
27
72
|
|
@@ -30,9 +30,9 @@ module Fog
|
|
30
30
|
data = connection.get_bucket(key, options).body
|
31
31
|
directory = new(:key => data['Name'])
|
32
32
|
options = {}
|
33
|
-
for
|
34
|
-
if ['Delimiter', 'IsTruncated', 'Marker', 'MaxKeys', 'Prefix'].include?(
|
35
|
-
options[
|
33
|
+
for k, v in data
|
34
|
+
if ['Delimiter', 'IsTruncated', 'Marker', 'MaxKeys', 'Prefix'].include?(k)
|
35
|
+
options[k] = v
|
36
36
|
end
|
37
37
|
end
|
38
38
|
directory.files.merge_attributes(options)
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 10
|
9
|
+
version: 0.1.10
|
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-06-
|
17
|
+
date: 2010-06-18 00:00:00 -07:00
|
18
18
|
default_executable: fog
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|