Skip to content

Commit 38f009d

Browse files
author
scott Chacon
committed
updated a bunch of the documentation
1 parent b045fa6 commit 38f009d

31 files changed

+2223
-1061
lines changed

README

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ but eventually I'll replace that with either C bindings
1919
to libgit or libgit-thin, or I'll write pure ruby
2020
handlers for at least some of the Git stuff.
2121

22+
= Major Objects
23+
24+
Git::Base - this is the object returned from a Git.open or Git.clone.
25+
Most major actions are called from this object.
26+
27+
Git::Object - this is the base object for your tree, blob and commit objects,
28+
returned from @git.gtree or @git.object calls. the Git::AbstractObject will
29+
have most of the calls in common for all those objects.
30+
31+
Git::Diff - returns from a @git.diff command. It is an Enumerable that returns
32+
Git::Diff:DiffFile objects from which you can get per file patches and insertion/deletion
33+
statistics. You can also get total statistics from the Git::Diff object directly.
34+
35+
Git::Status
36+
37+
Git::Branches
38+
39+
Git::Remote
40+
41+
Git::Log
42+
2243

2344
= Examples
2445

TODO

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
* more documentation
2+
3+
* compatible with git 1.4
4+
5+
* git archive
16

27
* More Error Examples
38

doc/classes/Git.html

Lines changed: 87 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
<tr class="top-aligned-row">
5656
<td><strong>In:</strong></td>
5757
<td>
58+
<a href="../files/lib/git/author_rb.html">
59+
lib/git/author.rb
60+
</a>
61+
<br />
5862
<a href="../files/lib/git/base_rb.html">
5963
lib/git/base.rb
6064
</a>
@@ -124,6 +128,31 @@
124128

125129
<div id="contextContent">
126130

131+
<div id="description">
132+
<p>
133+
<a href="Git.html">Git</a>/Ruby Library
134+
</p>
135+
<p>
136+
This provides bindings for working with git in complex interactions,
137+
including branching and merging, object inspection and manipulation,
138+
history, patch generation and more. You should be able to do most
139+
fundamental git operations with this library.
140+
</p>
141+
<p>
142+
This module provides the basic functions to open a git reference to work
143+
with. You can open a working directory, open a bare repository, initialize
144+
a new repo or clone an existing remote repository.
145+
</p>
146+
<table>
147+
<tr><td valign="top"><a href="Git/Author.html">Author</a>:</td><td>Scott Chacon (<a href="mailto:schacon@gmail.com">schacon@gmail.com</a>)
148+
149+
</td></tr>
150+
<tr><td valign="top">License:</td><td>MIT License
151+
152+
</td></tr>
153+
</table>
154+
155+
</div>
127156

128157

129158
</div>
@@ -149,7 +178,8 @@ <h3 class="section-bar">Methods</h3>
149178
<div id="class-list">
150179
<h3 class="section-bar">Classes and Modules</h3>
151180

152-
Class <a href="Git/Base.html" class="link">Git::Base</a><br />
181+
Class <a href="Git/Author.html" class="link">Git::Author</a><br />
182+
Class <a href="Git/Base.html" class="link">Git::Base</a><br />
153183
Class <a href="Git/Branch.html" class="link">Git::Branch</a><br />
154184
Class <a href="Git/Branches.html" class="link">Git::Branches</a><br />
155185
Class <a href="Git/Diff.html" class="link">Git::Diff</a><br />
@@ -175,7 +205,7 @@ <h3 class="section-bar">Constants</h3>
175205
<tr class="top-aligned-row context-row">
176206
<td class="context-item-name">VERSION</td>
177207
<td>=</td>
178-
<td class="context-item-value">'1.0.1'</td>
208+
<td class="context-item-value">'1.0.2'</td>
179209
</tr>
180210
</table>
181211
</div>
@@ -200,11 +230,19 @@ <h3 class="section-bar">Public Class methods</h3>
200230
</div>
201231

202232
<div class="method-description">
233+
<p>
234+
open a bare repository
235+
</p>
236+
<p>
237+
this takes the path to a bare git repo it expects not to be able to use a
238+
working directory so you can&#8217;t checkout stuff, commit things, etc.
239+
but you can do most read operations
240+
</p>
203241
<p><a class="source-toggle" href="#"
204242
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
205243
<div class="method-source-code" id="M000001-source">
206244
<pre>
207-
<span class="ruby-comment cmt"># File lib/git.rb, line 36</span>
245+
<span class="ruby-comment cmt"># File lib/git.rb, line 51</span>
208246
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bare</span>(<span class="ruby-identifier">git_dir</span>)
209247
<span class="ruby-constant">Base</span>.<span class="ruby-identifier">bare</span>(<span class="ruby-identifier">git_dir</span>)
210248
<span class="ruby-keyword kw">end</span>
@@ -223,11 +261,28 @@ <h3 class="section-bar">Public Class methods</h3>
223261
</div>
224262

