Skip to content

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

Merged
merged 8 commits into from
Mar 7, 2018
Merged

adding boolean functions for git status #348

merged 8 commits into from
Mar 7, 2018

Conversation

tarcinil
Copy link
Contributor

fixes #346

@tarcinil
Copy link
Contributor Author

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.

Copy link
Contributor

@perlun perlun left a 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.

end

def untracked?(file)
untracked.member?(file)
Copy link
Contributor

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
@tarcinil
Copy link
Contributor Author

tarcinil commented Mar 1, 2018

@perlun

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.

Copy link
Contributor

@perlun perlun left a comment

Choose a reason for hiding this comment

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

Great stuff, thanks! 👍🏻

@perlun perlun merged commit 4686675 into ruby-git:master Mar 7, 2018
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.

RFC: create boolean functions for git status
2 participants