1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Revert "Use new :as => :count functionality from Slop"

This reverts commit 1b29adb061.
This commit is contained in:
Ryan Fitzgerald 2011-12-04 16:32:18 -08:00
parent f40115f323
commit 9a55514aa2

View file

@ -39,7 +39,7 @@ class Pry
@method_target = target @method_target = target
opt.on :M, "instance-methods", "Operate on instance methods." opt.on :M, "instance-methods", "Operate on instance methods."
opt.on :m, :methods, "Operate on methods." opt.on :m, :methods, "Operate on methods."
opt.on :s, :super, "Select the 'super' method. Can be repeated to traverse the ancestors.", :as => :count opt.on :s, :super, "Select the 'super' method. Can be repeated to traverse the ancestors."
opt.on :c, :context, "Select object context to run under.", true do |context| opt.on :c, :context, "Select object context to run under.", true do |context|
@method_target = Pry.binding_for(target.eval(context)) @method_target = Pry.binding_for(target.eval(context))
end end
@ -48,6 +48,9 @@ class Pry
# Add the derived :method_object option to a used Slop instance. # Add the derived :method_object option to a used Slop instance.
def process_method_object_options(args, opts) def process_method_object_options(args, opts)
opts[:instance] = opts['instance-methods'] if opts.present?(:methods) opts[:instance] = opts['instance-methods'] if opts.present?(:methods)
# TODO: de-hack when we upgrade Slop: https://github.com/injekt/slop/pull/30
opts.options[:super].force_argument_value opts.options[:super].count if opts.present?(:super)
get_method_or_raise(args.empty? ? nil : args.join(" "), @method_target, opts.to_hash(true)) get_method_or_raise(args.empty? ? nil : args.join(" "), @method_target, opts.to_hash(true))
end end
end end