225263
<div class="method-description">
264+
<p>
265+
clones a remote repository
266+
</p>
267+
<p>
268+
options
269+
</p>
270+
<pre>
271+
:bare =&gt; true (does a bare clone)
272+
:repository =&gt; '/path/to/alt_git_dir'
273+
:index =&gt; '/path/to/alt_index_file'
274+
</pre>
275+
<p>
276+
example
277+
</p>
278+
<pre>
279+
Git.clone('git://repo.or.cz/rubygit.git', 'clone.git', :bare =&gt; true)
280+
</pre>
226281
<p><a class="source-toggle" href="#"
227282
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
228283
<div class="method-source-code" id="M000004-source">
229284
<pre>
230-
<span class="ruby-comment cmt"># File lib/git.rb, line 48</span>
285+
<span class="ruby-comment cmt"># File lib/git.rb, line 88</span>
231286
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">clone</span>(<span class="ruby-identifier">repository</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {})
232287
<span class="ruby-constant">Base</span>.<span class="ruby-identifier">clone</span>(<span class="ruby-identifier">repository</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span>)
233288
<span class="ruby-keyword kw">end</span>
@@ -246,11 +301,21 @@ <h3 class="section-bar">Public Class methods</h3>
246301
</div>
247302

248303
<div class="method-description">
304+
<p>
305+
initialize a new git repository, defaults to the current working directory
306+
</p>
307+
<p>
308+
options
309+
</p>
310+
<pre>
311+
:repository =&gt; '/path/to/alt_git_dir'
312+
:index =&gt; '/path/to/alt_index_file'
313+
</pre>
249314
<p><a class="source-toggle" href="#"
250315
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
251316
<div class="method-source-code" id="M000003-source">
252317
<pre>
253-
<span class="ruby-comment cmt"># File lib/git.rb, line 44</span>
318+
<span class="ruby-comment cmt"># File lib/git.rb, line 74</span>
254319
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">init</span>(<span class="ruby-identifier">working_dir</span> = <span class="ruby-value str">'.'</span>, <span class="ruby-identifier">options</span> = {})
255320
<span class="ruby-constant">Base</span>.<span class="ruby-identifier">init</span>(<span class="ruby-identifier">working_dir</span>, <span class="ruby-identifier">options</span>)
256321
<span class="ruby-keyword kw">end</span>
@@ -269,11 +334,27 @@ <h3 class="section-bar">Public Class methods</h3>
269334
</div>
270335

271336
<div class="method-description">
337+
<p>
338+
open an existing git working directory
339+
</p>
340+
<p>
341+
this will most likely be the most common way to create a git reference,
342+
referring to a working directory. if not provided in the options, the
343+
library will assume your git_dir and index are in the default place (.git/,
344+
.git/index)
345+
</p>
346+
<p>
347+
options
348+
</p>
349+
<pre>
350+
:repository =&gt; '/path/to/alt_git_dir'
351+
:index =&gt; '/path/to/alt_index_file'
352+
</pre>
272353
<p><a class="source-toggle" href="#"
273354
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
274355
<div class="method-source-code" id="M000002-source">
275356
<pre>
276-
<span class="ruby-comment cmt"># File lib/git.rb, line 40</span>
357+
<span class="ruby-comment cmt"># File lib/git.rb, line 65</span>
277358
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">working_dir</span>, <span class="ruby-identifier">options</span> = {})
278359
<span class="ruby-constant">Base</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">working_dir</span>, <span class="ruby-identifier">options</span>)
279360
<span class="ruby-keyword kw">end</span>

