Module: DataShift::Guards

Defined in:
lib/datashift/guards.rb

Class Method Summary collapse

Class Method Details

.jruby?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/datashift/guards.rb', line 40

def self.jruby?
  RUBY_PLATFORM == 'java'
end

.linux?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/datashift/guards.rb', line 48

def self.linux?
  RbConfig::CONFIG['target_os'] =~ /linux/i
end

.mac?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/datashift/guards.rb', line 44

def self.mac?
  RbConfig::CONFIG['target_os'] =~ /darwin/i
end

.windows?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/datashift/guards.rb', line 52

def self.windows?
  RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
end