Pry v0.12.0 Release Notes
Release Date: 2018-11-04 // over 5 years ago-
Major changes
- โฌ๏ธ Dropped support for Rubinius (#1785)
๐ Features
- โ Added a new command,
clear-screen
, that clears the content of the screen Pry is running in regardless of platform (Windows or UNIX-like) (#1723) - โ Added a new command,
gem-stat
, that prints gem statistics such as gem dependencies and downloads (#1707) - โ Added support for nested exceptions for the
wtf
command (#1791) - โ Added support for dynamic prompt names (#1833)
# pryrc Pry.config.prompt_name = Pry.lazy { rand(100) } # Session [1] 80(main)> [2] 87(main)> [3] 30(main)>
- โ Added support for XDG Base Directory Specification (#1609, #1844, (#1848))
- โ Removed the
simple-prompt
. Usechange-prompt simple
instead. Thelist-prompt
command was removed and embedded aschange-prompt --list
(#1849)
API changes
- The following methods started accepting the new optional
config
parameter (#1809):Pry::Helpers.tablify(things, line_length, config = Pry.config)
Pry::Helpers.tablify_or_one_line(heading, things, config = Pry.config)
Pry::Helpers.tablify_to_screen_width(things, options, config = Pry.config)
Pry::Helpers::Table.new(items, args, config = Pry.config)
You are expected to pass a session-local
_pry_.config
instead of the global one.- โ Added new method
Pry::Config.assign
, for creating a Config non-recursively (#1725) - โ Added
Pry.lazy
, which is a helper method for values that need to be calculated dynamically. Currently, onlyconfig.prompt_name
supports it (#1833) Pry::Prompt
responds to.[]
,.all
&.add
now. ThePry::Prompt.add
method must be used for implementing custom prompts. See the API in the documentation for the class (#1846)
๐ฅ Breaking changes
- โ Deleted the
Pry::Helpers::Text.bright_default
alias forPry::Helpers::Text.bold
(#1795) Pry::Helpers.tablify_to_screen_width(things, options, config = Pry.config)
requiresoptions
ornil
in place of them.Pry::Helpers::Table.new(items, args, config = Pry.config)
requiresargs
ornil
in place of them.- Completely revamped
Pry::HistoryArray
(#1818).- It's been renamed to
Pry::Ring
(#1817) - The implementation has changed and as result, the following methods were removed:
Pry::Ring#length
(usePry::Ring#count
instead)#empty?
,#each
,#inspect
,#pop!
,#to_h
- To access old Enumerable methods convert the ring to Array with
#to_a
- Fixed indexing for elements (e.g.
_pry_.input_ring[0]
always return some element and notnil
)
- It's been renamed to
- Renamed
Pry.config.prompt_safe_objects
toPry.config.prompt_safe_contexts
- โ Removed deprecated
Pry::CommandSet#before_command
&Pry::CommandSet#after_command
(#1838)
๐ Deprecations
- Deprecated
_pry_.input_array
&_pry_.output_array
in favour of_pry_.input_ring
&_pry_.output_ring
respectively (#1814) - ๐ Deprecated
Pry::Command#text
. Please use#black
,#white
, etc. directly instead (as you would with helper functions fromBaseHelpers
andCommandHelpers
) (#1701) - Deprecated
_pry_.input_array
&_pry_.output_array
in favour of_pry_.input_ring
and_pry_.output_ring
respectively (#1817) - ๐ Deprecated
Pry::Platform
. UsePry::Helpers::Platform
instead. Note thatPry::Helpers::BaseHelpers
still includes thePlatform
methods but emits a warning. You must switch toPry::Helpers::Platform
in your code (#1838, (#1845)) - ๐ Deprecated
Pry::Prompt::MAP
. You should usePry::Prompt.all
instead to access the same map (#1846)
๐ Bug fixes
- ๐ Fixed a bug where
cd Hash.new
reportedself
as an instance of Pry::Config in the prompt (#1725) - Silenced the
Could not find files for the given pattern(s)
error message coming fromwhere
on Windows, whenless
or another pager is not installed (#1767) - ๐ Fixed possible double loading of Pry plugins'
cli.rb
on Ruby (>= 2.4) due to therealpath
changes while invokingrequire
(#1762, #1774) - ๐ Fixed
NoMethodError
on code objects that have a comment but no source when invokingshow-source
(#1779) - ๐ Fixed
negative argument (ArgumentError)
upon pasting code with tabs, which used to confuse automatic indentation (#1771) - ๐ Fixed Pry not being able to load history on Ruby 2.4.4+ when it contains the null character (#1789)
- ๐ Fixed Pry raising errors on
cd
'ing into some objects that redefinemethod_missing
andrespond_to?
(#1811) - ๐ Fixed bug when indentation leaves parts of input after pressing enter when Readline is enabled with mode indicators for vi mode (#1813, #1820, #1825)
- ๐ Fixed
edit
not writing to history (#1749)
Other changes
- ๐ Deprecated the
Data
constant to match Ruby 2.5 in thels
command (#1731)