Module: Pry::Helpers::Platform
- Defined in:
- lib/pry/helpers/platform.rb
Overview
Contains methods for querying the platform that Pry is running on
Class Method Summary collapse
- .jruby? ⇒ Boolean
- .jruby_19? ⇒ Boolean
- .linux? ⇒ Boolean
- .mac_osx? ⇒ Boolean
- .mri? ⇒ Boolean
- .mri_2? ⇒ Boolean
-
.windows? ⇒ Boolean
True when Pry is running on Windows with ANSI support, false otherwise.
- .windows_ansi? ⇒ Boolean
Class Method Details
.jruby? ⇒ Boolean
35 36 37 |
# File 'lib/pry/helpers/platform.rb', line 35 def self.jruby? RbConfig::CONFIG['ruby_install_name'] == 'jruby' end |
.jruby_19? ⇒ Boolean
40 41 42 |
# File 'lib/pry/helpers/platform.rb', line 40 def self.jruby_19? jruby? && RbConfig::CONFIG['ruby_version'] == '1.9' end |
.linux? ⇒ Boolean
17 18 19 |
# File 'lib/pry/helpers/platform.rb', line 17 def self.linux? !!(RbConfig::CONFIG['host_os'] =~ /linux/i) end |
.mac_osx? ⇒ Boolean
12 13 14 |
# File 'lib/pry/helpers/platform.rb', line 12 def self.mac_osx? !!(RbConfig::CONFIG['host_os'] =~ /\Adarwin/i) end |
.mri? ⇒ Boolean
45 46 47 |
# File 'lib/pry/helpers/platform.rb', line 45 def self.mri? RbConfig::CONFIG['ruby_install_name'] == 'ruby' end |
.mri_2? ⇒ Boolean
50 51 52 |
# File 'lib/pry/helpers/platform.rb', line 50 def self.mri_2? mri? && RUBY_VERSION.start_with?('2') end |
.windows? ⇒ Boolean
Returns true when Pry is running on Windows with ANSI support, false otherwise.
23 24 25 |
# File 'lib/pry/helpers/platform.rb', line 23 def self.windows? !!(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/) end |