diff options
author | Ryan Fitzgerald <rwfitzge@gmail.com> | 2014-04-28 23:12:56 -0700 |
---|---|---|
committer | Ryan Fitzgerald <rwfitzge@gmail.com> | 2014-04-28 23:12:58 -0700 |
commit | 33c45dbf52f65402ba51f1aa3a50aa4837dd4fbc (patch) | |
tree | d1c9a0bd7d67b2333f9eacc643eafbf5369deb2a | |
parent | df4a3b48af85e53fe5ec0373d228e647ace62006 (diff) | |
download | pry-33c45dbf52f65402ba51f1aa3a50aa4837dd4fbc.tar.gz |
Expand windows ANSI check to include MRI 2.1
Presumably any version >= 2.0 is OK.
-rw-r--r-- | lib/pry/helpers/base_helpers.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/pry/helpers/base_helpers.rb b/lib/pry/helpers/base_helpers.rb index b4b3f13d..9dad7f37 100644 --- a/lib/pry/helpers/base_helpers.rb +++ b/lib/pry/helpers/base_helpers.rb @@ -71,7 +71,7 @@ class Pry # are we able to use ansi on windows? def windows_ansi? - defined?(Win32::Console) || ENV['ANSICON'] || (windows? && mri_20?) + defined?(Win32::Console) || ENV['ANSICON'] || (windows? && mri_2?) end def jruby? @@ -91,15 +91,19 @@ class Pry end def mri_19? - mri? && RUBY_VERSION =~ /1.9/ + mri? && RUBY_VERSION =~ /^1\.9/ + end + + def mri_2? + mri? && RUBY_VERSION =~ /^2/ end def mri_20? - mri? && RUBY_VERSION =~ /2.0/ + mri? && RUBY_VERSION =~ /^2\.0/ end def mri_21? - mri? && RUBY_VERSION =~ /2.1/ + mri? && RUBY_VERSION =~ /^2\.1/ end # Send the given text through the best available pager (if Pry.pager is |