Skip to content

Add YARD documentation to ruby-git #502

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 28, 2020
Merged

Add YARD documentation to ruby-git #502

merged 1 commit into from
Dec 28, 2020

Conversation

jcouball
Copy link
Member

@jcouball jcouball commented Dec 23, 2020

Your checklist for this pull request

🚨Please review the guidelines for contributing to this repository.

  • Ensure all commits include DCO sign-off.
  • Ensure that your contributions pass unit testing.
  • Ensure that your contributions contain documentation if applicable.

Description

Create YARD documentation for ruby-git instead of rdoc. Make improvements to the documentation.

Not everything is documented yet. Additional PRs will add YARD doc for everything.

The work done so far shows what this would look like for most methods in the Git module like Git.bare, Git.open, Git.clone, Git.init.

In order to see this updated documentation, you will need to clone this PR branch and then run:

bundle install
bundle exec rake yard && open doc/index.html

JRuby Not Supported for Generating YARD docs

This project uses the redcarpet gem to be able to use Markdown to format YARD documentation. redcarpet is not compatible with JRuby.

To make this clear, the rake tasks for YARD documentation are not added under JRuby and the redcarpet gem is not development dependency when running in JRuby.

Signed-off-by: James Couball <jcouball@yahoo.com>
opts[:working_directory] ||= working_dir
opts[:repository] ||= File.join(opts[:working_directory], '.git')
# (see Git.init)
def self.init(directory, options = {})
Copy link
Member Author

Choose a reason for hiding this comment

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

The arg opts was changed to options to be the same as Git.init so the (see Git.init) YARD directive would work.

opts[:working_directory] ||= working_dir
opts[:repository] ||= File.join(opts[:working_directory], '.git')
# (see Git.open)
def self.open(working_dir, options={})
Copy link
Member Author

Choose a reason for hiding this comment

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

The arg opts was changed to options to be the same as Git.open so the (see Git.open) YARD directive would work.

# See [the --all option to git-add](https://git-scm.com/docs/git-add#Documentation/git-add.txt--A)
# for more details.
#
def add(paths = '.', **options)
Copy link
Member Author

Choose a reason for hiding this comment

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

Change the signature from *args so the individual options can be documented. I am confident that this is equivalent because the unit tests still pass.

@jcouball jcouball merged commit 12f908c into ruby-git:master Dec 28, 2020
@jcouball jcouball mentioned this pull request Dec 28, 2020
3 tasks
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.

1 participant