Skip to content

improve ruby 2.4 support#1611

Merged
0x1eef merged 14 commits intomasterfrom
respond_to-2.4-warnings
Jun 13, 2017
Merged

improve ruby 2.4 support#1611
0x1eef merged 14 commits intomasterfrom
respond_to-2.4-warnings

Conversation

@0x1eef
Copy link
Copy Markdown
Contributor

@0x1eef 0x1eef commented May 27, 2017

Fix warnings and other issues that come up, eg:

/home/robert/.rubies/ruby-2.4.1/lib/ruby/2.4.0/forwardable.rb:225: warning: Pry::WrappedModule#respond_to?(:respond_to_missing?) uses the deprecated method signature, which takes one parameter
/home/robert/pry/lib/pry/wrapped_module.rb:153: warning: respond_to? is defined here

@0x1eef
Copy link
Copy Markdown
Contributor Author

0x1eef commented May 27, 2017

i added 2.4 to travis, https://travis-ci.org/pry/pry/jobs/236720971
it segfaults, and there's deprecation warnings.

@rf-
Copy link
Copy Markdown
Member

rf- commented May 30, 2017

@R-obert Sorry, just realized I posted about this in IRC but forgot to update this ticket. I opened a bug on RedMine the other day: https://bugs.ruby-lang.org/issues/13605

@0x1eef
Copy link
Copy Markdown
Contributor Author

0x1eef commented May 31, 2017

@rf- what should we do about the warnings? the delegation warnings to private methods will become errors soon, as far as i understood: https://bugs.ruby-lang.org/issues/12782#note-3 and they're not something you want to see when you're using pry.

@0x1eef
Copy link
Copy Markdown
Contributor Author

0x1eef commented Jun 3, 2017

@rf- please take another look. BTW, #name was in the public_delegates array but it looks like Ruby considers this method to be private, so i moved it to private_delegates and there's no warnings about that method anymore. Pry::WrappedModule#name is actually called via #method_missing, so i'm not sure why it's thought of as private...

@0x1eef 0x1eef force-pushed the respond_to-2.4-warnings branch from d0f2142 to efef49d Compare June 3, 2017 12:40
@0x1eef
Copy link
Copy Markdown
Contributor Author

0x1eef commented Jun 4, 2017

2.4 prints the same warnings as 2.3 now, and those warnings are from weird monkey patches that the tests do, i think we're good but please review. @rf- @kyrylo @banister

@0x1eef
Copy link
Copy Markdown
Contributor Author

0x1eef commented Jun 4, 2017

maybe ls command should default to show all constants (deprecated too) and have a switch to hide them instead of doing the opposite by default. i'm not sure, i'd prefer to not see those warnings and i think the default for me is to try hide them..

@0x1eef
Copy link
Copy Markdown
Contributor Author

0x1eef commented Jun 4, 2017

segfault is fixed since fixing the constant warnings.

@rf-
Copy link
Copy Markdown
Member

rf- commented Jun 13, 2017

There's a fix in Ruby master now, so we can probably just ignore the failures in CI until it gets released: ruby/ruby@fccbc2d

I feel like this issue probably has more to do with the Pry specs doing a bunch of Pry-like stuff in quick succession than with anything users are likely to see.

when Range
(_pry_.input_array[opts[:i]] || []).join
when Fixnum
when 1.class
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a cool idea, but we could probably just make it when Integer since Integer still exists as a superclass of Fixnum/Bignum in earlier versions of Ruby.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍
pushed.

class Pry
class Command::Ls < Pry::ClassCommand
class Constants < Pry::Command::Ls::Formatter
DEPRECATED_CONSTANTS = [:Fixnum, :Bignum, :TimeoutError, :NIL, :FALSE, :TRUE]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, I had no idea FALSE and TRUE existed 😅

Copy link
Copy Markdown
Contributor Author

@0x1eef 0x1eef Jun 13, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

me neither. i hope Ruby eventually implements Object.deprecated_constant?() because maintaining the list ourselves isn't ideal, it doesn't cover other constants that might be deprecated in the future, or other Ruby code that uses the deprecate_constant feature.

@rf-
Copy link
Copy Markdown
Member

rf- commented Jun 13, 2017

This all LGTM, except maybe that one thing about 1.class vs. Integer. 💯

@0x1eef 0x1eef changed the title fix warnings about signature of respond_to? on 2.4 improve ruby 2.4 support Jun 13, 2017
@0x1eef
Copy link
Copy Markdown
Contributor Author

0x1eef commented Jun 13, 2017

travis failed because of the segfault on 2.4, ruby-head is passing.

@0x1eef 0x1eef merged commit 8d030c3 into master Jun 13, 2017
@0x1eef 0x1eef deleted the respond_to-2.4-warnings branch June 13, 2017 21:25
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Mar 14, 2018
pkgsrc change: add support for pkg_alternatives

### HEAD

#### Features

* Add Pry::Testable, an improved modular replacement for PryTestHelpers.
  **breaking change**.

