Fixed issue with registering custom discovery URIs.

This commit is contained in:
Bob Aman 2011-10-07 12:19:29 +03:00
parent d27e73605d
commit 7bd5347d55
1 changed files with 11 additions and 1 deletions

View File

@ -416,7 +416,17 @@ HTML
end end
client = Google::APIClient.new(:authorization => nil) client = Google::APIClient.new(:authorization => nil)
if options[:discovery_uri] if options[:discovery_uri]
client.discovery_uri = options[:discovery_uri] if options[:api] && options[:version]
client.register_discovery_uri(
options[:api], options[:version], options[:discovery_uri]
)
else
STDERR.puts(
'Cannot register a discovery URI without ' +
'specifying an API and version.'
)
exit(1)
end
end end
version = api_version(api_name, options[:version]) version = api_version(api_name, options[:version])
api = client.discovered_api(api_name, version) api = client.discovered_api(api_name, version)