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

Trim line length in error generator #802

Merged
merged 1 commit into from
Oct 23, 2014

Conversation

fables-tales
Copy link
Member

in #751 @JonRowe suggested trimming the line length in error_generator.rb. This patch does that via use of a string join over the parts of the string that were getting built. I prefer this solution to breaking a long string over many lines or shovelling because parts can easily be added/removed from the lists that are joined together.

Thoughts?

@myronmarston
Copy link
Member

I'm noticing that the message = [... expression is identical in all three cases. Might be worth extracting something common?

@fables-tales
Copy link
Member Author

Thought about it, didn't do it the first time. Pushing a commit that does it now.

@fables-tales fables-tales force-pushed the samphippen/trim-error-generator-lines branch from 38223df to 09e8fff Compare October 21, 2014 15:26
__raise(default_error_message(intro, expectation, expected_args, actual_args))
end

def default_error_message(intro, expectation, expected_args, actual_args)
Copy link
Member

Choose a reason for hiding this comment

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

intro is a helper method. It doesn't need to be passed as an argument.

@fables-tales fables-tales force-pushed the samphippen/trim-error-generator-lines branch from 09e8fff to cbc739a Compare October 21, 2014 15:54
@fables-tales
Copy link
Member Author

I'd like to merge this today. @myronmarston @JonRowe @xaviershay @cupakromer @yujinakayama @soulcutter can one of you take a look at this and let me know if it's good?

@myronmarston
Copy link
Member

LGTM

fables-tales pushed a commit that referenced this pull request Oct 23, 2014
@fables-tales fables-tales merged commit 4496242 into master Oct 23, 2014
@fables-tales fables-tales deleted the samphippen/trim-error-generator-lines branch October 23, 2014 15:32
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.

2 participants