gist: 3736 Download_button fork
public
Description:
detects OS versions
Public Clone URL: git://gist.github.com/3736.git
Ruby
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class OsVersion
  def initialize
    @ruby_platform = RUBY_PLATFORM
    if File.exists?("/proc/version")
      @os = :linux
      @ident = File.open("/proc/version").readlines.join
    elsif `sw_vers`.length != 0
      @os = :macosx
      @version = `sw_vers -productVersion`.chop!
      @build = `sw_vers -buildVersion`
    elsif @ruby_platform =~ /(win|w)32$/
      @os = :windows
    end
  end
end

Owner

tommorris

Revisions