lib/sct/config.rb in sct-0.1.6 vs lib/sct/config.rb in sct-0.1.7
- old
+ new
@@ -1,8 +1,12 @@
module Sct
class Config
+ WINDOWS = "Windows"
+ MAC_OS = "MacOS"
+ UBUNTU = "Ubuntu"
+
def self.dir
user = ENV["SUDO_USER"] || ENV["USER"]
if `uname -a`.match?("Darwin")
home = "/Users"
@@ -37,8 +41,23 @@
end
contents = File.read(self.path)
return Sct::Helpers.to_hash(contents)
+ end
+
+ def self.operatingSystem
+ proc = `uname -a`
+
+ case proc
+ when /Microsoft/
+ os = WINDOWS
+ when /Darwin/
+ os = MAC_OS
+ else
+ os = UBUNTU
+ end
+
+ return os
end
end
end