Module: Distroid
- Defined in:
- lib/distroid.rb,
lib/distroid/version.rb
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Method Summary collapse
-
#distro? ⇒ Boolean
Detects the Linux distrubution the host system runs.
-
#os? ⇒ Boolean
Detects which operating system the host computer is using.
Instance Method Details
#distro? ⇒ Boolean
Detects the Linux distrubution the host system runs
5 6 7 8 9 10 11 12 13 |
# 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? ⇒ Boolean
Detects which operating system the host computer is using
16 17 18 19 |
# 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 |