fog-softlayer 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NzZiNjM4OTRiOTgzZjcxOWRjYjFkM2ZlYjE2NDIzMTExMmJlZWM4Ng==
4
+ MmM2YjQyOGY4OTJhMGQxM2Y2NjMxOWM3OTI4MmQ4ZmQ1YWQ5YTVhZQ==
5
5
  data.tar.gz: !binary |-
6
- ODI1MzFhZTI5ODAyNjU1YmMzM2JiMWM0M2UwYzg0MzUxMzhkNjBmMw==
6
+ ZTI0NzU5MzQ3OWNjYTliZmRlYzFiZjU5ZDc5NjEwYzBmNTFmYjVjNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjI1MTNlYjM2NmI1ZjU2YmUxMjY2MzVmMTNlMjA0YjMwMDZhZDBjZWEyODAw
10
- YTU1Y2M4ZGZjNmQ5M2NmZGJjNmMxZTczMDAwZGQ5ZTQzNGU2MjNiNzdjYjc5
11
- YTE2OWFkMzRmMmExNmQxNDI0MTA2MzZmMGUwY2JkYmU0Y2E4MWU=
9
+ ZWQ5ZmEzOGM0YTA0N2M2ZDVjYzE5ODMyM2ZmZmI3MTA0YzFlNjc5NTdiYzVh
10
+ MTcyZmYxYWE4YzZmNTQ3MGZmMjg1ZDU1ZGEwNzhhYzUxNWIzZTViNTY5MjI1
11
+ MDhmMjEzMmE1Y2Y4NmNiZTM5MjlkMWFhMzI5YWZiMGRjYzY1ODY=
12
12
  data.tar.gz: !binary |-
13
- MWI1OTMxNWEyNWU4N2M5ZDVkYzBmNjhhZmIxYzU1M2NkOGJhNjc3NDRjODVh
14
- N2VmMzAwZDQ0NzEwOTdlOTlmYzA5NWY1MWMwMzgxMWJkYmVhNjhlNzg2MmNm
15
- MmE1MjQxMGVjMDA4YzFmZjgyMTQyYjRlYjBkOTk0NDVmNTc1M2E=
13
+ N2YxYmE2OWQ4Yzg2NDY4MGFmYTM0NmQwYjc4ZGQ2ODk5N2RkMGFlZDNjOTRl
14
+ YjJkNDQxMmE3ZTNhMWRlNmVlOWUzOGU4MWQ0NGQxYjhmNjBlYWMwMThhYzRi
15
+ NjIzNTM3Y2M5MmUxOTdkZDQ5MTYxNDE0ODBmOWM3ODQyOTZkYTU=
@@ -23,11 +23,10 @@ module Fog
23
23
  def get(key, options = {})
24
24
  data = service.get_container(key, options)
25
25
  directory = new(:key => key)
26
- for key, value in data.headers
27
- if ['X-Container-Bytes-Used', 'X-Container-Object-Count'].include?(key)
28
- directory.merge_attributes(key => value)
29
- end
26
+ keep_headers = data.headers.select do |k,v|
27
+ ['X-Container-Bytes-Used', 'X-Container-Object-Count', 'X-Container-Read'].include?(k)
30
28
  end
29
+ directory.merge_attributes(keep_headers)
31
30
  directory.files.merge_attributes(options)
32
31
  directory.files.instance_variable_set(:@loaded, true)
33
32
 
@@ -15,9 +15,9 @@ module Fog
15
15
 
16
16
  identity :key, :aliases => 'name'
17
17
 
18
- attribute :bytes, :aliases => 'X-Container-Bytes-Used'
19
- attribute :count, :aliases => 'X-Container-Object-Count'
20
- attribute :public, :aliases => 'X-Container-Read'
18
+ attribute :bytes, :aliases => 'X-Container-Bytes-Used'
19
+ attribute :count, :aliases => 'X-Container-Object-Count'
20
+ attribute :public, :aliases => 'X-Container-Read'
21
21
 
22
22
  def destroy
23
23
  requires :key
@@ -37,16 +37,21 @@ module Fog
37
37
  end
38
38
 
39
39
  def public=(new_public)
40
- @public = new_public
40
+ attributes[:public] = new_public
41
41
  end
42
42
 
43
+ def public
44
+ !!attributes[:public]
45
+ end
46
+ alias_method :public?, :public
47
+
43
48
  def public_url
44
49
  raise NotImplementedError
45
50
  end
46
51
 
47
52
  def save
48
53
  requires :key
49
- service.put_container(key, @public)
54
+ service.put_container(key, public)
50
55
  true
51
56
  end
52
57
 
@@ -7,6 +7,6 @@
7
7
 
8
8
  module Fog
9
9
  module Softlayer
10
- VERSION = "0.4.4"
10
+ VERSION = "0.4.5"
11
11
  end
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-softlayer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Eldridge