7bb7966cfcaeaf05cf5855d52d5e67de789ea507
[arvados.git] / lib / google / api_client / environment.rb
1 module Google
2   class APIClient
3     module ENV
4       OS_VERSION = if RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/
5         # TODO(bobaman)
6         # Confirm that all of these Windows environments actually have access
7         # to the `ver` command.
8         `ver`.sub(/\s*\[Version\s*/, '/').sub(']', '')
9       elsif RUBY_PLATFORM =~ /darwin/i
10         "Mac OS X/#{`sw_vers -productVersion`}"
11       else
12         `uname -sr`.sub(' ', '/')
13       end
14     end
15   end
16 end