Skip to content


Subversion checkout URL

You can clone with
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: pry/pry
head fork: pry/pry
Commits on Jan 01, 2013
@rf- rf- Make the .gemspec canonical instead of generated fcad0a4
@rf- rf- Merge pull request #790 from pry/live_gemspec
Make the .gemspec canonical instead of generated
@banister banister pull more show-source/show-doc methods into their superclass c4dc8cf
@banister banister refactor Pry::Command::ShowInfo to make codeclimate happier 3da2c4d
Commits on Jan 02, 2013
@banister banister minor cleanup to whereami command dcdea09
@banister banister bunch of random refactorings to different commands 4d38473
@banister banister Pry::Editor, Pry::Command::Whereami: more refactorings e647957
@banister banister MethodPatcher#with_method_transactions: alias --> alias_method ef8b71a
@banister banister amend-line: refactor + overengineer the f*ck out of it, for the lulz ba1f761
Commits on Jan 03, 2013
@banister banister Pry::Command::Edit: renamed some methods to improve grokkability 5302e3a
@banister banister Pry::WrappedModule::Candidate: break up some large methods e41a9e1
@banister banister Pry::WrappedModule: attempt to simplify a conditional f81dc1b
@kyrylo kyrylo Extract absolute path finding into its own method
Indent some wrongly indented code, too.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Rename "fn" to "filename" in some places
Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Fix indentation of the protected method
Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Simplify method chain (use 'map.with_index')
Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Simplify `Pry::Code#to_s`
Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Ensure `max_width` is always an Integer
Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Break up `Pry::Code#between`
Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Refactor `Pry::Code#between`
Split some parts of it into small methods.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Add comments to protected methods of `Pry::Code`
Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Revert "Simplify method chain (use 'map.with_index')"
This reverts commit a1f0a00.

It doesn't compatible with 1.8.7, ree, rbx-18mode, jruby-18mode.
@banister banister Slightly refactor help command bcfa5eb
@banister banister find-method command: break up large/complicated methods a1a6306
@banister banister minor refactor to wtf command a42eec8
@banister banister find-method refactor: 'pattern' becomes a method 1dda70c
Commits on Jan 04, 2013
@kyrylo kyrylo Assign default value to `:listing` option
When you create a class command, there is a problem with `:listing`
option, which doesn't carry the correct default value. Consider the

  class MakeMeHappy < Pry::ClassCommand
    match 'woot'

`MakeMeHappy` command matches against 'woot' String, but its `:listing`
option is set to the "nil" String, which is incorrect. We can fix it by
setting `:listing` explicitly:

  command_options :listing => 'woot'

It's a repetitive task, so we can automate it. Holy smoke, this why we
all use computers, after all!

With help of this commit there is no need to set `:listing` manually.
Pry will handle it for you.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Rename "Fixnum" to "Integer" in YARD docs
Signed-off-by: Kyrylo Silin <>
Commits on Jan 05, 2013
@kyrylo kyrylo Extract out some code from Code class
Create a new class called `LOC`, which represents a tuple of a line and
a line number (lineno). `LOC` contains methods that operate on a line.
For example, you can colorize it, or add a line number. The idea is to
make the code of `Pry::Code` more readable. It is clear to me that the
current code allows us to single out a new unit: a line of code.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Add some comments for `Pry::Code::LOC`
Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Rename `add_line_numbers` to `add_line_number`
Rename the instance method of `Pry::Code::LOC`.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Document `Pry::Code::LOC#add_marker`
I thought about some changes that I could make with this method, but
then I realised that it's already quite good.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Change @yield YARD tag for `Pry::Code#select`
It yields `LOC` now. Oh, and also prettify some default method

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Implement `Pry::Code::CodeRange`
Extract some protected methods from `Pry::Code` and add them into its
own class. Name it `CodeRange`, because it operates on numbers and
represents a range of lines of code.

This commit simplifies `Pry::Code`.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Move `LOC` and `CodeRange` to their own files
`Pry::Code` is not cluttered anymore.

