diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2018-01-24 21:29:58 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2018-01-24 21:29:58 -0500 |
commit | d210abef152cf379de7ad8bd4cab62c3432451e3 (patch) | |
tree | 05e79190b55808382815ba84078e25a0eab49b48 /src/edu/stsci/OSInfo.groovy | |
parent | 7f9fe6def81ebe837a5551b06ff5c7e759598555 (diff) | |
download | groovy-sandbox-d210abef152cf379de7ad8bd4cab62c3432451e3.tar.gz |
Refactor namespace
Diffstat (limited to 'src/edu/stsci/OSInfo.groovy')
-rw-r--r-- | src/edu/stsci/OSInfo.groovy | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/edu/stsci/OSInfo.groovy b/src/edu/stsci/OSInfo.groovy new file mode 100644 index 0000000..04375f8 --- /dev/null +++ b/src/edu/stsci/OSInfo.groovy @@ -0,0 +1,19 @@ +package org.stsci + +class OSInfo implements Serializable { + public String name + public String version + public String arch + + OSInfo () { + name = 'uname -s'.execute().text.trim() + if (name == 'Darwin') { name = 'MacOSX' } + arch = 'uname -m'.execute().text.trim() + if (arch.matches('^i.*86$')) { arch = 'x86' } + + this.name = name + this.arch = arch + this.version = 'uname -r'.execute().text.trim() + } + +} |