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

Rename Pry::CLI.process_options to add_option_processor . This method dose not process options but adds option processor, so rename it.

This commit is contained in:
yui-knk 2014-01-11 22:42:25 +09:00
parent 36840ecebf
commit 090e58ccdc
2 changed files with 5 additions and 5 deletions

View file

@ -44,7 +44,7 @@ class Pry
end
# Add a block responsible for processing parsed options.
def process_options(&block)
def add_option_processor(&block)
self.option_processors ||= []
option_processors << block
@ -198,7 +198,7 @@ Copyright (c) 2013 John Mair (banisterfiend)
"Start the session in the specified context. Equivalent to `context.pry` in a session.",
:default => "Pry.toplevel_binding"
)
end.process_options do |opts|
end.add_option_processor do |opts|
exit if opts.help?

View file

@ -60,7 +60,7 @@ describe Pry::Hooks do
Pry::CLI.add_options do
on :optiontest, "A test option"
end.process_options do |opts|
end.add_option_processor do |opts|
run = true if opts.present?(:optiontest)
end.parse_options(["--optiontest"])
@ -74,9 +74,9 @@ describe Pry::Hooks do
Pry::CLI.add_options do
on :optiontest, "A test option"
on :optiontest2, "Another test option"
end.process_options do |opts|
end.add_option_processor do |opts|
run = true if opts.present?(:optiontest)
end.process_options do |opts|
end.add_option_processor do |opts|
run2 = true if opts.present?(:optiontest2)
end.parse_options(["--optiontest", "--optiontest2"])