ip2k / google-api-ruby-client

Automatically exported from code.google.com/p/google-api-ruby-client
Apache License 2.0
0 stars 0 forks source link

google-api --discovery-uri throws an exception #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
  1. ./google-api list --api my.api \
       --api-version v1 \
       --discovery-uri http://localhost:8080/...

What is the expected output? What do you see instead?

Not to throw an exception.

./google-api:419:in `list': undefined method `discovery_uri=' for 
#<Google::APIClient:0xa3417b4> (NoMethodError)
        from ./google-api:182:in `parse!'
        from ./google-api:531:in `<main>'

What version of the product are you using? On what operating system?

commit 9387bfa5938aa45d7e6d1d4f01fc8d45114201a5
Ubuntu 11.04

Please provide any additional information below.

This is a continuation of Issue 19, which missed one other piece.  I couldn't 
figure out how to reactivate, so I had to open a new issue.

diff --git a/bin/google-api b/bin/google-api
index 4964063..80bbe50 100755
--- a/bin/google-api
+++ b/bin/google-api
@@ -416,7 +416,9 @@ HTML
         end
         client = Google::APIClient.new(:authorization => nil)
         if options[:discovery_uri]
-          client.discovery_uri = options[:discovery_uri]
+         client.register_discovery_uri(
+           options[:api], options[:version], options[:discovery_uri]
+         )
         end
         version = api_version(api_name, options[:version])
         api = client.discovered_api(api_name, version)

Original issue reported on code.google.com by boume...@gmail.com on 7 Oct 2011 at 2:21

GoogleCodeExporter commented 9 years ago
Fixed this one too, but marking as a duplicate.

Original comment by bobaman@google.com on 7 Oct 2011 at 9:21