Skip to content

Commit 12f908c

Browse files
authored
Add YARD documentation to ruby-git (#502)
Signed-off-by: James Couball <jcouball@yahoo.com>
1 parent a25eb1a commit 12f908c

13 files changed

+471
-166
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*.sw?
44
.DS_Store
55
coverage
6+
doc
7+
.yardoc
68
pkg
79
rdoc
810
Gemfile.lock

.yardopts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--default-return=''
2+
--hide-void-return
3+
--markup-provider=redcarpet
4+
--markup=markdown
5+
--fail-on-warning
6+
-
7+
README.md
8+
CHANGELOG.md
9+
CONTRIBUTING.md
10+
RELEASING.md
11+
MAINTAINERS.md

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<!--
2+
# @markup markdown
3+
# @title Change Log
4+
-->
5+
16
# Change Log
27

38
## 1.7.0

CONTRIBUTING.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<!--
2+
# @markup markdown
3+
# @title How To Contribute
4+
-->
5+
16
# Contributing to ruby-git
27

38
Thank you for your interest in contributing to the ruby-git project.
@@ -8,7 +13,7 @@ judgement.
813

914
Propose changes to these guidelines with a pull request.
1015

11-
## How to contribute to ruby-git
16+
## How to contribute
1217

1318
You can contribute in two ways:
1419

MAINTAINERS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<!--
2+
# @markup markdown
3+
# @title Maintainers
4+
-->
5+
16
# Maintainers
27

38
When making changes in this repository, one of the maintainers below must review and approve your pull request.

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
1-
# Git Library for Ruby
1+
<!--
2+
# @markup markdown
3+
# @title README
4+
-->
25

3-
Library for using Git in Ruby.
6+
# The Git Gem
7+
8+
The Git Gem provides an API that can be used to create, read, and manipulate
9+
Git repositories by wrapping system calls to the `git` binary. The API can be
10+
used for working with Git in complex interactions including branching and
11+
merging, object inspection and manipulation, history, patch generation and
12+
more.
413

514
## Homepage
615

7-
Git public hosting of the project source code is at:
16+
The project source code is at:
817

918
http://github.com/ruby-git/ruby-git
1019

20+
## Documentation
21+
22+
Detailed documentation can be found at:
23+
24+
https://rubydoc.info/gems/git/Git.html
25+
26+
Get started by obtaining a repository object by:
27+
28+
* opening an existing working copy with [Git.open](https://rubydoc.info/gems/git/Git#open-class_method)
29+
* initializing a new repository with [Git.init](https://rubydoc.info/gems/git/Git#init-class_method)
30+
* cloning a repository with [Git.clone](https://rubydoc.info/gems/git/Git#clone-class_method)
31+
32+
Methods that can be called on a repository object are documented in [Git::Base](https://rubydoc.info/gems/git/Git/Base)
33+
1134
## Install
1235

1336
You can install Ruby/Git like this:

RELEASING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<!--
2+
# @markup markdown
3+
# @title Releasing
4+
-->
5+
16
# How to release a new git.gem
27

38
Releasing a new version of the `git` gem requires these steps:

Rakefile

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,44 @@
11
require 'bundler/gem_tasks'
2-
require 'rubygems'
32

43
require "#{File.expand_path(File.dirname(__FILE__))}/lib/git/version"
54

6-
task :default => :test
5+
default_tasks = []
76

87
desc 'Run Unit Tests'
9-
task :test do |t|
8+
task :test do
109
sh 'git config --global user.email "git@example.com"' if `git config user.email`.empty?
1110
sh 'git config --global user.name "GitExample"' if `git config user.name`.empty?
1211

13-
$VERBOSE = true
14-
1512
require File.dirname(__FILE__) + '/tests/all_tests.rb'
1613
end
14+
default_tasks << :test
15+
16+
unless RUBY_PLATFORM == 'java'
17+
#
18+
# YARD documentation for this project can NOT be built with JRuby.
19+
# This project uses the redcarpet gem which can not be installed on JRuby.
20+
#
21+
require 'yard'
22+
YARD::Rake::YardocTask.new
23+
CLEAN << '.yardoc'
24+
CLEAN << 'doc'
25+
default_tasks << :yard
26+
27+
require 'yardstick/rake/verify'
28+
Yardstick::Rake::Verify.new(:'yardstick:coverage') do |t|
29+
t.threshold = 50
30+
t.require_exact_threshold = false
31+
end
32+
default_tasks << :'yardstick:coverage'
33+
34+
desc 'Run yardstick to check yard docs'
35+
task :yardstick do
36+
sh "yardstick 'lib/**/*.rb'"
37+
end
38+
# Do not include yardstick as a default task for now since there are too many
39+
# warnings. Will work to get the warnings down before re-enabling it.
40+
#
41+
# default_tasks << :yardstick
42+
end
43+
44+
task default: default_tasks

git.gemspec

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,36 @@ Gem::Specification.new do |s|
77
s.homepage = 'http://github.com/ruby-git/ruby-git'
88
s.license = 'MIT'
99
s.name = 'git'
10-
s.summary = 'Ruby/Git is a Ruby library that can be used to create, read and manipulate Git repositories by wrapping system calls to the git binary.'
10+
s.summary = 'An API to create, read, and manipulate Git repositories'
11+
s.description = <<~DESCRIPTION
12+
The Git Gem provides an API that can be used to create, read, and manipulate
13+
Git repositories by wrapping system calls to the `git` binary. The API can be
14+
used for working with Git in complex interactions including branching and
15+
merging, object inspection and manipulation, history, patch generation and
16+
more.
17+
DESCRIPTION
1118
s.version = Git::VERSION
1219

20+
s.metadata['homepage_uri'] = s.homepage
21+
s.metadata['source_code_uri'] = s.homepage
22+
s.metadata['changelog_uri'] = 'http://rubydoc.info/gems/git/file.CHANGELOG.html'
23+
1324
s.require_paths = ['lib']
1425
s.required_ruby_version = '>= 2.3'
1526
s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to?(:required_rubygems_version=)
1627
s.requirements = ['git 1.6.0.0, or greater']
1728

1829
s.add_runtime_dependency 'rchardet', '~> 1.8'
1930

20-
s.add_development_dependency 'rake'
21-
s.add_development_dependency 'rdoc'
22-
s.add_development_dependency 'minitar', '0.9'
23-
s.add_development_dependency 'test-unit', '>=2', '< 4'
31+
s.add_development_dependency 'minitar', '~> 0.9'
32+
s.add_development_dependency 'rake', '~> 13.0'
33+
s.add_development_dependency 'test-unit', '~> 3.3'
2434

25-
s.extra_rdoc_files = ['README.md']
26-
s.rdoc_options = ['--charset=UTF-8']
35+
unless RUBY_PLATFORM == 'java'
36+
s.add_development_dependency 'redcarpet', '~> 3.5'
37+
s.add_development_dependency 'yard', '~> 0.9'
38+
s.add_development_dependency 'yardstick', '~> 0.9'
39+
end
2740

2841
s.files = [
2942
'CHANGELOG.md',

0 commit comments

Comments
 (0)