Skip to content

Commit 0c5e0c4

Browse files
author
remi Taylor
committed
Merge branch 'master' into new-storage-samples
2 parents 0c68b6e + ca664cc commit 0c5e0c4

47 files changed

Lines changed: 1510 additions & 178 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.rubocop.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@
2323
# Lint cops
2424
# http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint
2525

26+
AllCops:
27+
# Allow Ruby 2 features, eg. named parameters
28+
TargetRubyVersion: 2.1
29+
Exclude:
30+
# ignore generated protobuf files
31+
- "**/*_pb.rb"
32+
# ignore any code in 'generated' directories
33+
- "*/generated/**/*.rb"
34+
2635
# Prefer double quotes for consistency (regardless of interpolation)
2736
Style/StringLiterals:
2837
EnforcedStyle: double_quotes
@@ -71,6 +80,8 @@ Style/NumericLiterals:
7180
Enabled: false
7281
Style/SpaceAroundOperators:
7382
Enabled: false
83+
Style/AccessorMethodName:
84+
Enabled: false
7485
Metrics/ClassLength:
7586
Enabled: false
7687
Style/EmptyElse:

.travis.yml

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
sudo: false
1616
language: ruby
1717
rvm:
18-
- 2.2.3
19-
- 2.0.0
18+
- 2.3.1
2019

2120
branches:
2221
only:
@@ -29,41 +28,21 @@ cache:
2928

3029
env:
3130
global:
32-
- PATH=$PATH:$HOME/gcloud/google-cloud-sdk/bin
3331
- GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/client_secrets.json
3432
matrix:
3533
- TEST_DIR=storage
3634
- TEST_DIR=pubsub
3735
- TEST_DIR=bigquery
3836
- TEST_DIR=datastore
3937
- TEST_DIR=logging
38+
- TEST_DIR=speech
39+
- TEST_DIR=translate
40+
- TEST_DIR=language
4041
- TEST_DIR=appengine/endpoints
4142

4243
before_install:
43-
#ENCRYPT YOUR PRIVATE KEY (If you need authentication)
44-
# 1. Install and login to the Travis CLI:
45-
# $ gem install travis
46-
# $ travis login
47-
# 2. Move your json private key to client_secrets.json
48-
# 3. Run:
49-
# $ travis encrypt-file client_secrets.json --add
50-
# 4. Commit changes:
51-
# $ git add client_secrets.json.enc
52-
# $ git commit client_secrets.json.enc .travis.yml
5344
- openssl aes-256-cbc -K $encrypted_aeb4e2af7332_key -iv $encrypted_aeb4e2af7332_iv
5445
-in client_secrets.json.enc -out client_secrets.json -d
55-
- if [ ! -d $HOME/gcloud/google-cloud-sdk ]; then
56-
mkdir -p $HOME/gcloud &&
57-
wget https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz --directory-prefix=$HOME/gcloud &&
58-
cd $HOME/gcloud &&
59-
tar xzf google-cloud-sdk.tar.gz &&
60-
printf '\ny\n\ny\ny\n' | ./google-cloud-sdk/install.sh &&
61-
cd $TRAVIS_BUILD_DIR;
62-
fi
63-
- gcloud -q components update
64-
- if [ -a client_secrets.json ]; then
65-
gcloud -q auth activate-service-account --key-file client_secrets.json;
66-
fi
6746

6847
install:
6948
- cd $TEST_DIR

appengine/endpoints/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
endpoints/

appengine/endpoints/.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--tty --color --format documentation --order random

