Class: Launchy::Detect::HostOs

Inherits:
Object
  • Object
show all
Defined in:
lib/launchy/detect/host_os.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host_os = nil) ⇒ HostOs

Returns a new instance of HostOs.


9
10
11
12
13
14
15
16
17
18
19
# File 'lib/launchy/detect/host_os.rb', line 9

def initialize( host_os = nil )
  @host_os = host_os

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

Instance Attribute Details

#host_osObject (readonly) Also known as: to_s

Returns the value of attribute host_os


6
7
8
# File 'lib/launchy/detect/host_os.rb', line 6

def host_os
  @host_os
end

Instance Method Details

#default_host_osObject


21
22
23
# File 'lib/launchy/detect/host_os.rb', line 21

def default_host_os
  ::RbConfig::CONFIG['host_os']
end

#override_host_osObject


25
26
27
# File 'lib/launchy/detect/host_os.rb', line 25

def override_host_os
  Launchy.host_os
end