class Launchy::Detect::HostOs

Determine the host operating system that Launchy is running on

Attributes

host_os[R]
to_s[R]
to_str[R]

Public Class Methods

new(host_os = nil) click to toggle source
# File lib/launchy/detect/host_os.rb, line 14
def initialize(host_os = nil)
  @host_os = host_os

  return if @host_os

  if (@host_os = override_host_os)
    Launchy.log "Using LAUNCHY_HOST_OS override value of '#{Launchy.host_os}'"
  else
    @host_os = default_host_os
  end
end

Public Instance Methods

default_host_os() click to toggle source
# File lib/launchy/detect/host_os.rb, line 26
def default_host_os
  ::RbConfig::CONFIG["host_os"].downcase
end
override_host_os() click to toggle source
# File lib/launchy/detect/host_os.rb, line 30
def override_host_os
  Launchy.host_os
end