Auto create configuration objects for plugins
Before this change all `` pairs were removed from documentation which makes the ``foo'' quoting style used by some authors look very odd. We'd also try to syntax highlight code inside `` inside code, which caused nasty rendering errors as the escape sequences got tangled up.
Before this commit, the binding stack was cleared before evaluating the user-given value for the `exit` command. If a syntax error happened when `eval`ing it, the program would still be running with no elements in the binding stack, causing next calls of `exit` to fail.
Signed-off-by: Yorick Peterse <firstname.lastname@example.org>
This is acheived by keeping track of which Strings are open and re-opening them before giving CodeRay the new line of input. I considered instead passing the entire input through CodeRay and then just extracting the last line of tokens, unfortunately this would exhibit O(n²) behaviour when pasting code into the terminal; and it's not obvious whether the tokenization would be stable enough to guarantee an easy way to get the last line of tokens.
Whenever a plugin is activated a configuration object (using OpenStruct) will be created in Pry.config for that plugin. For example, for the plugin "pry-doc" the object Pry.config.pry_doc would be created. See #436 for more information. Signed-off-by: Yorick Peterse <email@example.com>
closes #547. Repro: `? Enumerator`. Bug arose because core docs have no associated line number and so attempting to calculate relative location of docs resulted in a NilClass error
* made it clear -a switch to show-source/show-doc applies to classes as well as modules
* necessary to bring new show-source/show-doc functionality to ruby 1.8 * pry now also auto-requires ruby18_source_location if it's available
* also made Pry::WrappedModule.from_str more robust
* module are now looked up with respect to the optional binding parameter to from_str * also improved some docs
* switch to show all monkeypatches is now -a (for all) * improved some method names (top_method_candidates => method_candidates in wrapped_module.rb) * improved in-session documentation for show-source and show-doc