Commit Graph

11 Commits

Author SHA1 Message Date
Yorick Peterse 3fa74ea862 Manually merged branch "issue/601".
The commits in this branch would conflict with the current ones in the master
branch. I've modified the code of pry/completion.rb so that instead of escaping
*all* input it will only escape it when this hasn't already been done so.

This fixes #601.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
2012-06-19 15:47:52 +02:00
Yorick Peterse d3f1abbe37 Completion fix for Jruby.
Jruby doesn't always provide the method `#instance_methods()` on objects. By
checking to see if this method exists before using it the completion system
won't totally barf itself when used on Jruby.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
2012-06-19 13:19:32 +02:00
Yorick Peterse a36322a6bc Completion for instance and class variables.
Pry is now able to complete variable names for instance and class variables, as
well as being able to complete methods and the like on these variables.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
2012-06-19 12:32:03 +02:00
Yorick Peterse ea016d8e4c Escape user input before completing it.
User input should be escaped using Regexp.escape() before trying to figure out
what data to use for the Readline completion system. Not escaping this input
would cause Pry to fail for input such as `[10, 20].map(&:class)`.

This problem was caused due to lib/completion.rb converting the input (in this
case it would be ":class)") to a Regexp object. Because this, when converted to
a Regexp object, is invalid it would cause Pry to throw a RegexpError error and
bail out.

See #601 for more information.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
2012-06-19 11:44:34 +02:00
Conrad Irwin 04f8d4f48b Don't rescue overzealously. Fixes #220 2011-08-26 22:38:05 -07:00
Conrad Irwin fe911c6740 Don't crash if I have a badly behaved module.
The completion code was assuming that all modules would have names that
were strings, this is not always the case.
2011-08-16 21:53:20 -07:00
Lee Jarvis 60f164d8c4 cleaned up some indentation.. vim is good at this indenting stuff! 2011-05-19 19:24:07 +01:00
Lee Jarvis 3ff75dd20a whitespace cleanup in one hit 2011-04-18 22:31:39 +01:00
John Mair c8b05f54e0 another doc update, documented completion.rb and reworded some sections in README 2011-01-21 15:46:56 +13:00
John Mair ebdcfdf145 saving before refactor to implement action block instead of action proc for commands. All tests passing in 1.8 and 1.9. 2011-01-12 18:08:56 +11:00
John Mair 4ea554fcfd added completion (taken from irb). Remember to remove hardcoding expecation of command_info from Pry#re() method, need to turn command addition into DSL 2011-01-11 00:54:17 +11:00