appengine/endpoints/Gemfile.lock

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@ GEM
22
remote: https://rubygems.org/
33
specs:
44
addressable (2.4.0)
5-
ast (2.2.0)
5+
ast (2.3.0)
66
diff-lcs (1.2.5)
7-
domain_name (0.5.20160310)
7+
domain_name (0.5.20160615)
88
unf (>= 0.0.5, < 1.0.0)
99
faraday (0.9.2)
1010
multipart-post (>= 1.2, < 3)
1111
http-cookie (1.0.2)
1212
domain_name (~> 0.5)
13-
json (1.8.3)
13+
json (2.0.2)
1414
jwt (1.5.4)
15-
mime-types (2.99.1)
16-
multi_json (1.11.2)
15+
mime-types (3.1)
16+
mime-types-data (~> 3.2015)
17+
mime-types-data (3.2016.0521)
18+
multi_json (1.12.1)
1719
multipart-post (2.0.0)
1820
netrc (0.11.0)
19-
parser (2.3.0.7)
21+
parser (2.3.1.2)
2022
ast (~> 2.2)
2123
powerpack (0.1.1)
2224
rack (1.6.4)
@@ -25,32 +27,32 @@ GEM
2527
rack-test (0.6.3)
2628
rack (>= 1.0)
2729
rainbow (2.1.0)
28-
rake (11.1.2)
29-
rest-client (1.8.0)
30+
rake (11.2.2)
31+
rest-client (2.0.0)
3032
http-cookie (>= 1.0.2, < 2.0)
31-
mime-types (>= 1.16, < 3.0)
32-
netrc (~> 0.7)
33-
rspec (3.4.0)
34-
rspec-core (~> 3.4.0)
35-
rspec-expectations (~> 3.4.0)
36-
rspec-mocks (~> 3.4.0)
37-
rspec-core (3.4.4)
38-
rspec-support (~> 3.4.0)
39-
rspec-expectations (3.4.0)
33+
mime-types (>= 1.16, < 4.0)
34+
netrc (~> 0.8)
35+
rspec (3.5.0)
36+
rspec-core (~> 3.5.0)
37+
rspec-expectations (~> 3.5.0)
38+
rspec-mocks (~> 3.5.0)
39+
rspec-core (3.5.2)
40+
rspec-support (~> 3.5.0)
41+
rspec-expectations (3.5.0)
4042
diff-lcs (>= 1.2.0, < 2.0)
41-
rspec-support (~> 3.4.0)
42-
rspec-mocks (3.4.1)
43+
rspec-support (~> 3.5.0)
44+
rspec-mocks (3.5.0)
4345
diff-lcs (>= 1.2.0, < 2.0)
44-
rspec-support (~> 3.4.0)
45-
rspec-support (3.4.1)
46-
rubocop (0.39.0)
47-
parser (>= 2.3.0.7, < 3.0)
46+
rspec-support (~> 3.5.0)
47+
rspec-support (3.5.0)
48+
rubocop (0.42.0)
49+
parser (>= 2.3.1.1, < 3.0)
4850
powerpack (~> 0.1)
4951
rainbow (>= 1.99.1, < 3.0)
5052
ruby-progressbar (~> 1.7)
5153
unicode-display_width (~> 1.0, >= 1.0.1)
52-
ruby-progressbar (1.7.5)
53-
signet (0.7.2)
54+
ruby-progressbar (1.8.1)
55+
signet (0.7.3)
5456
addressable (~> 2.3)
5557
faraday (~> 0.9)
5658
jwt (~> 1.5)
@@ -59,11 +61,11 @@ GEM
5961
rack (~> 1.5)
6062
rack-protection (~> 1.4)
6163
tilt (>= 1.3, < 3)
62-
tilt (2.0.2)
64+
tilt (2.0.5)
6365
unf (0.1.4)
6466
unf_ext
6567
unf_ext (0.0.7.2)
66-
unicode-display_width (1.0.3)
68+
unicode-display_width (1.1.0)
6769

6870
PLATFORMS
6971
ruby
@@ -79,4 +81,4 @@ DEPENDENCIES
7981
sinatra
8082

8183
BUNDLED WITH
82-
1.11.2
84+
1.12.5

appengine/endpoints/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Google Cloud Endpoints & App Engine Flexible Environment & Ruby
22

33
This sample demonstrates how to use Google Cloud Endpoints on
4-
Google App Engine flexible environment using Ruby.
4+
Google App Engine flexible environment using Ruby. This sample requires that you
5+
have [Ruby](https://www.ruby-lang.org/en/documentation/installation/) 2.0.0 or
6+
newer installed.
57

68
This sample consists of two parts:
79

@@ -27,7 +29,7 @@ In your web browser, go to the following address: http://localhost:8080.
2729
With the app running locally, you can execute the simple echo client using:
2830

2931
$ bundle exec ruby clients/echo_client.rb \
30-
--host https://localhost:8080 \
32+
--host http://localhost:8080 \
3133
--api_key APIKEY \
3234
--message "message to echo"
3335

@@ -40,7 +42,7 @@ Open the `swagger.yaml` file and in the `host` property, replace
4042

4143
Then, deploy the sample using `gcloud`:
4244

43-
gcloud app deploy app.yaml
45+
gcloud beta app deploy
4446

4547
Once deployed, you can access the application at https://YOUR-PROJECT-ID.appspot.com/.
4648

appengine/endpoints/clients/echo_client.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
# Example of calling a simple Google Cloud Endpoint API.
1616

17+
require "json"
1718
require "optparse"
1819
require "rest-client"
1920

appengine/endpoints/clients/google_id_token_client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
redirect_uri: "urn:ietf:wg:oauth:2.0:oob"
7474
)
7575

76-
`open "#{oauth.authorization_uri}"`
76+
puts "Open the following URI in your browser to get the authorization code:"
77+
puts oauth.authorization_uri
7778

7879
print "Enter authorization code: "
7980

appengine/endpoints/swagger.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,4 @@ securityDefinitions:
102102
authorizationUrl: ""
103103
flow: "implicit"
104104
type: "oauth2"
105-
x-issuer: "accounts.google.com"
106-
x-jwks_uri: "https://www.googleapis.com/oauth2/v1/certs"
105+
x-issuer: "https://accounts.google.com"

bigquery/.rspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--tty --color --format documentation --order random

0 commit comments

Comments
 (0)