fog-google 1.0.1 → 1.1.0
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 +4 -4
- data/lib/fog/google/version.rb +1 -1
- data/lib/fog/storage/google_json/models/directories.rb +5 -4
- data/lib/fog/storage/google_json/models/files.rb +1 -0
- data/lib/fog/storage/google_json/requests/get_object.rb +10 -5
- data/lib/fog/storage/google_xml/models/directories.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28b820a5dc7b807feb4752b1fbb3f6e90f05c612
|
4
|
+
data.tar.gz: 96049683a48c63bdcd071a63bf93ceb0638374b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 108ae3707ddb9ba0c96eba2ed16246911b7ccea06a8801a6f87ae59e53361d03baed08f64e1649c7787d74560a910820a8e978e00d9610b5f38e943d2531e13c
|
7
|
+
data.tar.gz: 0c9e5ef0a46e80d978c81f4ebf80f26ae6166b5ba43a902b087dc97c788153380cfff19f17970d89238254e6dd714b3a322501a991a8d7c8699d3afc9709e68e
|
data/lib/fog/google/version.rb
CHANGED
@@ -9,10 +9,11 @@ module Fog
|
|
9
9
|
load(data)
|
10
10
|
end
|
11
11
|
|
12
|
-
def get(bucket_name,
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
def get(bucket_name, options = {})
|
13
|
+
if_metageneration_match = options[:if_metageneration_match]
|
14
|
+
if_metageneration_not_match = options[:if_metageneration_not_match]
|
15
|
+
projection = options[:projection]
|
16
|
+
|
16
17
|
data = service.get_bucket(
|
17
18
|
bucket_name,
|
18
19
|
:if_metageneration_match => if_metageneration_match,
|
@@ -23,6 +23,9 @@ module Fog
|
|
23
23
|
# Set of properties to return
|
24
24
|
# @param options [Hash]
|
25
25
|
# Request-specific options
|
26
|
+
# @param &block [Proc]
|
27
|
+
# Block to pass a streamed object response to. Expected format is
|
28
|
+
# same as Excon :response_block ({ |chunk, remaining_bytes, total_bytes| ... })
|
26
29
|
# @return [Hash] Object metadata with :body attribute set to contents of object
|
27
30
|
def get_object(bucket_name, object_name,
|
28
31
|
generation: nil,
|
@@ -31,12 +34,10 @@ module Fog
|
|
31
34
|
if_metageneration_match: nil,
|
32
35
|
if_metageneration_not_match: nil,
|
33
36
|
projection: nil,
|
34
|
-
**options)
|
37
|
+
**options, &_block)
|
35
38
|
raise ArgumentError.new("bucket_name is required") unless bucket_name
|
36
39
|
raise ArgumentError.new("object_name is required") unless object_name
|
37
40
|
|
38
|
-
# The previous semantics require returning the content of the request
|
39
|
-
# rather than taking a filename to populate. Hence, tempfile.
|
40
41
|
buf = Tempfile.new("fog-google-storage-temp")
|
41
42
|
|
42
43
|
# Two requests are necessary, first for metadata, then for content.
|
@@ -59,8 +60,12 @@ module Fog
|
|
59
60
|
all_opts.merge(:download_dest => buf.path)
|
60
61
|
)
|
61
62
|
|
62
|
-
|
63
|
-
|
63
|
+
if block_given?
|
64
|
+
yield buf.read, nil, nil
|
65
|
+
else
|
66
|
+
object[:body] = buf.read
|
67
|
+
buf.unlink
|
68
|
+
end
|
64
69
|
|
65
70
|
object
|
66
71
|
end
|
@@ -17,7 +17,7 @@ module Fog
|
|
17
17
|
data = service.get_bucket(key, options).body
|
18
18
|
directory = new(:key => data["Name"])
|
19
19
|
options = {}
|
20
|
-
|
20
|
+
data.each_pair do |k, v|
|
21
21
|
if %w(CommonPrefixes Delimiter IsTruncated Marker MaxKeys Prefix).include?(k)
|
22
22
|
options[k] = v
|
23
23
|
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: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nat Welch
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-01-
|
12
|
+
date: 2018-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fog-core
|