class Pry::CommandSet::Command
def call(context, *args)
def call(context, *args) if stub_block = options[:stub_info] context.instance_eval(&stub_block) else ret = context.instance_exec(*correct_arg_arity(block.arity, args), &block) if options[:keep_retval] ret else Pry::CommandContext::VOID_VALUE end end end
def correct_arg_arity(arity, args)
def correct_arg_arity(arity, args) case arity <=> 0 when -1 args when 0 [] when 1 # another jruby hack if Pry::Helpers::BaseHelpers.jruby? args[0..(arity - 1)] else args.values_at 0..(arity - 1) end end end