Sha256: ae16e670049309e3dfabfa1d9aea4339b1f1483d5725d3de0e7b4da67881e7d0
Contents?: true
Size: 761 Bytes
Versions: 2
Compression:
Stored size: 761 Bytes
Contents
module Thug class PlatformDetector # get platform: ubuntu, debian, centos def get_platform if(/darwin/i =~ RUBY_PLATFORM) return "mac" end platform = `ohai platform` if platform =~ /ubuntu/i platform = "ubuntu" elsif platform =~ /debian/i platform = "debian" elsif platform =~ /centos/i platform = "centos" end platform end def get_os os = `ohai os` if os =~ /linux/i os = "linux" end os end # returns package manager of current platform def get_package_manager platform case platform when "ubuntu" pkg = "sudo apt-get" when "debian" pkg = "sudo apt-get" when "centos" pkg = "sudo yum" when "mac" pkg = "brew" end pkg end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
thug-0.2.3 | lib/thug/platform/platform_detector.rb |
thug-0.2.2 | lib/thug/platform/platform_detector.rb |