fog-google 1.0.0 → 1.0.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4fa59c3a8e64b4d0f7906e8000166d103f911c40
4
- data.tar.gz: 8d36d48ed04b7025fe4c29b620979b61924ec6ed
3
+ metadata.gz: edc956d3013b64f9bb12fbfa42a54b90c8887a31
4
+ data.tar.gz: 032f27be0769facdb9e12681225e980c9a40e180
5
5
  SHA512:
6
- metadata.gz: 247a59498aef0aff1f7ec983f5662cff88d9916f6d086e47bb8799e5e258888430d040e780a096e2de65d02aed8b3c9c43ab4cab2d7456110b12445401d897e2
7
- data.tar.gz: 62c69343e5b0b47162704319c9f3d8005070942f6a68d93514f6c3dec244818c848afb81da45384400dcf783b17ab06f7f6d3857bf1ac9a56dcf73091897b532
6
+ metadata.gz: fc35669ae2d7eae55a81a119ad69194e9d22893fd73df394ef94443c72c5185b1065046ddbbc6097abe563b727cc63bfa65c80510d4eccf53c0af2a6e528e566
7
+ data.tar.gz: 2fab2b57c38cf4eebfedf33f01ddd29a98c0978c01c0bb48d8951d7290cfaf36423bc757eae75bc43d81803eaf8928609de7ceca0920636f8243cfaca19fe203
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Fog::Google
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/fog-google.svg)](http://badge.fury.io/rb/fog-google) [![Build Status](https://travis-ci.org/fog/fog-google.svg?branch=master)](https://travis-ci.org/fog/fog-google) [![Dependency Status](https://gemnasium.com/fog/fog-google.svg)](https://gemnasium.com/fog/fog-google) [![Coverage Status](https://img.shields.io/coveralls/fog/fog-google.svg)](https://coveralls.io/r/fog/fog-google) [![Code Climate](https://codeclimate.com/github/fog/fog-google.png)](https://codeclimate.com/github/fog/fog-google) [![Stories in Ready](https://badge.waffle.io/fog/fog-google.png?label=ready&title=Ready)](https://waffle.io/fog/fog-google)
3
+ [![Gem Version](https://badge.fury.io/rb/fog-google.svg)](http://badge.fury.io/rb/fog-google) [![Build Status](https://travis-ci.org/fog/fog-google.svg?branch=master)](https://travis-ci.org/fog/fog-google) [![Dependency Status](https://gemnasium.com/fog/fog-google.svg)](https://gemnasium.com/fog/fog-google) [![Coverage Status](https://img.shields.io/coveralls/fog/fog-google.svg)](https://coveralls.io/r/fog/fog-google) [![Code Climate](https://codeclimate.com/github/fog/fog-google.png)](https://codeclimate.com/github/fog/fog-google)
4
4
 
5
5
  The main maintainers for the Google sections are @icco, @Temikus and @plribeiro3000. Please send pull requests to them.
6
6
 
@@ -5,8 +5,8 @@ require "fog/google/version"
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fog-google"
7
7
  spec.version = Fog::Google::VERSION
8
- spec.authors = ["Nat Welch", "Isaac Hollander McCreery", "Artem Yakimenko"]
9
- spec.email = ["nat@natwelch.com", "ihmccreery@google.com", "temikus@google.com"]
8
+ spec.authors = ["Nat Welch", "Artem Yakimenko"]
9
+ spec.email = ["nat@natwelch.com", "temikus@google.com"]
10
10
  spec.summary = "Module for the 'fog' gem to support Google."
11
11
  spec.description = "This library can be used as a module for `fog` or as standalone provider to use the Google Cloud in applications."
12
12
  spec.homepage = "https://github.com/fog/fog-google"
@@ -202,8 +202,8 @@ module Fog
202
202
 
203
203
  def public_ip_addresses
204
204
  addresses = []
205
- if network_interfaces.respond_to? :flatMap
206
- addresses = network_interfaces.flatMap do |nic|
205
+ if network_interfaces.respond_to? :flat_map
206
+ addresses = network_interfaces.flat_map do |nic|
207
207
  if nic[:access_configs].respond_to? :each
208
208
  nic[:access_configs].select { |config| config[:name] == "External NAT" }
209
209
  .map { |config| config[:nat_ip] }
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Google
3
- VERSION = "1.0.0".freeze
3
+ VERSION = "1.0.1".freeze
4
4
  end
5
5
  end
@@ -52,12 +52,15 @@ module Fog
52
52
  options[:content_type] = "text/plain"
53
53
  elsif data.is_a?(::File)
54
54
  options[:content_type] = Fog::Storage.parse_data(data)[:headers]["Content-Type"]
55
- elsif data.respond_to?(:content_type) && data.respond_to?(:path)
56
- options[:content_type] = data.content_type
57
- data = data.path
58
55
  end
59
56
  end
60
57
 
58
+ # Paperclip::AbstractAdapter
59
+ if data.respond_to?(:content_type) && data.respond_to?(:path)
60
+ options[:content_type] ||= data.content_type
61
+ data = data.path
62
+ end
63
+
61
64
  object_config = ::Google::Apis::StorageV1::Object.new(
62
65
  options.merge(:name => object_name)
63
66
  )
@@ -29,7 +29,19 @@ class TestStorageRequests < StorageShared
29
29
  object_name = new_object_name
30
30
  paperclip_file = OpenStruct.new(:path => some_temp_file,
31
31
  :content_type => "image/png")
32
- @client.put_object(some_bucket_name, object_name, paperclip_file)
32
+ @client.put_object(some_bucket_name, object_name, paperclip_file, :content_type => "image/png")
33
+
34
+ object = @client.get_object(some_bucket_name, object_name)
35
+
36
+ assert_equal(object_name, object[:name])
37
+ assert_equal("image/png", object[:content_type])
38
+ end
39
+
40
+ def test_put_object_contradictory_content_type
41
+ object_name = new_object_name
42
+ file = OpenStruct.new(:path => some_temp_file,
43
+ :content_type => "text/plain")
44
+ @client.put_object(some_bucket_name, object_name, file, :content_type => "image/png")
33
45
 
34
46
  object = @client.get_object(some_bucket_name, object_name)
35
47
 
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nat Welch
8
- - Isaac Hollander McCreery
9
8
  - Artem Yakimenko
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2018-01-06 00:00:00.000000000 Z
12
+ date: 2018-01-12 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: fog-core
@@ -198,7 +197,6 @@ description: This library can be used as a module for `fog` or as standalone pro
198
197
  to use the Google Cloud in applications.
199
198
  email:
200
199
  - nat@natwelch.com
201
- - ihmccreery@google.com
202
200
  - temikus@google.com
203
201
  executables: []
204
202
  extensions: []