code
as a supported editor on Pry::Editor
(#2236)_out_
sticky local variable could return
wrong results (#2201)--plugins
option. It shows a warning now
(#2180)?
an alias to show-source -d
(#2133)Deleted support for plugin autoloading
(#2119). In order to load a Pry plugin
you must require
it from your pryrc
or add it to your Gemfile.
# ~/.pryrc
require 'pryrc'
Pry::Config
raising NoMethodError
on undefined option instead of
returning nil
(usually invoked via Pry.config.foo_option
calls)
(#2126)help
command not displaying regexp aliases properly
(#2120)pry-backtrace
not working (#2122)--
(or -
) when
launching Pry from shell
(#1902)Pry::Config::LazyValue
& Pry::Config::MemoizedValue
, which allow
storing callable procs in the config
(#2024)rc_file
config option that tells Pry the path to pryrc
(#2027)--code
flag to the wtf
command, which shows code for each
backtrace frame (#2037)Pry::Prompt
is a class now and it can be instantiated to create new prompts
on the fly that are not registered with Pry::Prompt#add
. Learn more about
its API in the docs (#1877)Deprecated Pry.config.exception_whitelist
in favor of
Pry.config.unrescued_exceptions
(#1874)
Deprecated Pry.config.prompt = Pry::Prompt[:simple][:value]
in favor of
Pry.config.prompt = Pry::Prompt[:simple]
when setting Pry prompt via
pryrc
. Pry::Prompt[:simple]
would return an instance of Pry::Prompt
instead of Hash
(#1877)
Deprecated setting prompt via an array of two procs: (#1877)
# Deprecated, emits a warning.
Pry.config.prompt = [proc {}, proc {}]
This will be removed in the next release.
Deprecated the show-doc
command. The show-source -d
is the new recommended
way of reading docs (#1934)
Deprecated Pry::Command#_pry_
. Use Pry::Command#pry_instance
instead
(#1989)
Pry::Platform
(#1863)Pry#{input/output}_array
(#1884)Pry::Prompt::MAP
(#1866)Pry::Helpers::BaseHelpers
such as mac_osx?
,
linux?
, windows?
, windows_ansi?
, jruby?
, jruby_19?
, mri?
,
mri_19?
, mri_2?
(#1867)Pry::Command#text
(#1865)Pry::Method#all_from_common
(#1868)install-command
(#1979)Pry::Helpers::BaseHelpers#command_dependencies_met?
(#1979)gem-cd
, gem-install
, gem-list
, gem-open
,
gem-readme
, gem-search
, gem-stats
(#1981)edit-method
and show-command
(#2001)Pry::Command#disabled_commands
(#2001)Pry::BlockCommand#opts
(use #context
instead)
(#2003)Pry.lazy
(use Pry::Config::LazyValue
instead)
(#2024)Pry.config.prompt_name
can return a
Pry::Config::Lazy
instead of expected instance of String
(#1890)LoadError
being raised when using auto completions and Bundler
(#1896)Pry.input_ring
doesn't append duplicate elements
(#1898)Binding#source_location
(#1904)winsize
when custom output
is passed to Pry
(#2045)XDG_CONFIG_HOME
& XDG_DATA_HOME
precedence. When these env variables
are set, Pry no longer uses traditional files like ~/.pryrc
&
~/.pry_history
. Instead, the env variable paths are loaded first
(#2056)$SAFE will become a normal global variable in Ruby 3.0
warning on
Ruby 2.7 (#2107)whereami -c
cannot show beginning of the class, which is on
the same line as another expression
(#2098)Object#owner
is defined, which results into somewhat broken
method introspection (#2113)Pry::Prompt#[]
is invoked
(#1855)less
pager not working when it's available
(#1861)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
. Use change-prompt simple
instead. The
list-prompt
command was removed and embedded as change-prompt --list
(#1849)
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, only config.prompt_name
supports it
(#1833)
Pry::Prompt
responds to .[]
, .all
& .add
now. The Pry::Prompt.add
method must be used for implementing custom prompts. See the API in the
documentation for the class (#1846)
Pry::Helpers::Text.bright_default
alias for
Pry::Helpers::Text.bold
(#1795)Pry::Helpers.tablify_to_screen_width(things, options, config = Pry.config)
requires options
or nil
in place of them.Pry::Helpers::Table.new(items, args, config = Pry.config)
requires args
or nil
in place of them.Pry::HistoryArray
(#1818).
Pry::Ring
(#1817)Pry::Ring#length
(use Pry::Ring#count
instead)#empty?
, #each
, #inspect
, #pop!
, #to_h
#to_a
_pry_.input_ring[0]
always return some
element and not nil
)Pry.config.prompt_safe_objects
to Pry.config.prompt_safe_contexts
Pry::CommandSet#before_command
&
Pry::CommandSet#after_command
(#1838)_pry_.input_array
& _pry_.output_array
in favour of
_pry_.input_ring
& _pry_.output_ring
respectively
(#1814)Pry::Command#text
. Please use #black
, #white
, etc. directly
instead (as you would with helper functions from BaseHelpers
and
CommandHelpers
) (#1701)_pry_.input_array
& _pry_.output_array
in favour of
_pry_.input_ring
and _pry_.output_ring
respectively
(#1817)Pry::Platform
. Use Pry::Helpers::Platform
instead. Note that
Pry::Helpers::BaseHelpers
still includes the Platform
methods but emits a
warning. You must switch to Pry::Helpers::Platform
in your code
(#1838,
(#1845))Pry::Prompt::MAP
. You should use Pry::Prompt.all
instead to
access the same map (#1846)cd Hash.new
reported self
as an instance of Pry::Config
in the prompt (#1725)Could not find files for the given pattern(s)
error message
coming from where
on Windows, when less
or another pager is not installed
(#1767)cli.rb
on Ruby (>= 2.4) due to
the realpath
changes while invoking
require
(#1762,
#1774)NoMethodError
on code objects that have a comment but no source when
invoking show-source
(#1779)negative argument (ArgumentError)
upon pasting code with tabs, which
used to confuse automatic indentation
(#1771)cd
'ing into some objects that redefine
method_missing
and respond_to?
(#1811)edit
not writing to history
(#1749)Data
constant to match Ruby 2.5 in the ls
command
(#1731)See pull request #1679.
See pull request #1670
mac_osx?
and linux?
utility functions to Pry::Helpers::BaseHelpers.See pull request #1668.
See pull request #1673.
Pry::Method::WeirdMethodLocator#find_method_in_superclass
that users of the Hanami web framework experienced and
reported since 2015.See pull request #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.
no_color
and no_paging
,
for performance reasons. Improve the documentation of both methods.See pull request #1691.
String#pp
output color.See pull request #1674.
ls
output by default, use the -d
switch to see them.newline
argument and pass it on to PP. (#1603)less
or system pager pager on MS Windows if it is available. (#1512)Pry.configure
as an alternative to the current way of changing configuration options in .pryrc
files. (#1502)Pry::Config::Behavior#eager_load!
to add a possible workaround for issues like (#1501)cat
command where it was impossible to use line numbers with files (#1349)hist --clear
led to ArgumentError (#1340)pry -e
when it messes the terminal (#1387)Pry.hooks.add_hook("{before,after}_commandName")
). The old way is deprecated, but still supported (with Pry.commands.{before,after}_command
) (#651)Pry::Hooks.from_hash
altogetherPry::CLI.parse_options
does not start Pry anymore (#1393)Pry::Config::Memoization
to make it easier to implement your own Pry::Config::Default
class.(#1503)Pry.config.history
and Pry.config.gist
.watch
command that lets you see how values change over time.Pry.auto_resize!
method
.pryrc
if you're braveplay
now has an -e
/--expression
flag
~/.pry_history
after every input, not just at quit.pryrc
location by setting $PRYRC
env var (#893)Pry.config.prompt_safe_objects
whereami
is now aliased to @
whereami
:
-m
shows the surrounding method-c
shows the surrounding class-f
shows the entire filereadline
until Pry is started for the first time. (#1117)_pry_.config.completer = nil
list-prompts
command. (#1175)
change-prompt
command. (#1175)
list-inspectors
command. (#1176)
change-inspector
command. (#1176)
show-source -e
. (#1185)
Pry.config.windows_console_warning
(#1218)
Pry.config.windows_console_warning = false
.play
command.
-p
prints the code before playing it.-e
allows you to play expressions from your session.cd -
to switch to the previous binding.ffi
gem on JRuby (#1158)pry-bond
pluginopenstruct
(#1096)~> 1.1.0
gem-install
command can require gems like net-ssh
thanks to better
logic for guessing what path to require. (#1188)toggle-color
command toggles the local _pry_.color
setting instead of the
global Pry.color
.Pry::CLIPPED_PRINT
to include a hex representation of object ID when
printing a return value. (#1162)Pry#last_exception=
now supports exception objects that have been frozen.binding.pry
inside .pryrc
file now works, with some limitations (@richo / #1118)ls
(#984)ls -c <anything>
(#891)mathn
stdlib was loaded (#872)hist
's --exclude-pry
switch (#874)gem-install
on JRuby (#870)edit
ignore -n
/--no-reload
flag and disable_auto_reload
config
in cases where the user was editing a tempfilegem-cd
use the most recent gem, not the oldestinstall-command
honor .gemrc
switches (#666)hist
with no parameters show just the current session's history (#205)
hist --all
shows older history-s
/--super
flag of show-source
/show-doc
work when method name is
being inferred from context (#877)--installed-plugins
flag to --plugins
edit
regarding recognition of file names without suffix.CommandSet#commands
, sometimes referenced through Pry.commands.commands
,
renamed to CommandSet#to_hash
. It returns a duplicate of the internal hash
a CommandSet uses.CommandSet#keys
is now an alias of CommandSet#list_commands
._pry_.config
(local) and not Pry.config
(global). (#1096)
_pry_.config
inherits default values from
Pry.config
but can override them locally.rake pry
now accepts switches prefixed with _
(e.g., rake pry _v
)IO
s and accept streaming output
_pry_.pager.page
and _pry_.pager.open
.Pry
class has been broken up into two smaller classes.
Pry
represents non-UI-specific session state, including the eval stringPry::REPL
controls the user-facing interfacePry.start
now has a :driver
option that defaults to Pry::REPL
ColorPrinter
subclass of PP
for colorized object inspection[]
and []=
methods to CommandSet
, which find and replace commands
Pry.commands["help"] = MyHelpCommand
Pry.config.input_stack
(and the input stack concept in general) no longer
existsPry::Terminal
class that implements a number of different
methods of determining the terminal's dimensionsReplTester
class for high-level simulation of Pry sessions in testsPry.main
. Returns the special instance of Object referenced by self of
TOPLEVEL_BINDING
: "main".Pry.view_clip()
from Fixnum to Hash to support
returning a string with or without a hex representation of object ID. (#1162)output
and pager
objects will now strip color-codes, so commands should
always print in color.state
hash that is persistent across invocations of the command
in the same pry session.reload-code
with no args reload "current" file (#920)pry --gem
(see 19bfc13aa)show-source
now works on commands created with create_command
whereami
now has -m
(method), -c
(class), and -f
(file) optionsshow-source
now falls back to superclass (and displays warning) if it
can't find class codeshow-source
/show-doc
now indicate when -a
option is availableARGV
instead of command
parameters (#828)reload-method
as alias for reload-code
(for backwards
compatibility)Readline.output
if it is not a tty (see 1538bc0990)Pry.last_internal_error
, useful for devs debugging commandsPry.run_command
ls
output:requires_gem => "jist"
to gist
command (so dependencies can be
installed via install-command
)edit
commandgist
on Windows: rescue Jist::ClipboardError
rather
than letting the scary error spill out to users and potentially having them
think the gist didn't post.gist
command where I neglected to remove
a call to a non-existent method (no_arg
) which was called when
gist
is invoked with no parametersslop
to ~> 3.4
bond
gem install bond
reload-code
command
reload-code MyClass
, reload-code my_method
,
reload-code my_obj
show-source
show-source
can now extract source for:
show-command
is now removedgist
, play
, and save-file
now infer object type without requiring flags
play MyClass
, play my_file.rb
, play my_method
edit
edit
can now edit:
edit-method
is now removededit MyClass
, edit my_file.rb
, edit my_method
amend-line
and play
now properly indent code added to input bufferpry -rubygems -r./a.rb
) (#674)pry -e ':one' -e ':two'
)--patch
switch for edit --ex
command (#716)$PAGER
environment variable (#736)disable-pry
command (#497)before_eval
and after_eval
Array#<tab>
in show-source
and show-doc
gem-install
immediately requires gems-l
switch for ls
command (displays local variables)gem-open
commandfix-indent
commandls
output--no-line-numbers
switch for whereami
command--lines
switch for play
commandfind-method
(#652)binding_impl_method
local in scratch bindings (#622)edit-method -p
changing constant lookup (#645).pryrc
loading twice when invoked from $HOME
directory (#682)pwd
(#675)show-method
not supporting String::new
notation (#719)whereami
command not showing correct line numbers (#754)while/until do
loops indentation (#787)--no-plugins
switch (#526).pryrc
loading with wrong __FILE__
less
is not available^D
in nested REPLslop
to version 3 (#561)gist
gem to jist
(#590)method_source
to 0.8--hist
, -o
and -k
flags to gist
command (#572)show-source
/show-doc
on methods defined in class_eval
(#584)show-source
/show-doc
on gem methods defined in C (#585)--disable-plugin
and --select-plugin
options (#596)cd -
to switch between bindings (#597)Pry.config.should_load_local_rc
to turn off ./.pryrc
(#612)pry <file>
ri
commandbefore_eval
hookreq
command (#554)Array#pretty_print
on Jruby (#568)edit
on Windows (#575)find-method
in the presence of badly behaved objects (#576)whereami
in ERb files on Rails (#580)ansicon
to give JRuby Windows users colour (#606)show-source
for modules (#613)whereami
command when not in a binding.pry
(#620)=begin
... =end
) (#622)__binding_impl__
to __pry__
$EDITOR
cat
command on files with unknown extensionsZeroDivisionError
in correct_indentation
(#558)ZeroDivisionError
in correct_indentation
(#558)NoMethodError: undefined method
winsize' for #<IO:>` (#549)exit
(550)show-doc
failing on some core classes, like Bignum
correct_indentation
's auto-colorization respect Pry.color
show-source
/show-doc
docs
-a
switch applies to classes as well as modulesshow-source
command can now show class/module source code
-a
to see all monkeypatchesruby18_source_location
gem in MRI 1.8show-doc
command can now show class/module docs
-a
to see docs for all monkeypatchesruby18_source_location
gem in MRI 1.8find-method
command
grep
, very cool (thanks swarley)pry-coolline
now works properlyalias_command
method now much more powerful
alias_command "lM", "ls -M"
whereami
is now more intelligent
raise-up
command
\
are incomplete (kudos to fowl)edit-method -n
no longer blocks (thanks misfo)ls
show-doc
ruby18_source_location
on MRI 1.8, when available
:quiet => true
option added to Pry.start
, turns off whereami
ls
Pry.config
optionsls
output
hist --save
saved colors! FIXEDMAJOR NEW FEATURES
complete CHANGELOG:
MAJOR NEW FEATURES:
complete CHANGELOG:
edit
with no arguments now edits the current or most recent expressionedit
auto-reloads .rb files (need to specify -n to suppress)MAJOR NEW FEATURES:
complete CHANGELOG:
whereami
format - includes line numbers and formatted the same, etccd /
pry -r
requires now happen after plugin loading (so as not to interfere withcd
commandhistory
aliasls
command, so it can properly display members of Object and classes, and BasicObject, etccode
is syntax highlighted using coderaywhereami
command now accepts parameter AROUND, to display AROUND lines on eitherside of invocation line.whereami
is invoked even if no method exists in current context (i.e in rspec tests)whereami
invocation in HOOKS by checking for unknown.rb rather than just ir_b
gemSet
class added to list of classes that are inspectedcd /
for breaking out to pry top level (jump-to 0)-e
option work in a more effective way for pry
command line invocationcommand
method from CommandBase now accepts a :keep_retval arg that determines if command value is returned to pry session or just nil
(nil
was old behaviour)此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。