Signed-off-by: Kyrylo Silin <>
@banister banister renamed reload-method to reload-code and extended functionality
Should now be able to reload any valid code object, including: methods, modules, commands, procs, etc
@banister banister reload-code: use obj_name (rather than code_object) in output strings 6254b8a
@banister banister Allow 'edit self' and 'reload-code self'
This didn't work due to a quirk in Pry::CodeObject.lookup() which purposely ignores 'expressions'
as they can be methods, which are dangerous to lookup. We now make an exception when the expression is 'self'

This code needs to be refactored as we have ridiculosu method names like  `def variable_or_constant_or_self?`
and we have methods like this in a couple of places. Refactor pls.
@banister banister Pry::CodeObject, Pry::WrappedModule: introduce safe_to_evaluate? method
Unsure where to put safe_to_evaluate? method, so it's currently duplicated in
both the mentioned modules. If we can simply switch to a defined?(str) != "method" test
then we could put the method on Pry::Method.looks_like_a_method?(str, binding) and call it from both locations, avoiding duplication.
Commits on Jan 06, 2013
@banister banister set_file_and_dir(): now takes optional _pry_ and target args d77bfe2
@banister banister refactor cat command
Put each output formatter (input expression, exception, file) into its own class.
Commits on Jan 07, 2013
@kyrylo kyrylo Code: extract `#max_lineno_width` from `#to_s`
"Code" means `Pry::Code`.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Code::LOC: tuple should be "reader"
There is no need to expose the "writer" method.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Code::LOC: add #== and use it in Code#==
And fix a typo in comments.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Create Pry::Code::EXTENSIONS
There is no need to create the hash of supported languages all the time
as the method gets called.

As always, fix some stylistics und stuff :-)

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Code#to_s: standardise method chain
Make it as in `Code#raw` (they both do similar things).

And fix typos, typos, typos.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Use `block` instead of `blk` across-the-board
Everywhere else in the code it's the very `block`.

Rename `Code#get_abs_path` to `#abs_path`.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Code#to_s: don't loop thrice
One loop is enough to complete the task.

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Code: simplify `.from_file` class method
1. Use a temporary variable to hold code;
2. Instantiate `Pry::Code` only in one place;
3. Refactor reading from a file (a credit flies to John Mair).

