2011-05-04 22:43:33 +00:00
|
|
|
module Google
|
|
|
|
class APIClient
|
|
|
|
module ENV
|
2011-10-31 10:32:48 +00:00
|
|
|
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.
|
2011-11-16 08:44:44 +00:00
|
|
|
`ver`.sub(/\s*\[Version\s*/, '/').sub(']', '').strip
|
2011-05-04 22:43:33 +00:00
|
|
|
elsif RUBY_PLATFORM =~ /darwin/i
|
|
|
|
"Mac OS X/#{`sw_vers -productVersion`}"
|
|
|
|
else
|
|
|
|
`uname -sr`.sub(' ', '/')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|