From 89a5bd726a7e569a72755e8bfb22314073fbf703 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Tue, 14 Apr 2015 16:44:46 -0700 Subject: [PATCH] Updates the pubsub sample so that it no longer uses a scope --- src/ruby/bin/apis/pubsub_demo.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ruby/bin/apis/pubsub_demo.rb b/src/ruby/bin/apis/pubsub_demo.rb index 9bb324ff646..6d69b0f21e5 100755 --- a/src/ruby/bin/apis/pubsub_demo.rb +++ b/src/ruby/bin/apis/pubsub_demo.rb @@ -71,7 +71,7 @@ end # Builds the metadata authentication update proc. def auth_proc(opts) - auth_creds = Google::Auth.get_application_default(opts.oauth_scope) + auth_creds = Google::Auth.get_application_default return auth_creds.updater_proc end @@ -213,17 +213,14 @@ class NamedActions end # Args is used to hold the command line info. -Args = Struct.new(:host, :oauth_scope, :port, :action, :project_id, :topic_name, +Args = Struct.new(:host, :port, :action, :project_id, :topic_name, :sub_name) # validates the the command line options, returning them as an Arg. def parse_args args = Args.new('pubsub-staging.googleapis.com', - 'https://www.googleapis.com/auth/pubsub', 443, 'list_some_topics', 'stoked-keyword-656') OptionParser.new do |opts| - opts.on('--oauth_scope scope', - 'Scope for OAuth tokens') { |v| args['oauth_scope'] = v } opts.on('--server_host SERVER_HOST', 'server hostname') do |v| args.host = v end @@ -250,7 +247,7 @@ def parse_args end def _check_args(args) - %w(host port action oauth_scope).each do |a| + %w(host port action).each do |a| if args[a].nil? raise OptionParser::MissingArgument.new("please specify --#{a}") end