File: host_os.rb

package info (click to toggle)
ruby-launchy 2.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 292 kB
  • sloc: ruby: 1,285; makefile: 6
file content (32 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'rbconfig'

module Launchy::Detect
  class HostOs

    attr_reader :host_os
    alias to_s host_os
    alias to_str host_os

    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

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

    def override_host_os
      Launchy.host_os
    end

  end

end