gcloud 0.6.0 → 0.6.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 +8 -8
- data/CHANGELOG.md +7 -0
- data/OVERVIEW.md +18 -0
- data/lib/gcloud/storage/bucket.rb +14 -2
- data/lib/gcloud/storage/connection.rb +8 -6
- data/lib/gcloud/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODE4NzljMmM3NWM4ZTAzNjExY2E2YWEwMWQ5MjY3YzdiZjAwOGJmOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MDdlNWYxMjBiMjk1Mjc1ZTNjNjRkZmU0Y2M0NmZiMjVmOWVmODI4NA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDRmODU3NjQ0MWIxYjU3NWVlMGU1YTZjMjQ5ZDQ1ZmVlZjQ0ZDUwODVkNjA0
|
10
|
+
NjcyNGJlMTFkOGVjNmJiZjkwZGMzMzlhNmMzYjI1ZGVlZmE5ZDhmYzU3OGVi
|
11
|
+
ODBmNDM1ZmEzYjAzNDkwZjBmMzhiYmE2MjZlMjM5MzgyM2MxMmY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWNmNzNiNzBlOTA1NjZjOGIwYzlhYzdiYTg3YTU1MWM4NTVlZjU4MjJkNDU2
|
14
|
+
YmUwNTdiZWEyMzJhYmNiZTNmNzhhZTdhY2EzMTkyOTU0Y2EyZWQyNWQ0YmUz
|
15
|
+
OTkwNGJiMGVhZjIzNDY0MmUyOWY0NzI0ZjhkZDBhOGRmZDYzNjU=
|
data/CHANGELOG.md
CHANGED
data/OVERVIEW.md
CHANGED
@@ -153,6 +153,24 @@ end
|
|
153
153
|
projects = resource_manager.projects filter: "labels.env:production"
|
154
154
|
```
|
155
155
|
|
156
|
+
# Search
|
157
|
+
|
158
|
+
[Google Cloud Search](https://cloud.google.com/search/) ([docs](https://cloud.google.com/search/reference/rest/index)) allows an application to quickly perform full-text and geo-spatial searches without having to spin up instances and without the hassle of managing and maintaining a search service.
|
159
|
+
|
160
|
+
See the [gcloud-ruby Search API documentation](rdoc-ref:Gcloud::Search) to learn how to connect to Cloud Search using this library.
|
161
|
+
|
162
|
+
```ruby
|
163
|
+
require "gcloud"
|
164
|
+
|
165
|
+
gcloud = Gcloud.new
|
166
|
+
search = gcloud.search
|
167
|
+
index = search.index "products"
|
168
|
+
|
169
|
+
results = index.search "cotton T-shirt",
|
170
|
+
expressions: { total_price: "(price + tax)" },
|
171
|
+
fields: ["name", "total_price", "highlight"]
|
172
|
+
```
|
173
|
+
|
156
174
|
# Storage
|
157
175
|
|
158
176
|
[Google Cloud Storage](https://cloud.google.com/storage/) ([docs](https://cloud.google.com/storage/docs/json_api/)) allows you to store data on Google infrastructure with very high reliability, performance and availability, and can be used to distribute large data objects to users via direct download.
|
@@ -353,6 +353,12 @@ module Gcloud
|
|
353
353
|
# +prefix+::
|
354
354
|
# Filter results to files whose names begin with this prefix.
|
355
355
|
# (+String+)
|
356
|
+
# +delimiter+::
|
357
|
+
# Returns results in a directory-like mode. +items+ will contain only
|
358
|
+
# objects whose names, aside from the +prefix+, do not contain
|
359
|
+
# +delimiter+. Objects whose names, aside from the +prefix+, contain
|
360
|
+
# +delimiter+ will have their name, truncated after the +delimiter+,
|
361
|
+
# returned in +prefixes+. Duplicate +prefixes+ are omitted.
|
356
362
|
# +token+::
|
357
363
|
# A previously-returned page token representing part of the larger set
|
358
364
|
# of results to view. (+String+)
|
@@ -406,9 +412,15 @@ module Gcloud
|
|
406
412
|
# tmp_files = bucket.files token: tmp_files.token
|
407
413
|
# end
|
408
414
|
#
|
409
|
-
def files prefix: nil, token: nil, max: nil, versions: nil
|
415
|
+
def files prefix: nil, delimiter: nil, token: nil, max: nil, versions: nil
|
410
416
|
ensure_connection!
|
411
|
-
options = {
|
417
|
+
options = {
|
418
|
+
prefix: prefix,
|
419
|
+
delimiter: delimiter,
|
420
|
+
token: token,
|
421
|
+
max: max,
|
422
|
+
versions: versions
|
423
|
+
}
|
412
424
|
resp = connection.list_files name, options
|
413
425
|
if resp.success?
|
414
426
|
File::List.from_response resp, connection
|
@@ -165,12 +165,14 @@ module Gcloud
|
|
165
165
|
##
|
166
166
|
# Retrieves a list of files matching the criteria.
|
167
167
|
def list_files bucket_name, options = {}
|
168
|
-
params = {
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
168
|
+
params = {
|
169
|
+
bucket: bucket_name,
|
170
|
+
prefix: options[:prefix],
|
171
|
+
delimiter: options[:delimiter],
|
172
|
+
pageToken: options[:token],
|
173
|
+
maxResults: options[:max],
|
174
|
+
versions: options[:versions]
|
175
|
+
}.delete_if { |_, v| v.nil? }
|
174
176
|
|
175
177
|
@client.execute(
|
176
178
|
api_method: @storage.objects.list,
|
data/lib/gcloud/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gcloud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Silvano Luciani
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-12-
|
13
|
+
date: 2015-12-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: beefcake
|