Merge branch 'master' of github.com:sporkmonger/google-api-ruby-client
This commit is contained in:
commit
af61568cbe
4 files changed
+29
-31
No files matched your search
@@ -43,7 +43,7 @@ module Google
|
||||
def initialize(document_base, discovery_document)
|
||||
@document_base = Addressable::URI.parse(document_base)
|
||||
@discovery_document = discovery_document
|
||||
metaclass = (class <<self; self; end)
|
||||
metaclass = (class << self; self; end)
|
||||
self.discovered_resources.each do |resource|
|
||||
method_name = Google::INFLECTOR.underscore(resource.name).to_sym
|
||||
if !self.respond_to?(method_name)
|
||||
|
||||
@@ -47,7 +47,7 @@ module Google
|
||||
# and excess object creation, but this hopefully shouldn't be an
|
||||
# issue since it should only be called only once per schema per
|
||||
# process.
|
||||
if data.kind_of?(Hash) && data['$ref']
|
||||
if data.kind_of?(Hash) && data['$ref'].is_a?(String)
|
||||
reference = data['$ref']
|
||||
reference = '#' + reference if reference[0..0] != '#'
|
||||
data.merge({
|
||||
|
||||
@@ -16,15 +16,19 @@
|
||||
module Google
|
||||
class APIClient
|
||||
module ENV
|
||||
OS_VERSION = if RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/
|
||||
# TODO(bobaman)
|
||||
# Confirm that all of these Windows environments actually have access
|
||||
# to the `ver` command.
|
||||
`ver`.sub(/\s*\[Version\s*/, '/').sub(']', '').strip
|
||||
elsif RUBY_PLATFORM =~ /darwin/i
|
||||
"Mac OS X/#{`sw_vers -productVersion`}"
|
||||
else
|
||||
`uname -sr`.sub(' ', '/')
|
||||
OS_VERSION = begin
|
||||
if RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/
|
||||
# TODO(bobaman)
|
||||
# Confirm that all of these Windows environments actually have access
|
||||
# to the `ver` command.
|
||||
`ver`.sub(/\s*\[Version\s*/, '/').sub(']', '').strip
|
||||
elsif RUBY_PLATFORM =~ /darwin/i
|
||||
"Mac OS X/#{`sw_vers -productVersion`}"
|
||||
else
|
||||
`uname -sr`.sub(' ', '/')
|
||||
end
|
||||
rescue Exception
|
||||
RUBY_PLATFORM
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user