fog-google 0.4.1 → 0.4.2
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/.travis.yml +1 -1
- data/README.md +16 -3
- data/lib/fog/google/requests/pubsub/create_subscription.rb +2 -3
- data/lib/fog/google/version.rb +1 -1
- data/lib/fog/storage/google_json.rb +1 -0
- data/lib/fog/storage/google_json/models/file.rb +1 -1
- data/lib/fog/storage/google_json/models/files.rb +2 -16
- data/lib/fog/storage/google_json/requests/list_objects.rb +50 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60125d11954dd919a8685781db294ef96edcc0fc
|
4
|
+
data.tar.gz: 7df579f5e21c306d18112e12bad9e038b6a92b75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 365da53d78669fe0d8c9d50fe81b10a9cf759152ea11b282ec452e15d7a292360b35f36b187df9a5dc0e47255886a8c8a954d521ad05991371c9189e711d165d
|
7
|
+
data.tar.gz: a2e8e2812ee8f084805858eee655d89ba10400e3c8585e3066dfbce7b4fc8ea1286c28cd8ac65095ebf4df86ff32dd9564bb5924fceb1a00536b0d78e99b1176
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -60,7 +60,7 @@ Or install it yourself as:
|
|
60
60
|
$ gem install fog-google
|
61
61
|
```
|
62
62
|
|
63
|
-
|
63
|
+
## Setup
|
64
64
|
|
65
65
|
#### Credentials
|
66
66
|
|
@@ -83,10 +83,23 @@ my_credentials:
|
|
83
83
|
google_storage_secret_access_key: XXXX+XXX/XXXXXXXX+XXXXXXXXXXXXXXXXXXXXX
|
84
84
|
```
|
85
85
|
|
86
|
-
|
87
86
|
#### SSH-ing into instances
|
88
87
|
|
89
|
-
If you want to be able to bootstrap SSH-able instances, (using `servers.bootstrap`,) be sure you have a key in `~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub
|
88
|
+
If you want to be able to bootstrap SSH-able instances, (using `servers.bootstrap`,) be sure you have a key in `~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub`
|
89
|
+
|
90
|
+
## Quickstart
|
91
|
+
|
92
|
+
Once you've specified your credentials, you should be good to go!
|
93
|
+
```
|
94
|
+
λ bundle exec pry
|
95
|
+
[1] pry(main)> require 'fog/google'
|
96
|
+
=> true
|
97
|
+
[2] pry(main)> connection = Fog::Compute::Google.new
|
98
|
+
[3] pry(main)> connection.servers
|
99
|
+
=> [ <Fog::Compute::Google::Server
|
100
|
+
name="xxxxxxx",
|
101
|
+
kind="compute#instance",
|
102
|
+
```
|
90
103
|
|
91
104
|
## Contributing
|
92
105
|
|
@@ -26,9 +26,8 @@ module Fog
|
|
26
26
|
"topic" => (topic.is_a?(Topic) ? topic.name : topic.to_s)
|
27
27
|
}
|
28
28
|
|
29
|
-
|
30
|
-
body["pushConfig"] = push_config
|
31
|
-
body["pushConfig"]["attributes"] = push_config["attributes"] if push_config.key?("attributes")
|
29
|
+
unless push_config.empty?
|
30
|
+
body["pushConfig"] = push_config
|
32
31
|
end
|
33
32
|
|
34
33
|
body["ackDeadlineSeconds"] = ack_deadline_seconds unless ack_deadline_seconds.nil?
|
data/lib/fog/google/version.rb
CHANGED
@@ -16,22 +16,8 @@ module Fog
|
|
16
16
|
|
17
17
|
def all(options = {})
|
18
18
|
requires :directory
|
19
|
-
|
20
|
-
|
21
|
-
"pageToken" => page_token,
|
22
|
-
"maxResults" => max_results,
|
23
|
-
"prefix" => prefix
|
24
|
-
}.merge!(options)
|
25
|
-
options = options.reject { |_key, value| value.nil? || value.to_s.empty? }
|
26
|
-
merge_attributes(options)
|
27
|
-
parent = directory.collection.get(
|
28
|
-
directory.key,
|
29
|
-
options
|
30
|
-
)
|
31
|
-
if parent
|
32
|
-
merge_attributes(parent.files.attributes)
|
33
|
-
load(parent.files.map(&:attributes))
|
34
|
-
end
|
19
|
+
|
20
|
+
load(service.list_objects(directory.key, options)[:body]["items"])
|
35
21
|
end
|
36
22
|
|
37
23
|
alias_method :each_file_this_page, :each
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Fog
|
2
|
+
module Storage
|
3
|
+
class GoogleJSON
|
4
|
+
class Real
|
5
|
+
# Lists objects in a bucket matching some criteria.
|
6
|
+
#
|
7
|
+
# @param bucket [String] name of bucket to list
|
8
|
+
# @param options [Hash] optional hash of options
|
9
|
+
# @option options [String] :delimiter Delimiter to collapse objects
|
10
|
+
# under to emulate a directory-like mode
|
11
|
+
# @option options [Integer] :max_results Maximum number of results to
|
12
|
+
# retrieve
|
13
|
+
# @option options [String] :page_token Token to select a particular page
|
14
|
+
# of results
|
15
|
+
# @option options [String] :prefix String that an object must begin with
|
16
|
+
# in order to be returned
|
17
|
+
# @option options ["full", "noAcl"] :projection Set of properties to
|
18
|
+
# return (defaults to "noAcl")
|
19
|
+
# @option options [Boolean] :versions If true, lists all versions of an
|
20
|
+
# object as distinct results (defaults to False)
|
21
|
+
def list_objects(bucket, options = {})
|
22
|
+
api_method = @storage_json.objects.list
|
23
|
+
parameters = {
|
24
|
+
"bucket" => bucket
|
25
|
+
}
|
26
|
+
|
27
|
+
# Optional parameters
|
28
|
+
{
|
29
|
+
:delimiter => "delimiter",
|
30
|
+
:max_results => "maxResults",
|
31
|
+
:page_token => "pageToken",
|
32
|
+
:prefix => "prefix",
|
33
|
+
:projection => "projection",
|
34
|
+
:versions => "versions"
|
35
|
+
}.each do |k, v|
|
36
|
+
parameters[v] = options[k] unless options[k].nil?
|
37
|
+
end
|
38
|
+
|
39
|
+
request(api_method, parameters)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
class Mock
|
44
|
+
def list_objects(_bucket, _options = {})
|
45
|
+
Fog::Mock.not_implemented
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
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.4.
|
4
|
+
version: 0.4.2
|
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: 2016-10-
|
14
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: fog-core
|
@@ -563,6 +563,7 @@ files:
|
|
563
563
|
- lib/fog/storage/google_json/requests/get_object_url.rb
|
564
564
|
- lib/fog/storage/google_json/requests/head_object.rb
|
565
565
|
- lib/fog/storage/google_json/requests/list_buckets.rb
|
566
|
+
- lib/fog/storage/google_json/requests/list_objects.rb
|
566
567
|
- lib/fog/storage/google_json/requests/put_bucket.rb
|
567
568
|
- lib/fog/storage/google_json/requests/put_bucket_acl.rb
|
568
569
|
- lib/fog/storage/google_json/requests/put_object.rb
|
@@ -719,7 +720,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
719
720
|
version: '0'
|
720
721
|
requirements: []
|
721
722
|
rubyforge_project:
|
722
|
-
rubygems_version: 2.
|
723
|
+
rubygems_version: 2.5.1
|
723
724
|
signing_key:
|
724
725
|
specification_version: 4
|
725
726
|
summary: Module for the 'fog' gem to support Google.
|