Signed-off-by: Kyrylo Silin <>
@L2G L2G Fix calls to (GH issue #792)
Suffix of "*.rb" caused temp files to be named with "*.rb"
at the end, literally.  Not all file systems like that, and
it's almost certainly not what was intended.
Commits on Jan 08, 2013
@kyrylo kyrylo Merge pull request #796 from L2G/gh-792
Fix calls to (GH issue #792)
@kyrylo kyrylo Remove legacy methods from helpers
From BaseHelpers:

  * #stub_proc
  * #create_command_stub

From CommandHelpers:

  * #retrieve_code_object_from_string
  * #file_and_line_from_binding
  * #make_header

Signed-off-by: Kyrylo Silin <>
@kyrylo kyrylo Extract out gem related code to Pry::Rubygem
And fix some typos, and prettify some lines.

Signed-off-by: Kyrylo Silin <>
@rking rking Intermediate merge step 4e89649
@rking rking Immediate output from Guard
(So you know it's not Guard lag, but test suite start)
@rking rking ls columns improvement
Now is like /bin/ls, sorting downward, shrink-wrapping columns, and
minimizing row usage as best as I know how.
@rking rking Downgrade each_with_object to manual accumulation 889ace4
@rking rking Fix my goofy indentation 0eccbbb
@rking rking More lenient assertion for whereami -n 982b4fa
Commits on Jan 09, 2013
@kyrylo kyrylo Implement `Rubygem::install`
Use the code of `gem-install` command as a basis.

Signed-off-by: Kyrylo Silin <>
@banister banister Pry::Command::Cat::FileFormatter: make format() private 8620676
@banister banister Reimplemented play, save-file with Pry::Command::CodeCollector
Pry::Command::CodeCollector is a mixin that extracts out shared
functionality from play, save-file and gist. Gist is yet to be
@banister banister Pry::CodeObject: binding_lookup --> empty_lookup 0608c0e
@banister banister implement whereami -n (exclude line numbers) 32eb6ca
@banister banister Pry::Command::CodeCollector: replace module inclusion with delegation
And implement play and save-file using the new delegator. 'gist' still needs
to be re-implemented using CodeCollector.

Couldn't write a test for `play --lines 4..5` with implied target.eval("__FILE__") parameter,
need to come up with a decent test.
@ConradIrwin ConradIrwin Add support for ENV["LINES"] which works
ENV["ROWS"] doesn't for me.
@banister banister WrappedModule now ignores def_delegator methods, fixes #801
If a class had most of its methods defined by def_delegators, the module extraction code would break.
This was due to Pry::WrappedModule looking for the class definition in fowardable.rb. We now
just simply reject all methods that have source_location.first =~ /forwardable\.rb/
@banister banister Try to simplify edit.rb
* Remove ContextLocator, inlining the class in edit.rb instead.
* Pass explicit parameters into MethodPatcher and ExceptionPatcher, rather than passing 'self'
  and using def_delegators

Hopefully this won't upset codeclimate too much!
@banister banister oops, forgot to remove context_locator require 3669832
@kyrylo kyrylo Prettify command descriptions, switches and stuff
Wrap command descriptions to 80 characters. Convert some string options
to symbols (where possible). Align options in code. Remove dots in the
end of switch descriptions.

Signed-off-by: Kyrylo Silin <>
@banister banister Improve Pry::Command::Edit
* put all file and line location logic into FileAndLineLocator module
* pass explicit parameters to ExceptionPatcher and MethodPatcher (rather than just 'self')
@rking rking Extract Table to its own file 139a2a7
Commits on Jan 11, 2013
@banister banister Pry::CodeObject: remove unnecessary 'target' parameter
Since we can access 'target' via _pry_.current_context

* We also update a few files (code_collector/show_info) that need to be updated for this change
@banister banister edit command: add --method option
* --method doesn't accept any parameters, it only edits the 'current' method associated
with the binding. It's equivalent to 'edit-method' (with no args).
* This option is necessary as 'edit' by itself edits the last expression.
* Note that --method doesn't just edit the current method, if no method exists (i.e binding.pry was not put
inside a method context) then it edits the current OBJECT instead.

* explicitly restrict --method to *just* methods and not allow it to fall back to objects?
* allow --method to take a parameter that must be a method object? e.g --method Pry#repl works
but --method Pry would fail ?
@rking rking Update show-file docs 3b52fcb
Commits on Jan 12, 2013
@swarley swarley Fixed using a preprocessor just looking for --no-plugins in the ARGV …
…array using slop. Dirty and effective fix.

Took out the trash from the dev process
@kyrylo kyrylo edit: Add example for `--ex --patch` combination
And make the two-column examples.
@ConradIrwin ConradIrwin Pass SyntaxErrors to error handler too. [Fixes #774] d3d29c4
@banister banister add edit-method stub: deprecation warning, use edit f94eb5a
@banister banister Improved Pry::CodeCollector so it accept multiple -i/o ranges
i.e play -i 1..3 -i 5..9 now works
@banister banister added spec for save-file for multiple -i ranges 0ebc315
@banister banister updated play_spec.rb to check for errors
Also added play spec for multi-ranged -i options but does not work
for some weird reason?!
@banister banister added fix-indent command
Re-indents the eval_string, useful for amend_line and play, etc
@banister banister show-source: prettier error messages a604fd6
@banister banister play and amend-line: now use fix-indent to correct broken indentation 703f42b
@kyrylo kyrylo Add headings for methods in the output of `ls`
You will see headings when a table has more than 35 methods.
Otherwise, there is no need in them.
@AndrewVos AndrewVos refactor #process 17d485b
@AndrewVos AndrewVos refactor the #process method
This has created a whole lot of additional methods. Perhaps these should
be moved into some sort of Presenter (puke) classes.
@AndrewVos AndrewVos stop passing so many parameters around
The write_out* methods all use to take multiple parameters which were
actually available without having to pass them around. Made these
parameters ivars and attr_reader'ed all of them.
@AndrewVos AndrewVos don't use unneccessary meta-programming 3e8c703
@AndrewVos AndrewVos readability in write_out methods
thanks to @locks for this one
@AndrewVos AndrewVos refactor raise_errors_if_arguments_are_weird as per @rking advice 2c4c784
@AndrewVos AndrewVos clean up redundant code 05487af
@AndrewVos AndrewVos extract method on redundant code cee34d9
Commits on Jan 14, 2013
@kyrylo kyrylo Revert "Add headings for methods in the output of `ls`"
This reverts commit 1c33a73.

Looks unpleasant for most of Pry users.
@Mon-Ouie Mon-Ouie Made sure completions proc do not return nil
The completion proc returning nil causes errors in input systems that only
expect strings (e.g. Coolline).
@kyrylo kyrylo gist_spec: remove some repetitive code 5871054
@kyrylo kyrylo Edit: handle blanks in filenames correctly
Also, move path escaping to `Editor` class. The test is currently
failing (looks like a bug in `Editor`).
@ConradIrwin ConradIrwin Only shellword escape filenames in system calls on linux 15caf5f
@ConradIrwin ConradIrwin Remove needless old_editor restoration
Unfortunately nested assignments to @old_editor meant that the
original @old_editor was permanently lost. This caused sporadic
failures of spec/editor_spec.rb which was relying on Pry.config.editor
containing a string.
@ConradIrwin ConradIrwin Fix indentation (HARDER) d29f6b5
@kyrylo kyrylo Use proper temp directories for each OS
Also, there was a failing test on Windows ("should shell-escape files").
You will see it if you're running tests on Windows. Make it conditional.
@kyrylo kyrylo Fix errors in tests on Windows
Some tests are still failing, though. This commit fixes wrong usage of
temporary paths on Windows. Please, note: the `edit` command is working
well; the issue is in poor tests.

Prettify some ugly code in `spec/editor_spec.rb`.
@kyrylo kyrylo Remove redundant call to Shellwords.escape
The "edit" command already intelligently escapes arguments, if need.
This commit also fixes four failing tests on Windows.
@kyrylo kyrylo Fix errors on Rubinius and JRuby
These implementations have slightly different APIs for getting your
temp directory path.
@banister banister play specs: rewrite -i spec to use redirect_pry_io
This is because pry_tester doesn't work when the eval_string is mutated by a command
@banister banister Pry.config.collision_warning = true by default
Let's try this, if it annoys people, we'll just revert it in a patch level
@kyrylo kyrylo Fix errors in "edit_spec.rb" and "editor_spec.rb"
Basically, the condition was a bit wrong. Let's hope this commit fixes
@ConradIrwin ConradIrwin Remove output.write
Many plugins only define a puts method on the output object. This change
removse the ability to customize the formatter used when outputting
variables in `ls`. We should reconsider the best way to do this.
@kyrylo kyrylo Fix indentations for the gist command description 5ceab36
@kyrylo kyrylo [GEM] Depend on Slop "~> 3.4"
Slop v3.4.0 includes new syntax for subcommands. And we're going to
utilise it.
@kyrylo kyrylo Remove old subcommands cruft
  * use a plain old Slop instance instead of `Options`;
  * remove `ClassCommand::Options` and its tests;
  * add clearer subcommand example (for `Command#subcommand` method);
  * refactor `ClassCommand#slop`;
  * refactor `ClassCommand#complete`.

Slop v3.4.0 has introduced full-featured subcommands. There is no need
in Pry specific code anymore.
@kyrylo kyrylo Update relevant tests in "command_spec.rb"
Make them use the new Slop syntax.
@kyrylo kyrylo Update examples for ClassCommand#subcommands 61326c0
@kyrylo kyrylo Update hist command to the new Slop API
It was creating a new Slop instance for its own needs, thus and so
remove the previous abstraction for Slop commands. The
`ClassCommand::Options` class should be removed because we don't need it
@banister banister save-file passes on windows :D e63a833
Commits on Jan 15, 2013
@banister banister Pry::Command::CodeCollector: add #file attribute
This allows callers to know that CC is working on a file rather than ruby code.
@banister banister edit: ensure 'edit --ex' always edits the exception
There was a bug where if 'edit --ex' was invoked in a patched method context
it would instead to the equivalent of 'edit --method' (patching the current method
rather than the exception)
@banister banister gist: Use Pry::CodeCollector (like play/save-file)
This enables a simplified UI, i.e: gist my_file.rb instead of gist -f my_file.rb
and `gist my_method` instead of `gist -m my_method`. Unfortunately, we had to kill our
tests in the process of doing this (gist_spec.rb is just commented out) - however since play
and save-file have tests and they use the same Pry::CodeCollector object 'gist' is indirectly
tested. Nonetheless, we should re-add tests at some point
@banister banister Add deprecated_commands API
And rewrite edit-method / show-command to use this API.
@banister banister Thread.current -> Pry.current 5e3a3f0
@banister banister turn Pry.config.collision_warnings back off
This was a horrible mistake, it's stupidly annoying

* in the case of 'rake pry' it warngs every time we do 'cd' (since 'cd' is a top-levle method
  defined by rake)

That's all i can think of right now, but that's still annoying enough.
@kyrylo kyrylo Remove "notes.yml" f172177
Commits on Jan 16, 2013
@kyrylo kyrylo Prepare CHANGELOG for the new release 2fd0e1b
@banister banister Edit::MethodPatcher: remove unnecessary assignment e53af39
@banister banister Version 0.9.11 release
Final adjustments made to CHANGELOG and CONTRIBUTORS
@banister banister v0.9.11.1 bugfix
* forgot to remove 'no_arg' from Pry::Command::CodeCollector, this method no longer exists
and so 'gist' (when not given any params) would break. Replaced no_arg with empty string ""
so that 'gist' gists current object/method by default.
@banister banister updated CHANGELOG for 6fdb393
@banister banister gist: window's fix for broken clipboard 19aa778
@banister banister bugfix for windows
minor bug fix for gist on windows, rescuing Jist::ClipboardError
rather than letting the scary error spill out to users and potentially
have them think the gist didnt post.
Commits on Jan 17, 2013
@kyrylo kyrylo Command: fix typo in comments 24437c7
@banister banister gist: re-add 'jist' gem dependency with :requires_gem
Oops, forgetting this meant that 'gist' command would error out with
ugly messages rather than prompting the user to 'install-command'
@banister banister Fix Pry.run_command
The problem was that Pry#rep() no longer works on its own, it's
necessary to use Pry#repl() instead. This is because many new API, like
Pry::CodeObject.lookup now get the target binding directly from the _pry_ instance
(Pry#current_context), rather than requiring it to be passed in
separately. This saves us a parameter.

The reason Pry#rep doesnt work with Pry::CodeObject.lookup (and so
show-source/show-doc etc) is that the binding_stack is only set up in
Pry#repl_prologue, and it is the binding_stack (via Pry#current_context)
that is accessed by Pry::CodeObject and pals.
@banister banister add some missing pieces from CHANGELOG e1d9152
@rking rking Bump version (it was conflicted anyway) fd392b6
@rking rking Add Pry.auto_resize! to respond to width changes.
- Opt-in because we aren't sure where it doesn't work
- Not Coolline-aware
- Otherwise a big improvement
@rking rking Adjusting ls output for voluminous output
The previous table output was geared mostly for `ls _pry_`, which isn't
a common of hierarchy. After feedback from users such as @envygeeks, we
found a few tweaks that would help the really-small layers such as those
found in Rails or in small classes, namely:

- Rolling it up onto one line, if possible
- Highlighting the heading in the colors familiar to users of GNU ls for
  "directory" style

Additionally, I took the opportunity for toning down the
private/protected method colors, because before they were green and
yellow, now they're both "muted terminal blue"

Without the ability to really get in and really distinguish colors (e.g.
using 256 colors), giving "protected" such a loud color seems wrong.

Before recoloring:
  #813 (comment)
  #813 (comment)
Commits on Jan 18, 2013
@banister banister Fix failing specs on ree/ruby18
We put a conditional around tests so that we skip those those using
show-source (namely the one in run_command_spec.rb) on ree/ruby18
@banister banister improve help for 'edit' command 81b69e0
@banister banister version bugix release
* fix Pry.run_command
* improve `ls` output
* add :requires_gem => "jist" to 'gist' command (so deps can be installed
	via install-command)
* improve help for 'edit' command
Commits on Jan 19, 2013
@epitron epitron Some fixes to the pager.
We didn't send any flags to the pager, as a result ansi codes
were not applied unless the user had properly set up their LESS
env variable. This was often not the case, resulting in broken
and ugly output. This commit sends along the proper flags whenever
we use the pager, regardless of the user's LESS variable
@banister banister pager.rb: Ensure we explicitly rescue LoadError
a bare 'rescue' will not catch a LoadError
Commits on Jan 20, 2013
@banister banister Added Pry.last_internal_error
Holds the last internal error (such as CommandError, Slop::InvalidOptionError,
or MethodSource::SourceNotFoundError). Useful for debugging commands.
Just set: _pry_.last_exception = Pry.last_internal_error
@banister banister version release
* fixed pager bug (wouldn't render color codes in some circumstances)
Commits on Jan 24, 2013
@kyrylo kyrylo SimplePager: take into account the info bar
Fix issue #786 (SimplePager is a bit neglectful)

The info bar takes exactly 3 lines.
@kyrylo kyrylo Rename "DEPRECATED" to "DISABLED"
Fix issue #817 (DEPRECATED: Use `edit` instead.)

Rename `CommandSet#deprecated_command` to `#disabled_command`. Rename
the file in "commands/", too.
@kyrylo kyrylo SimplePager: fix my goofy indentation (c) ef49b02
Commits on Jan 25, 2013
@kyrylo kyrylo Command: replace `Slop::parse` with `Slop::new`
Fix issue #828 (bizarre option parsing bug)

> commands like hist and friends behave differently when -r option is
> passed to the pry executable, this is really weird, see here:
Commits on Jan 26, 2013
@kyrylo kyrylo Pager: use TerminalInfo API for `::page_size`
Fix issue #829 (NoMethodError: undefined method `winsize'
for #<IO:<STDOUT>>, The Same Error as #549 But On The Latest Version
Commits on Jan 27, 2013
@kyrylo kyrylo Helpers::tablify: fix FloatDomainError
Before this commit the following snippet didn't work:

  pry(main)> Pry::Helpers.tablify(['foobar', 'baz'], 5)
  #=> FloatDomainError

There was a divison by zero in `Helpers::Table#_recolumn`.

The problem is incorrectly written `until` loop condition. Note that the
longest element in the array has 6 characters. But the second argument
tells `::tablify` that the line width is only 5 characters long.

This commit changes the condition. Now, if you run the same snippet, you
would see that the elements form one column (and the code doesn't blow
up your program).

Possibly, in the described case, the table has unwanted blanks. However,
I'm not very competent in the code, so I'd better not touch it, because
it works.
Commits on Jan 28, 2013
@rf- rf- Always pass `inherit` param to `Module#constants`
This fixes the `ls Module` case, because it makes the singleton method
`Module.constants` call the instance method. :notes:
@rf- rf- Add regression test for 28afdd5 c173621
@rf- rf- Better fix for 28afdd5
That solution doesn't work on MRI 1.8.
@banister banister reload-code: have it not error when source_file is nil b916038
@banister banister show-source: support create_command based commands 984779c
Commits on Jan 29, 2013
@banister banister re-add reload-method as an alias for reload-code
Turns out some people actually used reload-method, so we re-add it to avoid them getting angry
@banister banister Pry::WrappedModule: add candidates Enumerator
This enables things like this: Pry::WrappedModule(mod).candidates.find(&:source)
returns the first candidate (monkeypatch) with accessible source code.
@banister banister Pry::WrappedModule#source no longer raises if it can't find source.
This is not an exceptional situation so an exception should not be used. nil is now returned instead.
@banister banister show-source/show-doc: Show the first module candidate with source/docs
Prior to this change `show-source ActiveRecord::Base` would fail, as the highest ranked
candidate couldn't be discovered.
@banister banister reload-code improve docs for mean old yozzy f9bec62
@banister banister Pry::WrappedModule: Make #candidates 1.8 friendly.
1.8 doesn't support Enumerator, so we return Generator instead.
@banister banister silence warnings for (non-bond) completions
Ruby 1.8 is being a dick (it complains about multiple values for block 0 for 1
even though we're using a - which isn't supposed to care!)
@banister banister oops, make Pry::WrappedModule#generator private 04b51fd
Commits on Jan 30, 2013
@kyrylo kyrylo Pager: use the `::jruby?` helper from BaseHelpers 3455947
@kyrylo kyrylo Method: fix indentation of private methods 71e8d08
@kyrylo kyrylo Method: shorten helper method calls
`BaseHelpers` module is already included.
@kyrylo kyrylo Do not recommend to install pry-doc in some cases
There is no sense to install "pry-doc" on Ruby platforms other than MRI,
since "pry-doc" is for MRI only. Although "pry-doc" works on non-MRI
platforms, it still shows C source code. Haha.
Commits on Jan 31, 2013
@kyrylo kyrylo CLI: simplify Slop switch declarations
`on :foo=` is the synonym for `on :foo, :argument => true`.
Commits on Feb 01, 2013
@kyrylo kyrylo ShowInfo: remove `--flood` switch
We don't support this switch anymore.
Commits on Feb 02, 2013
@kyrylo kyrylo Refactor the way commands are required
Fix issue #834 (pry- failing on Windows 7 64 bit - cannot load
such file)

The problem was introduced by this commit:

This bug affects *only* Ruby 1.9.3p327, on Windows.

            Choose your destiny
    |                                |
  is bugged on
  Ruby 1.9.3p327

This fix is simply an ugly workaround.
@banister banister add a few rake task aliases 3c94f9f
@banister banister Refactor Pry::Method + add Pry::Method::WeirdMethodLocator
WeirdMethodLocator is used by Pry::Method.from_binding() to locate the
method captured by the binding when the naive approach fails (i.e method(binding.eval('__method__')).

"WeirdMethods" include methods defined on the superclass to the 'self' of the binding, as well as methods
that have subsequently been renamed/replaced.

We also move Pry::Method::Disowned to its own file (disowned.rb)
@banister banister Pry::WrappedModule: Switch the candidate/start_line args.
Makes the API more convenient as we're more likely to provide a candidate arg
than start_line arg.
@banister banister Add -m, -c, -f options to whereami command.
-m, the current method in its totality
-c, the current class/module that is the current 'candidate' (monkeypatch)
-f, the entire file
@banister banister Fix merge conflicts in method.rb dd1a20f
Commits on Feb 03, 2013
@banister banister oops, forgot to add spec/fixtures/whereami_helper.rb e501960
@banister banister Try to fix failing whereami test on 1.8 etc
Explicitly calling to_s before appending wth + "\n"
Commits on Feb 05, 2013
@rking rking Tweak and Refactor Pry::Terminal
The biggest behavior change is to favor `io/console` (but still not when
on jruby). The previous favorite was `Readline.get_screen_size`, but
that thing is stale just like the env. The only reason it gets updated
is if you put `Pry.auto_resize!` in your `~/.pryrc`

The next change is more error handling in `Pry.auto_resize!`

Otherwise I renamed `TerminalInfo` to `Terminal`, which is something
andrewvos and I discussed way back when `TerminalInfo` first came about.

The rest was a little Extract Method stuff, no biggie.
@ConradIrwin ConradIrwin Fix documentation rendering edge-cases [Fixes #795]
Also added some notably absent tests
@ConradIrwin ConradIrwin Add support for pry --gem
I am always doing pry -I./lib -r<gemname>.
@kyrylo kyrylo Terminal: don't let Readline return [0, 0]
Some of the tests from "spec/commands/ls_spec.rb" were failing on
Rubinius and 1.9.2. The problems was introduced by this commit:

  (Tweak and Refactor Pry::Terminal)

The problem is that `Readline.get_screen_size` can return `[0, 0]`.
That's not good, because it breaks a couple of our tests (table output
stuff). But now...

          .o( is fixed. Twit-twoo! )
@kyrylo kyrylo BaseHelpers: add `#jruby_19?` method
And remove some naive comments.
@kyrylo kyrylo WrappedModule#candidates: return Array on JRuby >=1.9
JRuby 1.9 has a nasty bug with `Enumerator#find_index`, which we utilise
in the code of `whereami` command.

More information on the bug: jruby/jruby#525

Simply return an Array, formed from the original Enumerator on JRuby 1.9
and higher. This kills the efficiency, but leastwise, it will be

As a bonus, remove some a junk method.
@rf- rf- Add ruby-head to Travis cb4504c
@ConradIrwin ConradIrwin No more ree 5de4b4f
@kyrylo kyrylo Long live REE! 8bf4fa2
Eugene Diachkin correct_indentation ignores readline \001 & \002 sequences c2932d1
@kyrylo kyrylo [!] Add "0-9-11-stable" branch to ".travis.yml" 58a00d2
Commits on Feb 07, 2013
@banister banister Pry::WrappedModule: add module? and class? predicates
* module? whether the object is *strictly* a module (using instance_of?, does not match classes)
* class? must be a direct instance of Class (using instance_of?)
@banister banister Delegate more methods from Candidate back to WrappedModule 6b3cbdc
@banister banister Make show-source/show-doc fall-back to superclass
When performing show-source/show-doc on a class whose code
cannot be extracted we now fall-back to its first accessible superclass
and show its code together with a warning.


class Model < ActiveRecord::Base

show-source Model #=> shows ActiveRecord::Base code
@banister banister bump version 3eababe
Commits on Feb 08, 2013
@banister banister Fix failing tests on rbx
The failures were due to Rbx recovering more source than expected (compared to MRI)

For example, the following fails in MRI:
module M

module N
  include M

show-source N

but on rbx it succeeds and shows the source of N

How does rbx do it? It appears to create a secret method called __module_init__ on a module whenever you include another module.
This method has its source_location set to the `include` line.
Commits on Feb 10, 2013
@kyrylo kyrylo .gemtest: remove the file
We use Travis CI nowadays.
@banister banister WrappedModule::Candidate: exposed number_of_candidates as public method 07406ee
@banister banister show-source: Indicate all monkeypatches can be shown with -a
Fixes #849
@rking rking Robustify the plugin require
I was getting trouble with both pry-editline and pry-syntax-hacks, while
running with a newly-compiled-Ruby with GNU Readline on a Mac (the
default Readline was working OK with these. There could be more
investigation about the error, but for now, at least pry boots with a
handy error instead of a total failure).
@rking rking Add a Procfile for testing foreman
The foreman run isn't terribly special, but it's another stdio situation
that people get into in real life.

So this is just a way to check that same scenario. For now, no
automation is in place (or necessary?), but it's something to tinker
with via:

    gem install foreman && cd spec && foreman start
@rking rking Add Pry::Terminal.height! (only used once) 10b6762
@rking rking Reword foreman instructions without 'cd' 0b59174
@kyrylo kyrylo InputCompleter: rescue when a nonexistent object is being completed
Fix issue #841 (Trying to auto complete file paths produces an error)

The real reason why the user gets the error is that Pry cannot tab
complete file paths *without* Bond. Instead of tab completing a file
path, it tries to tab complete an *object path*. The fix consists in
rescuing the `Pry::CommandError`. In return, you get funky completions
like these:

  [1] pry(main)> l/l
  l/lambda           l/ln               l/ln_sf
  l/link             l/ln_s             l/load
Commits on Feb 11, 2013
@rking rking Defuse time bomb on EditLine Readline wrapper
If you are using the basic OS X Readline impl, and you Pry.auto_resize!,
you'll find that their Readline.set_screen_size = ___ segfaults.

Instead of letting this happen, we'll tell the user about it and point
them to the fix (of using GNU Readline).
@rking rking Reopen Readline.output if it is not a tty 1538bc0
Commits on Feb 12, 2013
@banister banister version 0.9.12 release, see CHANGELOG for details f8f4f4a