Skip to content
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

Adjust the backtrace to look more like rails. Adds the enhancement requested in #29. #152

Merged
merged 1 commit into from
Apr 17, 2013

Conversation

kevintuhumury
Copy link
Contributor

As requested in issue #29, this enhances the backtrace to look more like Rails. It outputs the gem name, it's version (in parentheses) followed by the file path.

… the gem before it's file path. Adds the enhancement requested in #29.
@rstacruz
Copy link
Collaborator

I like it, I've been wanting to have this done myself. Thanks for the contribution.

rstacruz added a commit that referenced this pull request Apr 17, 2013
Adjust the backtrace to look more like rails. Adds the enhancement requested in #29.
@rstacruz rstacruz merged commit 83a5680 into BetterErrors:master Apr 17, 2013
@@ -50,7 +50,7 @@ def gem?
def gem_path
Gem.path.each do |path|
if filename.index(path) == 0
return filename.gsub("#{path}/gems/", "(gem) ")
return filename.gsub(%r{#{path}/gems/([^/]+)-([\w.]+)/}, '\1 (\2) ')
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if path contains special regex characters?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Uh oh, you're right, the dot is especially vulnerable.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let me fix that in a commit, hold on

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm on it, don't worry

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay cool, go ahead then. :) Sorry I glanced over that hole.

haileys pushed a commit that referenced this pull request Apr 17, 2013
@kevintuhumury
Copy link
Contributor Author

Oh wow, didn't think of that. Sorry about that guys.

mjc added a commit to CentroNet-Marketing/better_errors that referenced this pull request Jul 18, 2013
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.

3 participants