Skip to content

update backtrace string format regex #459

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

Merged
merged 1 commit into from
Dec 22, 2015

Conversation

keepcosmos
Copy link
Contributor

Every backtrace strings do not include :in
http://ruby-doc.org/core-1.9.3/Exception.html#method-i-backtrace

@rails-bot
Copy link

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @jonleighton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@@ -99,7 +99,7 @@ def preload
@preloaded = :success
rescue Exception => e
@preloaded = :failure
watcher.add e.backtrace.map { |line| line.match(/^(.*)\:\d+\:in /)[1] }
watcher.add e.backtrace.map { |line| line.match(/^(.*)\:\d+/)[1] }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can simplify this to: line[/^(.*)\:\d+/, 1]

@grosser
Copy link
Collaborator

grosser commented Dec 21, 2015

can you reproduce a trace without the in ?

@keepcosmos
Copy link
Contributor Author

@grosser
backtrace can override.
Actually, I found overrided #backtrace method in 126 line of https://github.com/sass/sass/blob/stable/lib/sass/error.rb

Ruby 1.9 document said,
The backtrace is an array of strings, each containing either “filename:lineNo: in method”‘ or “filename:lineNo.”
http://ruby-doc.org/core-1.9.3/Exception.html#method-i-backtrace
We can not sure bracktrace strings match with /^(.*)\:\d+\:in /

@keepcosmos keepcosmos force-pushed the update-backtrace-format branch from b4981b0 to 549ea4e Compare December 22, 2015 10:33
grosser added a commit that referenced this pull request Dec 22, 2015
@grosser grosser merged commit 8751342 into rails:master Dec 22, 2015
@grosser
Copy link
Collaborator

grosser commented Dec 22, 2015

thx, 1.6.1 is out

@keepcosmos
Copy link
Contributor Author

@grosser Thanks ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants