From 439e4ccbf41edea51d6f1f5d6cf579ab25244caf Mon Sep 17 00:00:00 2001 From: John Mair Date: Sun, 6 Mar 2011 19:46:44 +1300 Subject: [PATCH] version 0.6.8.1 - fixed rubinius raising when command line pry was invoked * added :__script__ test to hooks too * raise was due to top-level rubinius __method__ returning :__script__ and not simply returning nil (like MRI/JRUBY) * Fix was to include :__script__ in the test. * also slightly improved working in README.markdown --- README.markdown | 2 +- lib/pry/commands.rb | 4 +++- lib/pry/hooks.rb | 2 +- lib/pry/version.rb | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.markdown b/README.markdown index d76f219a..3c9d9137 100644 --- a/README.markdown +++ b/README.markdown @@ -164,7 +164,7 @@ end. * Pry can be invoked at any time and on any object in the running program. * Pry sessions can nest arbitrarily deeply -- to go back one level of nesting type 'exit' or 'quit' or 'back' -* Pry comes with syntax highlighting on by default just use the `toggle-color` command to use it. +* Pry comes with syntax highlighting on by default just use the `toggle-color` command to turn it on and off. * Use `_` to recover last result. * Use `_pry_` to reference the Pry instance managing the current session. * Pry supports tab completion. diff --git a/lib/pry/commands.rb b/lib/pry/commands.rb index cb8ce1e6..70259f6b 100644 --- a/lib/pry/commands.rb +++ b/lib/pry/commands.rb @@ -11,7 +11,9 @@ class Pry # We make this a lambda to avoid documenting it meth_name_from_binding = lambda do |b| meth_name = b.eval('__method__') - if [nil, :__binding__, :__binding_impl__].include?(meth_name) + + # :__script__ for rubinius + if [:__script__, nil, :__binding__, :__binding_impl__].include?(meth_name) nil else meth_name diff --git a/lib/pry/hooks.rb b/lib/pry/hooks.rb index 8a3f6d36..f757a702 100644 --- a/lib/pry/hooks.rb +++ b/lib/pry/hooks.rb @@ -9,7 +9,7 @@ class Pry # ensure we're actually in a method meth_name = target.eval('__method__') file = target.eval('__FILE__') - if ![nil, :__binding__, :__binding_impl__].include?(meth_name) && file !~ /(\(.*\))|<.*>/ + if ![:__script__, nil, :__binding__, :__binding_impl__].include?(meth_name) && file !~ /(\(.*\))|<.*>/ Pry.run_command "whereami", :output => out, :show_output => true, :context => target, :commands => Pry::Commands end end, diff --git a/lib/pry/version.rb b/lib/pry/version.rb index dc289a5a..d62c9cd1 100644 --- a/lib/pry/version.rb +++ b/lib/pry/version.rb @@ -1,3 +1,3 @@ class Pry - VERSION = "0.6.8" + VERSION = "0.6.8.1" end