Module: OS

Defined in:
lib/atk/os.rb

Overview

Groups

the groups are the pratical side of the OS, they describe the OS rather than fit it prefectly into a heirarchy

Class Method Summary collapse

Class Method Details

.is?(adjective) ⇒ Boolean

Returns:

  • (Boolean)


57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/atk/os.rb', line 57

def self.is?(adjective)
    # summary:
        # this is a function created for convenience, so it doesn't have to be perfect
        # you can use it to ask about random qualities of the current OS and get a boolean response
    # convert to string (if its a symbol)
    adjective = adjective.to_s
    case adjective
        when 'windows'
            return (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
        when 'mac'
            return (/darwin/ =~ RUBY_PLATFORM) != nil
        when 'linux'
            return (not OS.is?(:windows)) && (not OS.is?(:mac))
        when 'unix'
            return not( OS.is?(:windows))
    end
end

.versionObject

TODO: have the version pick one of the verions in the os_heirarchy according to the current OS



53
54
55
# File 'lib/atk/os.rb', line 53

def self.version
    raise "not yet implemented"
end