doc/classes/Git/Author.html

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
<?xml version="1.0" encoding="iso-8859-1"?>
2+
<!DOCTYPE html
3+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5+
6+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7+
<head>
8+
<title>Class: Git::Author</title>
9+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
11+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12+
<script type="text/javascript">
13+
// <![CDATA[
14+
15+
function popupCode( url ) {
16+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17+
}
18+
19+
function toggleCode( id ) {
20+
if ( document.getElementById )
21+
elem = document.getElementById( id );
22+
else if ( document.all )
23+
elem = eval( "document.all." + id );
24+
else
25+
return false;
26+
27+
elemStyle = elem.style;
28+
29+
if ( elemStyle.display != "block" ) {
30+
elemStyle.display = "block"
31+
} else {
32+
elemStyle.display = "none"
33+
}
34+
35+
return true;
36+
}
37+
38+
// Make codeblocks hidden by default
39+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40+
41+
// ]]>
42+
</script>
43+
44+
</head>
45+
<body>
46+
47+
48+
49+
<div id="classHeader">
50+
<table class="header-table">
51+
<tr class="top-aligned-row">
52+
<td><strong>Class</strong></td>
53+
<td class="class-name-in-header">Git::Author</td>
54+
</tr>
55+
<tr class="top-aligned-row">
56+
<td><strong>In:</strong></td>
57+
<td>
58+
<a href="../../files/lib/git/author_rb.html">
59+
lib/git/author.rb
60+
</a>
61+
<br />
62+
</td>
63+
</tr>
64+
65+
<tr class="top-aligned-row">
66+
<td><strong>Parent:</strong></td>
67+
<td>
68+
<a href="Object.html">
69+
Object
70+
</a>
71+
</td>
72+
</tr>
73+
</table>
74+
</div>
75+
<!-- banner header -->
76+
77+
<div id="bodyContent">
78+
79+
80+
81+
<div id="contextContent">
82+
83+
84+
85+
</div>
86+
87+
<div id="method-list">
88+
<h3 class="section-bar">Methods</h3>
89+
90+
<div class="name-list">
91+
<a href="#M000024">new</a>&nbsp;&nbsp;
92+
</div>
93+
</div>
94+
95+
</div>
96+
97+
98+
<!-- if includes -->
99+
100+
<div id="section">
101+
102+
103+
104+
105+
106+
<div id="attribute-list">
107+
<h3 class="section-bar">Attributes</h3>
108+
109+
<div class="name-list">
110+
<table>
111+
<tr class="top-aligned-row context-row">
112+
<td class="context-item-name">date</td>
113+
<td class="context-item-value">&nbsp;[RW]&nbsp;</td>
114+
<td class="context-item-desc"></td>
115+
</tr>
116+
<tr class="top-aligned-row context-row">
117+
<td class="context-item-name">email</td>
118+
<td class="context-item-value">&nbsp;[RW]&nbsp;</td>
119+
<td class="context-item-desc"></td>
120+
</tr>
121+
<tr class="top-aligned-row context-row">
122+
<td class="context-item-name">name</td>
123+
<td class="context-item-value">&nbsp;[RW]&nbsp;</td>
124+
<td class="context-item-desc"></td>
125+
</tr>
126+
</table>
127+
</div>
128+
</div>
129+
130+
131+
132+
<!-- if method_list -->
133+
<div id="methods">
134+
<h3 class="section-bar">Public Class methods</h3>
135+
136+
<div id="method-M000024" class="method-detail">
137+
<a name="M000024"></a>
138+
139+
<div class="method-heading">
140+
<a href="#M000024" class="method-signature">
141+
<span class="method-name">new</span><span class="method-args">(author_string)</span>
142+
</a>
143+
</div>
144+
145+
<div class="method-description">
146+
<p><a class="source-toggle" href="#"
147+
onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
148+
<div class="method-source-code" id="M000024-source">
149+
<pre>
150+
<span class="ruby-comment cmt"># File lib/git/author.rb, line 5</span>
151+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">author_string</span>)
152+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">m</span> = <span class="ruby-regexp re">/(.*?) &lt;(.*?)&gt; (\d+) (.*)/</span>.<span class="ruby-identifier">match</span>(<span class="ruby-identifier">author_string</span>)
153+
<span class="ruby-ivar">@name</span> = <span class="ruby-identifier">m</span>[<span class="ruby-value">1</span>]
154+
<span class="ruby-ivar">@email</span> = <span class="ruby-identifier">m</span>[<span class="ruby-value">2</span>]
155+
<span class="ruby-ivar">@date</span> = <span class="ruby-constant">Time</span>.<span class="ruby-identifier">at</span>(<span class="ruby-identifier">m</span>[<span class="ruby-value">3</span>].<span class="ruby-identifier">to_i</span>)
156+
<span class="ruby-keyword kw">end</span>
157+
<span class="ruby-keyword kw">end</span>
158+
</pre>
159+
</div>
160+
</div>
161+
</div>
162+
163+
164+
</div>
165+
166+
167+
</div>
168+
169+
170+
<div id="validator-badges">
171+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
172+
</div>
173+
174+
</body>
175+
</html>

0 commit comments

Comments
 (0)