module Distroid

Constants

VERSION

Public Instance Methods

distro?() click to toggle source

Detects the Linux distrubution the host system runs

# File lib/distroid.rb, line 5
def distro?
  # TODO: this is _very_ rudimentary at the moment, but it works
  # TODO: detect Arch and similar
  return :fedora   if File.exist?("/etc/fedora-release")
  return :redhat   if File.exist?("/etc/redhat-release")
  return :debian   if File.exist?("/etc/debian_version")
  return :suse     if File.exist?("/etc/SUSE-release")
  return :mandrake if File.exist?("/etc/mandrake-release")
end
os?() click to toggle source

Detects which operating system the host computer is using

# File lib/distroid.rb, line 16
def os?
  # TODO: implement, possibly using `uname` or similar.  I'd like to avoid
  #       using the sysinfo gem, simply so that there are no deps.
end