-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for passing a block to start
method
#14
Conversation
If we do not like the module GvlTracing
class << self
private :_start
private :_stop
def start(filename)
_start(filename)
if block_given?
yield
_stop
end
end
def stop
_stop
end
end
end |
Looks good! In #12 indeed we already are wrapping |
When a block is provided the start method, it yields and calls stop.
adc5cae
to
f0fd746
Compare
@ivoanjo Done 🎉 |
@@ -37,6 +37,11 @@ class << self | |||
def start(file) | |||
_start(file) | |||
@path = file | |||
|
|||
if block_given? | |||
yield |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ivoanjo we might wan to think about error handling 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! I think an ensure block calling stop
is probably the way to go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done 53a21ca
start
method
Fix typo .)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks 👍
Thanks @GustavoCaso for the contribution! I've (finally, lol, thanks for the patience!) released it as v1.3.0 :) |
Add a new module function
execute(filename)
intoGvlTracing
wrapping call ofstart
andstop
methods.This is one of the tasks from #13