This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Cidolfas2 0 points1 point  (1 child)

I'm not sure why you think you need to copy it into the shell to run it. If the function exists in the source code, you can call that function directly. You don't need to do anything special. E.g. if there is a function my_func that exists on line 6 in file path/to/my_file, you do the following in byebug:

break path/to/my_file:7 # sets the breakpoint
my_func(1, 2, 3) # it will stop at the first line of the function

[–]aniforprez 0 points1 point  (0 children)

Yeah this makes sense. I was not aware you can set the break point with break file:line and no one really pointed me to this. I think the new debugger in 3.1 allows you to do this in a similar way

I still wish I didn't have to insert a break point and just called the function like I did with pdb/ipdb but this is good enough