-
Notifications
You must be signed in to change notification settings - Fork 533
adding boolean functions for git status #348
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
Conversation
The test that failed is outside the scope of the change that I made. I will look into forcing a Travis run to see if it can be replicated twice. |
Signed-off-by: Vern Burton <me@vernburton.com>
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.
Thank you for this @tarcinil! I like this change. With the suggested documentation changes, I will approve it.
lib/git/status.rb
Outdated
end | ||
|
||
def untracked?(file) | ||
untracked.member?(file) |
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.
For the new methods added, would you mind adding YARD-style comments that describes briefly:
- What they do
- What the expected types of the input and return values are
The new methods added in this PR are:
- changed?
- added?
- deleted?
- untracked?
Something like this will do:
#
# Determines whether the given file has been added to the repository
#
# @param file [String] The name of the file.
# @return [Boolean]
This way, it is clearer for readers of the code what the intent of these (public API methods) is.
…e about fixing rubocop - broke method to make line count while breaking up function into functional zone - fixed heredoc spacing - removed redundant self - rescue should not be used as a modifer, moved to begin/rescue
I took your comments to heart and while I was adding the documentation, I fixed the class so that it would pass rubocop. vburton@vburton-VirtualBox:~/Code/ruby-git$ rubocop lib/git/status.rb
Inspecting 1 file
.
1 file inspected, no offenses detected The construct_status was broken up to lower method complexity while creating methods to be responsible for untracked, modified, and added statuses. |
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.
Great stuff, thanks! 👍🏻
fixes #346