fog-google 1.0.0 → 1.0.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edc956d3013b64f9bb12fbfa42a54b90c8887a31
|
4
|
+
data.tar.gz: 032f27be0769facdb9e12681225e980c9a40e180
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
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
|
|
data/fog-google.gemspec
CHANGED
@@ -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", "
|
9
|
-
spec.email = ["nat@natwelch.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? :
|
206
|
-
addresses = network_interfaces.
|
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] }
|
data/lib/fog/google/version.rb
CHANGED
@@ -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.
|
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-
|
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: []
|