fog-google 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10a8ac12072ce29979f949f17a52e6abe869066a
4
- data.tar.gz: 2b605bd25340566ef987a53dd4630af3d04cddb0
3
+ metadata.gz: 8446093e082c66eef56e836309220b6d9286d3a3
4
+ data.tar.gz: bfbb2e99cdff1dec622f041f0474861d568f37d0
5
5
  SHA512:
6
- metadata.gz: a01b577b14ecf8c6393a2736f846e1057adefebbdae28ce999ca50868a03d2edd71d7e2363ec7c9dca30b137a64926eb3686bd9ad9c939385d27b9e1c81d4884
7
- data.tar.gz: e3945cdfa27edeff1badc22cf32cb43dd68fbeb159673e83684e4dc539dd6a4af2f3aeca453b5fb64741c0903b18d40854dfc6b05c9c4eab348e2684dba64461
6
+ metadata.gz: e2b1c40fca99b4183a6df547c01b2d2a36b63cad9b6054628814b2eb1f59f32664eb233b5648431beeb4ce2fe770415d615256e7d43d7ab869d2a67e6674552d
7
+ data.tar.gz: 363821f9cc17f831ec240d02cc7d022b02310354fcaeaf6d3bd155ba3ee4f64d0d25b1f179d303fd154e0c35e04c9829322a82573471739aa5014ae9b6d3d6f0
data/.rubocop.yml CHANGED
@@ -4,6 +4,7 @@ Metrics/LineLength:
4
4
 
5
5
  Style/ConditionalAssignment:
6
6
  SingleLineConditionsOnly: true
7
+ EnforcedStyle: assign_inside_condition
7
8
 
8
9
  Style/Encoding:
9
10
  EnforcedStyle: when_needed
@@ -28,6 +29,7 @@ AllCops:
28
29
  - "vendor/**/*"
29
30
  - "db/schema.rb"
30
31
  UseCache: false
32
+ TargetRubyVersion: 2.1
31
33
  Style/CollectionMethods:
32
34
  Description: Preferred collection methods.
33
35
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size
@@ -42,7 +44,7 @@ Style/DotPosition:
42
44
  Description: Checks the position of the dot in multi-line method calls.
43
45
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
44
46
  Enabled: true
45
- EnforcedStyle: trailing
47
+ EnforcedStyle: leading
46
48
  SupportedStyles:
47
49
  - leading
48
50
  - trailing
@@ -183,7 +185,7 @@ Lint/AssignmentInCondition:
183
185
  AllowSafeAssignment: true
184
186
  Style/InlineComment:
185
187
  Description: Avoid inline comments.
186
- Enabled: false
188
+ Enabled: true
187
189
  Style/AccessorMethodName:
188
190
  Description: Check the naming of accessor methods for get_/set_.
189
191
  Enabled: false
@@ -9,7 +9,7 @@ module Fog
9
9
  next_page_token = nil
10
10
  loop do
11
11
  data = service.list_snapshots(nil, next_page_token)
12
- items.concat(data.body["items"])
12
+ items.concat(data.body["items"]) unless data.body["items"].nil?
13
13
  next_page_token = data.body["nextPageToken"]
14
14
  break if next_page_token.nil? || next_page_token.empty?
15
15
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Google
3
- VERSION = "0.5.3".freeze
3
+ VERSION = "0.5.4".freeze
4
4
  end
5
5
  end
@@ -17,7 +17,8 @@ module Fog
17
17
  def all(options = {})
18
18
  requires :directory
19
19
 
20
- load(service.list_objects(directory.key, options)[:body]["items"])
20
+ body = service.list_objects(directory.key, options).body
21
+ load(body["items"] || [])
21
22
  end
22
23
 
23
24
  alias_method :each_file_this_page, :each
@@ -40,8 +41,8 @@ module Fog
40
41
  data.headers.each do |k, v|
41
42
  file_data[k] = v
42
43
  end
43
- file_data.merge!(:body => data.body,
44
- :key => key)
44
+ file_data[:body] = data.body
45
+ file_data[:key] = key
45
46
  new(file_data)
46
47
  rescue Fog::Errors::NotFound
47
48
  nil
@@ -0,0 +1,21 @@
1
+ require "helpers/integration_test_helper"
2
+ require "securerandom"
3
+ require "base64"
4
+
5
+ class TestComputeSnapshots < FogIntegrationTest
6
+ def setup
7
+ @client = Fog::Compute::Google.new
8
+ # Ensure any resources we create with test prefixes are removed
9
+ Minitest.after_run do
10
+ delete_test_resources
11
+ end
12
+ end
13
+
14
+ def test_list_empty_snapshots
15
+ assert_empty @client.snapshots.all
16
+ end
17
+
18
+ def delete_test_resources
19
+ # nothing to do
20
+ end
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nat Welch
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-06-02 00:00:00.000000000 Z
14
+ date: 2017-08-29 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fog-core
@@ -617,6 +617,7 @@ files:
617
617
  - test/integration/compute/test_images.rb
618
618
  - test/integration/compute/test_regions.rb
619
619
  - test/integration/compute/test_servers.rb
620
+ - test/integration/compute/test_snapshots.rb
620
621
  - test/integration/compute/test_target_http_proxies.rb
621
622
  - test/integration/compute/test_target_instances.rb
622
623
  - test/integration/compute/test_target_pools.rb
@@ -748,6 +749,7 @@ test_files:
748
749
  - test/integration/compute/test_images.rb
749
750
  - test/integration/compute/test_regions.rb
750
751
  - test/integration/compute/test_servers.rb
752
+ - test/integration/compute/test_snapshots.rb
751
753
  - test/integration/compute/test_target_http_proxies.rb
752
754
  - test/integration/compute/test_target_instances.rb
753
755
  - test/integration/compute/test_target_pools.rb