module Pry::Helpers::Platform
Contains methods for querying the platform that Pry
is running on @api public @since v0.12.0
Public Class Methods
Source
# File lib/pry/helpers/platform.rb, line 35 def self.jruby? RbConfig::CONFIG['ruby_install_name'] == 'jruby' end
@return [Boolean]
Source
# File lib/pry/helpers/platform.rb, line 40 def self.jruby_19? jruby? && RbConfig::CONFIG['ruby_version'] == '1.9' end
@return [Boolean]
Source
# File lib/pry/helpers/platform.rb, line 17 def self.linux? !!(RbConfig::CONFIG['host_os'] =~ /linux/i) end
@return [Boolean]
Source
# File lib/pry/helpers/platform.rb, line 12 def self.mac_osx? !!(RbConfig::CONFIG['host_os'] =~ /\Adarwin/i) end
@return [Boolean]
Source
# File lib/pry/helpers/platform.rb, line 45 def self.mri? RbConfig::CONFIG['ruby_install_name'] == 'ruby' end
@return [Boolean]
Source
# File lib/pry/helpers/platform.rb, line 50 def self.mri_2? mri? && RUBY_VERSION.start_with?('2') end
@return [Boolean]
Source
# File lib/pry/helpers/platform.rb, line 23 def self.windows? !!(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/) end
@return [Boolean] true when Pry
is running on Windows with ANSI support,
false otherwise
Source
# File lib/pry/helpers/platform.rb, line 28 def self.windows_ansi? return false unless windows? !!(defined?(Win32::Console) || Pry::Env['ANSICON'] || mri?) end
@return [Boolean]