Module: OS

Defined in:
lib/fir/patches/os_patch.rb

Class Method Summary collapse

Class Method Details

.linux?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/fir/patches/os_patch.rb', line 18

def linux?
  OS.unix? && !OS.mac?
end

.mac?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/fir/patches/os_patch.rb', line 10

def mac?
  !(/darwin/ =~ RUBY_PLATFORM).nil?
end

.set_localeObject



22
23
24
25
26
# File 'lib/fir/patches/os_patch.rb', line 22

def set_locale
  system 'export LC_ALL=en_US.UTF-8'
  system 'export LC_CTYPE=en_US.UTF-8'
  system 'export LANG=en_US.UTF-8'
end

.unix?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/fir/patches/os_patch.rb', line 14

def unix?
  !OS.windows?
end

.windows?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/fir/patches/os_patch.rb', line 6

def windows?
  !(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil?
end