Class: MethodMatch::Pry
- Inherits:
-
Object
- Object
- MethodMatch::Pry
- Defined in:
- lib/method_match/pry.rb
Constant Summary collapse
- PRY_PACKAGE =
'pry'
- COMMAND_NAME =
"rspec_method"
- COMMAND_DESCRIPTION =
"runs spec given name and line number"
Instance Method Summary collapse
Instance Method Details
#command_proc ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/method_match/pry.rb', line 13 def command_proc Proc.new do def process(*args) CommandRunner.new( Matcher.new(args[0], Integer(args[1])) ).run_command end end end |
#rspec_method ⇒ Object
7 8 9 10 11 |
# File 'lib/method_match/pry.rb', line 7 def rspec_method Proc.new do create_command COMMAND_NAME, COMMAND_DESCRIPTION, &MethodMatch::Pry.new.command_proc end end |
#setup ⇒ Object
23 24 25 26 |
# File 'lib/method_match/pry.rb', line 23 def setup require PRY_PACKAGE ::Pry::CommandSet.new(&rspec_method).tap { |cmd| ::Pry::Commands.import cmd } end |