diff --git a/lib/pry.rb b/lib/pry.rb index b67781e2..b6ff4904 100644 --- a/lib/pry.rb +++ b/lib/pry.rb @@ -33,7 +33,6 @@ require "pry/core_extensions" require "pry/pry_class" require "pry/pry_instance" - # TEMPORARY HACK FOR BUG IN JRUBY 1.9 REGEX (which kills CodeRay) if RUBY_VERSION =~ /1.9/ && RUBY_ENGINE =~ /jruby/ Pry.color = false diff --git a/lib/pry/command_context.rb b/lib/pry/command_context.rb index ea22165b..3b147211 100644 --- a/lib/pry/command_context.rb +++ b/lib/pry/command_context.rb @@ -5,7 +5,15 @@ class Pry attr_accessor :output attr_accessor :target attr_accessor :opts - attr_accessor :commands + attr_accessor :command_set + + def run(name, *args) + command_set.run_command(self, name, *args) + end + + def commands + command_set.commands + end include Pry::Helpers::BaseHelpers include Pry::Helpers::CommandHelpers diff --git a/lib/pry/command_processor.rb b/lib/pry/command_processor.rb index 8fa0be80..02120997 100644 --- a/lib/pry/command_processor.rb +++ b/lib/pry/command_processor.rb @@ -143,10 +143,10 @@ class Pry context = CommandContext.new # set some useful methods to be used by the action blocks - context.opts = options - context.target = target - context.output = output - context.commands = commands.commands + context.opts = options + context.target = target + context.output = output + context.command_set = commands ret = commands.run_command(context, command, *args) diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb index 2aa00c46..f5f3c316 100644 --- a/lib/pry/pry_class.rb +++ b/lib/pry/pry_class.rb @@ -195,10 +195,10 @@ class Pry context = CommandContext.new commands = options[:commands] - context.opts = {} - context.output = options[:show_output] ? options[:output] : null_output - context.target = Pry.binding_for(options[:context]) - context.commands = commands.commands + context.opts = {} + context.output = options[:show_output] ? options[:output] : null_output + context.target = Pry.binding_for(options[:context]) + context.command_set = commands commands.run_command(context, name, *Shellwords.shellwords(arg_string)) end