module Pry::Helpers::Platform

def self.jruby?

Returns:
  • (Boolean) -
def self.jruby?
  RbConfig::CONFIG['ruby_install_name'] == 'jruby'
end

def self.jruby_19?

Returns:
  • (Boolean) -
def self.jruby_19?
  jruby? && RbConfig::CONFIG['ruby_version'] == '1.9'
end

def self.linux?

Returns:
  • (Boolean) -
def self.linux?
  !!(RbConfig::CONFIG['host_os'] =~ /linux/i)
end

def self.mac_osx?

Returns:
  • (Boolean) -
def self.mac_osx?
  !!(RbConfig::CONFIG['host_os'] =~ /\Adarwin/i)
end

def self.mri?

Returns:
  • (Boolean) -
def self.mri?
  RbConfig::CONFIG['ruby_install_name'] == 'ruby'
end

def self.mri_2?

Returns:
  • (Boolean) -
def self.mri_2?
  mri? && RUBY_VERSION.start_with?('2')
end

def self.windows?

Returns:
  • (Boolean) - true when Pry is running on Windows with ANSI support,
def self.windows?
  !!(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/)
end

def self.windows_ansi?

Returns:
  • (Boolean) -
def self.windows_ansi?
  return false unless windows?
  !!(defined?(Win32::Console) || Pry::Env['ANSICON'] || mri?)
end