Class: Platform

Inherits:
Object
  • Object
show all
Defined in:
lib/common/platform.rb

Overview

LinuxやBSD等にも対応予定(その場合のエンコードって何が適切なんだろ?EUC?UTF8?)

Class Method Summary collapse

Class Method Details

.get_shell_kcodeObject



10
11
12
13
14
15
16
# File 'lib/common/platform.rb', line 10

def self.get_shell_kcode
  if windows_os?
    Kconv::SJIS
  else
    Kconv::UTF8
  end
end

.windows_os?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/common/platform.rb', line 6

def self.windows_os?
  RUBY_PLATFORM =~ /mswin(?!ce)|mingw|cygwin|bccwin/
end