See pull request [#1679](pry/pry#1679).

* Add a new category module: "Pry::Platform". Loosely related to #1668 below.

See pull request [#1670](pry/pry#1670)

* Add `mac_osx?` and `linux?` utility functions to Pry::Helpers::BaseHelpers.

See pull request [#1668](pry/pry#1668).

* Add utility functions for drawing colorised text on a colorised background.

See pull request [#1673](pry/pry#1673).

#### Bug fixes

* Fix a case of infinite recursion in `Pry::Method::WeirdMethodLocator#find_method_in_superclass`
  that users of the [Hanami](http://hanamirb.org/) web framework experienced and
  reported since 2015.

See pull request [#1639](pry/pry#1689).

* Fix a bug where Method objects were not returned for setters inherited
  from a default (Pry::Config::Default). Eg, this is no longer an error:

      pry(main)> d = Pry::Config.from_hash({}, Pry::Config::Default.new)
      pry(main)> d.method(:exception_whitelist=) # Error

See pull request [#1688](pry/pry#1688).

* Do not capture unused Proc objects in Text helper methods `no_color` and `no_paging`,
  for performance reasons. Improve the documentation of both methods.

See pull request [#1691](pry/pry#1691).

* Fix `String#pp` output color.

See pull request [#1674](pry/pry#1674).

### 0.11.0

* Add alias 'whereami[?!]+' for 'whereami' command. ([#1597](pry/pry#1597))
* Improve Ruby 2.4 support ([#1611](pry/pry#1611)):
  * Deprecated constants are hidden from `ls` output by default, use the `-d` switch to see them.
  * Fix warnings that originate in Pry while using the repl.
* Improve completion speed in large applications. ([#1588](pry/pry#1588))
* Pry::ColorPrinter.pp: add `newline` argument and pass it on to PP. ([#1603](pry/pry#1603))
* Use `less` or system pager pager on MS Windows if it is available. ([#1512](pry/pry#1512))
* Add `Pry.configure` as an alternative to the current way of changing configuration options in `.pryrc` files. ([#1502](pry/pry#1502))
* Add `Pry::Config::Behavior#eager_load!` to add a possible workaround for issues like ([#1501](pry/pry#1501))
* Remove Slop as a runtime dependency by vendoring v3.4 as Pry::Slop.
  People can depend on Slop v4 and Pry at the same time without running into version conflicts. ([#1497](pry/pry#1497))
* Fix auto-indentation of code that uses a single-line rescue ([#1450](pry/pry#1450))
* Remove "Pry::Config#refresh", please use "Pry::Config#clear" instead.
* Defining a method called "ls" no longer breaks the "ls" command ([#1407](pry/pry#1407))
* Don't raise when directory permissions don't allow file expansion ([#1432](pry/pry#1432))
* Syntax highlight &lt;tt&gt; tags in documentation output.
* Add support for BasicObject subclasses who implement their own #inspect (#1341)
* Fix 'include RSpec::Matchers' at the top-level (#1277)
* Add 'gem-readme' command, prints the README file bundled with a rubygem
* Add 'gem-search' command, searches for a gem with the rubygems.org HTTP API
* Fixed bug in the `cat` command where it was impossible to use line numbers with files ([#1349](pry/pry#1349))
* Fixed uncaught Errno::EOPNOTSUPP exception when $stdout is a socket ([#1352](pry/pry#1352))
* Display a warning when you cd'ed inside a C object and executed 'show-source' without arguments ([#691](pry/pry#691))
* Make the stagger_output method more reliable by reusing possibly available Pry instance ([#1364](pry/pry#1364))
* Make the 'gem-install' message less confusing by removing backticks ([#1350](pry/pry#1350))
* Fixed error when Pry was trying to load incompatible versions of plugins ([#1312](pry/pry#1312))
* Fixed bug when `hist --clear` led to ArgumentError ([#1340](pry/pry#1340))
* Fixed the "uninitialized constant Pry::ObjectPath::StringScanner" exception during autocomplete ([#1330](pry/pry#1330))
* Secured usage of colours with special characters (RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE) in Pry::Helpers::Text ([#493](pry/pry#493 (comment)))
* Fixed regression with `pry -e` when it messes the terminal ([#1387](pry/pry#1387))
* Fixed regression with space prefixes of expressions ([#1369](pry/pry#1369))
* Introduced the new way to define hooks for commands (with `Pry.hooks.add_hook("{before,after}_commandName")`). The old way is deprecated, but still supported (with `Pry.commands.{before,after}_command`) ([#651](pry/pry#651))
* Removed old API's using `Pry::Hooks.from_hash` altogether
* Removed hints on Foreman support (see [this](ddollar/foreman#536))
* Fixed support for the tee command ([#1334](pry/pry#1334))
* Implemented support for CDPATH for ShellCommand ([#1433](pry/pry#1433), [#1434](pry/pry#1434))
* `Pry::CLI.parse_options` does not start Pry anymore ([#1393](pry/pry#1393))
* The gem uses CPU-less platforms for Windows now ([#1410](pry/pry#1410))
* Add `Pry::Config::Memoization` to make it easier to implement your own `Pry::Config::Default` class.([#1503](pry/pry#1503))
* Lazy load the config defaults for `Pry.config.history` and `Pry.config.gist`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants