Skip to content

vmoravec/linux_distro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Rubygem LinuxDistro

##About

As YaST++ (Linux configuration library) is planned to be compatible with several Linux distributions, this library should provide an information

  • On which Linux distribution are we running
  • Where are the system directories

##Project Status

Currently just in a 'proof of concept' state

##Usage

# Boolean function for each known distribution
LinuxDistro::suse?
-> true

# Returns a symbol
LinuxDistro::distro
-> suse

##Known Distros

LinuxDistro currently knows these distributions

  • Fedora
  • SUSE
  • CentOS
  • Mandriva

##How to Build a Gem

Simply run

gem build linux_distro.gemspec

##How Are the Distros Recognized

/etc/fedora-release         --> Fedora
    -- example ---
    Fedora release 16 (Verne)
    -- example ---

/etc/SuSE-release           --> SUSE
    -- example ---
    openSUSE 12.1 (x86_64)
    VERSION = 12.1
    CODENAME = Asparagus
    -- example ---

/etc/centos-release         --> CentOS
    -- example ---
    CentOS release 6.2 (Final)
    -- example ---

/etc/mandriva-release       --> Mandriva
    -- example ---
    Mandriva Linux release 2011.0 (Official) for x86_64
    -- example ---

/etc/lsb-release
    -- example ---
    DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=11.10
    DISTRIB_CODENAME=oneiric
    DISTRIB_DESCRIPTION="Ubuntu 11.10"
    -- example ---          --> Ubuntu

    -- example ---
    DISTRIB_ID=LinuxMint
    DISTRIB_RELEASE=12
    DISTRIB_CODENAME=lisa
    DISTRIB_DESCRIPTION="Linux Mint 12 Lisa"
    -- example ---          --> LinuxMint

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%