Skip to content

Commit ba3df7d

Browse files
author
remi Taylor
committed
Update Cloud Vision sample to use latest google-cloud-vision gem
1 parent d5e41f2 commit ba3df7d

3 files changed

Lines changed: 15 additions & 26 deletions

File tree

vision-sample/Gemfile

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

1515
source "https://rubygems.org"
1616

17-
gem "gcloud"
17+
gem "google-cloud-vision"
1818
gem "rmagick"
1919

2020
group :test do

vision-sample/Gemfile.lock

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,9 @@ GEM
44
addressable (2.4.0)
55
ast (2.3.0)
66
diff-lcs (1.2.5)
7-
digest-crc (0.4.1)
87
faraday (0.9.2)
98
multipart-post (>= 1.2, < 3)
10-
gcloud (0.12.2)
11-
digest-crc (~> 0.4)
12-
google-api-client (~> 0.9.11)
13-
google-protobuf (= 3.0.0.alpha.5.0.5.1)
14-
grpc (= 1.0.0.pre1)
15-
mime-types (>= 2.4, < 4.0)
16-
zonefile (~> 1.04)
17-
google-api-client (0.9.11)
9+
google-api-client (0.9.13)
1810
addressable (~> 2.3)
1911
googleauth (~> 0.5)
2012
httpclient (~> 2.7)
@@ -23,8 +15,10 @@ GEM
2315
mime-types (>= 1.6)
2416
representable (~> 2.3.0)
2517
retriable (~> 2.0)
26-
thor (~> 0.19)
27-
google-protobuf (3.0.0.alpha.5.0.5.1)
18+
google-cloud-core (0.20.1)
19+
google-cloud-vision (0.20.0)
20+
google-api-client (~> 0.9.11)
21+
google-cloud-core (~> 0.20.0)
2822
googleauth (0.5.1)
2923
faraday (~> 0.9)
3024
jwt (~> 1.4)
@@ -33,17 +27,14 @@ GEM
3327
multi_json (~> 1.11)
3428
os (~> 0.9)
3529
signet (~> 0.7)
36-
grpc (1.0.0.pre1)
37-
google-protobuf (~> 3.0.0.alpha.5.0.3)
38-
googleauth (~> 0.5.1)
39-
httpclient (2.8.2.2)
30+
httpclient (2.8.2.3)
4031
hurley (0.2)
4132
jwt (1.5.4)
4233
little-plugger (1.1.4)
4334
logging (2.1.0)
4435
little-plugger (~> 1.1)
4536
multi_json (~> 1.10)
46-
memoist (0.14.0)
37+
memoist (0.15.0)
4738
mime-types (3.1)
4839
mime-types-data (~> 3.2015)
4940
mime-types-data (3.2016.0521)
@@ -87,16 +78,14 @@ GEM
8778
faraday (~> 0.9)
8879
jwt (~> 1.5)
8980
multi_json (~> 1.10)
90-
thor (0.19.1)
9181
uber (0.0.15)
9282
unicode-display_width (1.1.0)
93-
zonefile (1.04)
9483

9584
PLATFORMS
9685
ruby
9786

9887
DEPENDENCIES
99-
gcloud
88+
google-cloud-vision
10089
rack-test
10190
rake
10291
rmagick

vision-sample/vision_samples.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
def detect_labels path_to_image_file
1616
# [START detect_labels]
1717
# [START importing_libraries]
18-
require "gcloud"
18+
require "google/cloud"
1919
# [END importing_libraries]
2020

2121
# [START create_vision_client]
22-
gcloud = Gcloud.new
22+
gcloud = Google::Cloud.new
2323
vision = gcloud.vision
2424
# [END create_vision_client]
2525

@@ -41,11 +41,11 @@ def detect_labels path_to_image_file
4141
def detect_landmark path_to_image_file
4242
# [START detect_landmark]
4343
# [START importing_libraries]
44-
require "gcloud"
44+
require "google/cloud"
4545
# [END importing_libraries]
4646

4747
# [START create_vision_client]
48-
gcloud = Gcloud.new
48+
gcloud = Google::Cloud.new
4949
vision = gcloud.vision
5050
# [END create_vision_client]
5151

@@ -64,11 +64,11 @@ def detect_landmark path_to_image_file
6464
def detect_faces path_to_image_file, path_to_output_file
6565
# [START detect_faces]
6666
# [START importing_libraries]
67-
require "gcloud"
67+
require "google/cloud"
6868
# [END importing_libraries]
6969

7070
# [START create_vision_client]
71-
gcloud = Gcloud.new
71+
gcloud = Google::Cloud.new
7272
vision = gcloud.vision
7373
# [END create_vision_client]
7474

0 commit comments

Comments
 (0)