Added option to support manually specified discovery URI.

git-svn-id: https://google-api-ruby-client.googlecode.com/svn/trunk@101 c1d61fac-ed7f-fcc1-18f7-ff78120a04ef
This commit is contained in:
Bob Aman committed 2010-10-22 22:21:26 +00:00
1 parent b0846efa4a
commit f63bf8199f
4 files changed
+34 -1

No files matched your search

+9
View File
@@ -131,6 +131,15 @@ module Google
end)
end
##
# Sets the discovery URI for the client.
#
# @param [Addressable::URI, #to_str, String] new_discovery_uri
# The new discovery URI.
def discovery_uri=(new_discovery_uri)
@options[:discovery_uri] = Addressable::URI.parse(new_discovery_uri)
end
##
# Returns the parsed discovery document.
#
+5 -1
View File
@@ -155,7 +155,11 @@ module Google
split_version = lambda do |version|
dotted_version = version[/^v?(\d+(.\d+)*)-?(.*?)?$/, 1]
suffix = version[/^v?(\d+(.\d+)*)-?(.*?)?$/, 3]
[dotted_version.split('.').map { |v| v.to_i }, suffix]
if dotted_version && suffix
[dotted_version.split('.').map { |v| v.to_i }, suffix]
else
[[-1], version]
end
end
self_sortable, self_suffix = split_version.call(self.version)
other_sortable, other_suffix = split_version.call(other.version)