Module: Platform

Defined in:
lib/platform.rb

Class Method Summary collapse

Class Method Details

.is_nixObject



3
4
5
# File 'lib/platform.rb', line 3

def self.is_nix
  !RUBY_PLATFORM.match("linux|darwin").nil?
end

.runtime(cmd, runtime) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/platform.rb', line 7

def self.runtime(cmd, runtime)
  command = cmd
  if self.is_nix
    command = "mono --runtime=#{runtime} #{cmd}"
  end
  command
end

.switch(arg) ⇒ Object



15
16
17
18
# File 'lib/platform.rb', line 15

def self.switch(arg)
  sw = self.is_nix ? " -" : " /"
  sw + arg
end