1 <?xml version=
"1.0" encoding=
"iso-8859-1"?>
3 PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <html xmlns=
"http://www.w3.org/1999/xhtml" xml:
lang=
"en" lang=
"en">
8 <title>Class: Git::Diff
</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">
15 function popupCode( url ) {
16 window.open(url,
"Code",
"resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
19 function toggleCode( id ) {
20 if ( document.getElementById )
21 elem = document.getElementById( id );
22 else if ( document.all )
23 elem = eval(
"document.all." + id );
27 elemStyle = elem.style;
29 if ( elemStyle.display !=
"block" ) {
30 elemStyle.display =
"block"
32 elemStyle.display =
"none"
38 // Make codeblocks hidden by default
39 document.writeln(
"<style type=\"text/css\
">div.method-source-code { display: none }</style>" )
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::Diff
</td>
55 <tr class=
"top-aligned-row">
56 <td><strong>In:
</strong></td>
58 <a href=
"../../files/lib/git/diff_rb.html">
65 <tr class=
"top-aligned-row">
66 <td><strong>Parent:
</strong></td>
68 <a href=
"Object.html">
75 <!-- banner header -->
77 <div id=
"bodyContent">
81 <div id=
"contextContent">
83 <div id=
"description">
85 object that holds the last X commits on given branch
93 <div id=
"method-list">
94 <h3 class=
"section-bar">Methods
</h3>
96 <div class=
"name-list">
97 <a href=
"#M000198">[]
</a>
98 <a href=
"#M000193">deletions
</a>
99 <a href=
"#M000199">each
</a>
100 <a href=
"#M000194">insertions
</a>
101 <a href=
"#M000192">lines
</a>
102 <a href=
"#M000189">new
</a>
103 <a href=
"#M000196">patch
</a>
104 <a href=
"#M000190">path
</a>
105 <a href=
"#M000191">size
</a>
106 <a href=
"#M000195">stats
</a>
107 <a href=
"#M000197">to_s
</a>
116 <h3 class=
"section-bar">Included Modules
</h3>
118 <div id=
"includes-list">
119 <span class=
"include-name">Enumerable
</span>
125 <div id=
"class-list">
126 <h3 class=
"section-bar">Classes and Modules
</h3>
128 Class
<a href=
"Diff/DiffFile.html" class=
"link">Git::Diff::DiffFile
</a><br />
138 <!-- if method_list -->
140 <h3 class=
"section-bar">Public Class methods
</h3>
142 <div id=
"method-M000189" class=
"method-detail">
143 <a name=
"M000189"></a>
145 <div class=
"method-heading">
146 <a href=
"#M000189" class=
"method-signature">
147 <span class=
"method-name">new
</span><span class=
"method-args">(base, from = nil, to = nil)
</span>
151 <div class=
"method-description">
152 <p><a class=
"source-toggle" href=
"#"
153 onclick=
"toggleCode('M000189-source');return false;">[Source]
</a></p>
154 <div class=
"method-source-code" id=
"M000189-source">
156 <span class=
"ruby-comment cmt"># File lib/git/diff.rb, line
16</span>
157 <span class=
"ruby-keyword kw">def
</span> <span class=
"ruby-identifier">initialize
</span>(
<span class=
"ruby-identifier">base
</span>,
<span class=
"ruby-identifier">from
</span> =
<span class=
"ruby-keyword kw">nil
</span>,
<span class=
"ruby-identifier">to
</span> =
<span class=
"ruby-keyword kw">nil
</span>)
158 <span class=
"ruby-ivar">@base
</span> =
<span class=
"ruby-identifier">base
</span>
159 <span class=
"ruby-ivar">@from
</span> =
<span class=
"ruby-identifier">from
</span>.
<span class=
"ruby-identifier">to_s
</span>
160 <span class=
"ruby-ivar">@to
</span> =
<span class=
"ruby-identifier">to
</span>.
<span class=
"ruby-identifier">to_s
</span>
161 <span class=
"ruby-keyword kw">end
</span>
167 <h3 class=
"section-bar">Public Instance methods
</h3>
169 <div id=
"method-M000198" class=
"method-detail">
170 <a name=
"M000198"></a>
172 <div class=
"method-heading">
173 <a href=
"#M000198" class=
"method-signature">
174 <span class=
"method-name">[]
</span><span class=
"method-args">(key)
</span>
178 <div class=
"method-description">
182 <p><a class=
"source-toggle" href=
"#"
183 onclick=
"toggleCode('M000198-source');return false;">[Source]
</a></p>
184 <div class=
"method-source-code" id=
"M000198-source">
186 <span class=
"ruby-comment cmt"># File lib/git/diff.rb, line
61</span>
187 <span class=
"ruby-keyword kw">def
</span> <span class=
"ruby-operator">[]
</span>(
<span class=
"ruby-identifier">key
</span>)
188 <span class=
"ruby-identifier">process_full
</span>
189 <span class=
"ruby-ivar">@full_diff_files
</span>.
<span class=
"ruby-identifier">assoc
</span>(
<span class=
"ruby-identifier">key
</span>)[
<span class=
"ruby-value">1</span>]
190 <span class=
"ruby-keyword kw">end
</span>
196 <div id=
"method-M000193" class=
"method-detail">
197 <a name=
"M000193"></a>
199 <div class=
"method-heading">
200 <a href=
"#M000193" class=
"method-signature">
201 <span class=
"method-name">deletions
</span><span class=
"method-args">()
</span>
205 <div class=
"method-description">
206 <p><a class=
"source-toggle" href=
"#"
207 onclick=
"toggleCode('M000193-source');return false;">[Source]
</a></p>
208 <div class=
"method-source-code" id=
"M000193-source">
210 <span class=
"ruby-comment cmt"># File lib/git/diff.rb, line
37</span>
211 <span class=
"ruby-keyword kw">def
</span> <span class=
"ruby-identifier">deletions
</span>
212 <span class=
"ruby-identifier">cache_stats
</span>
213 <span class=
"ruby-ivar">@stats
</span>[
<span class=
"ruby-identifier">:total
</span>][
<span class=
"ruby-identifier">:deletions
</span>]
214 <span class=
"ruby-keyword kw">end
</span>
220 <div id=
"method-M000199" class=
"method-detail">
221 <a name=
"M000199"></a>
223 <div class=
"method-heading">
224 <a href=
"#M000199" class=
"method-signature">
225 <span class=
"method-name">each
</span><span class=
"method-args">() {|file[
1]| ...}
</span>
229 <div class=
"method-description">
230 <p><a class=
"source-toggle" href=
"#"
231 onclick=
"toggleCode('M000199-source');return false;">[Source]
</a></p>
232 <div class=
"method-source-code" id=
"M000199-source">
234 <span class=
"ruby-comment cmt"># File lib/git/diff.rb, line
66</span>
235 <span class=
"ruby-keyword kw">def
</span> <span class=
"ruby-identifier">each
</span>
236 <span class=
"ruby-identifier">process_full
</span>
237 <span class=
"ruby-ivar">@full_diff_files
</span>.
<span class=
"ruby-identifier">each
</span> <span class=
"ruby-keyword kw">do
</span> <span class=
"ruby-operator">|
</span><span class=
"ruby-identifier">file
</span><span class=
"ruby-operator">|
</span>
238 <span class=
"ruby-keyword kw">yield
</span> <span class=
"ruby-identifier">file
</span>[
<span class=
"ruby-value">1</span>]
239 <span class=
"ruby-keyword kw">end
</span>
240 <span class=
"ruby-keyword kw">end
</span>
246 <div id=
"method-M000194" class=
"method-detail">
247 <a name=
"M000194"></a>
249 <div class=
"method-heading">
250 <a href=
"#M000194" class=
"method-signature">
251 <span class=
"method-name">insertions
</span><span class=
"method-args">()
</span>
255 <div class=
"method-description">
256 <p><a class=
"source-toggle" href=
"#"
257 onclick=
"toggleCode('M000194-source');return false;">[Source]
</a></p>
258 <div class=
"method-source-code" id=
"M000194-source">
260 <span class=
"ruby-comment cmt"># File lib/git/diff.rb, line
42</span>
261 <span class=
"ruby-keyword kw">def
</span> <span class=
"ruby-identifier">insertions
</span>
262 <span class=
"ruby-identifier">cache_stats
</span>
263 <span class=
"ruby-ivar">@stats
</span>[
<span class=
"ruby-identifier">:total
</span>][
<span class=
"ruby-identifier">:insertions
</span>]
264 <span class=
"ruby-keyword kw">end
</span>
270 <div id=
"method-M000192" class=
"method-detail">
271 <a name=
"M000192"></a>
273 <div class=
"method-heading">
274 <a href=
"#M000192" class=
"method-signature">
275 <span class=
"method-name">lines
</span><span class=
"method-args">()
</span>
279 <div class=
"method-description">
280 <p><a class=
"source-toggle" href=
"#"
281 onclick=
"toggleCode('M000192-source');return false;">[Source]
</a></p>
282 <div class=
"method-source-code" id=
"M000192-source">
284 <span class=
"ruby-comment cmt"># File lib/git/diff.rb, line
32</span>
285 <span class=
"ruby-keyword kw">def
</span> <span class=
"ruby-identifier">lines
</span>
286 <span class=
"ruby-identifier">cache_stats
</span>
287 <span class=
"ruby-ivar">@stats
</span>[
<span class=
"ruby-identifier">:total
</span>][
<span class=
"ruby-identifier">:lines
</span>]
288 <span class=
"ruby-keyword kw">end
</span>
294 <div id=
"method-M000196" class=
"method-detail">
295 <a name=
"M000196"></a>
297 <div class=
"method-heading">
298 <a href=
"#M000196" class=
"method-signature">
299 <span class=
"method-name">patch
</span><span class=
"method-args">(file = nil)
</span>
303 <div class=
"method-description">
305 if file is provided and is writable, it will write the patch into the file
307 <p><a class=
"source-toggle" href=
"#"
308 onclick=
"toggleCode('M000196-source');return false;">[Source]
</a></p>
309 <div class=
"method-source-code" id=
"M000196-source">
311 <span class=
"ruby-comment cmt"># File lib/git/diff.rb, line
53</span>
312 <span class=
"ruby-keyword kw">def
</span> <span class=
"ruby-identifier">patch
</span>(
<span class=
"ruby-identifier">file
</span> =
<span class=
"ruby-keyword kw">nil
</span>)
313 <span class=
"ruby-identifier">cache_full
</span>
314 <span class=
"ruby-ivar">@full_diff
</span>
315 <span class=
"ruby-keyword kw">end
</span>
321 <div id=
"method-M000190" class=
"method-detail">
322 <a name=
"M000190"></a>
324 <div class=
"method-heading">
325 <a href=
"#M000190" class=
"method-signature">
326 <span class=
"method-name">path
</span><span class=
"method-args">(path)
</span>
330 <div class=
"method-description">
331 <p><a class=
"source-toggle" href=
"#"
332 onclick=
"toggleCode('M000190-source');return false;">[Source]
</a></p>
333 <div class=
"method-source-code" id=
"M000190-source">
335 <span class=
"ruby-comment cmt"># File lib/git/diff.rb, line
22</span>
336 <span class=
"ruby-keyword kw">def
</span> <span class=
"ruby-identifier">path
</span>(
<span class=
"ruby-identifier">path
</span>)
337 <span class=
"ruby-ivar">@path
</span> =
<span class=
"ruby-identifier">path
</span>
338 <span class=
"ruby-keyword kw">return
</span> <span class=
"ruby-keyword kw">self
</span>
339 <span class=
"ruby-keyword kw">end
</span>
345 <div id=
"method-M000191" class=
"method-detail">
346 <a name=
"M000191"></a>
348 <div class=
"method-heading">
349 <a href=
"#M000191" class=
"method-signature">
350 <span class=
"method-name">size
</span><span class=
"method-args">()
</span>
354 <div class=
"method-description">
355 <p><a class=
"source-toggle" href=
"#"
356 onclick=
"toggleCode('M000191-source');return false;">[Source]
</a></p>
357 <div class=
"method-source-code" id=
"M000191-source">
359 <span class=
"ruby-comment cmt"># File lib/git/diff.rb, line
27</span>
360 <span class=
"ruby-keyword kw">def
</span> <span class=
"ruby-identifier">size
</span>
361 <span class=
"ruby-identifier">cache_stats
</span>
362 <span class=
"ruby-ivar">@stats
</span>[
<span class=
"ruby-identifier">:total
</span>][
<span class=
"ruby-identifier">:files
</span>]
363 <span class=
"ruby-keyword kw">end
</span>
369 <div id=
"method-M000195" class=
"method-detail">
370 <a name=
"M000195"></a>
372 <div class=
"method-heading">
373 <a href=
"#M000195" class=
"method-signature">
374 <span class=
"method-name">stats
</span><span class=
"method-args">()
</span>
378 <div class=
"method-description">
379 <p><a class=
"source-toggle" href=
"#"
380 onclick=
"toggleCode('M000195-source');return false;">[Source]
</a></p>
381 <div class=
"method-source-code" id=
"M000195-source">
383 <span class=
"ruby-comment cmt"># File lib/git/diff.rb, line
47</span>
384 <span class=
"ruby-keyword kw">def
</span> <span class=
"ruby-identifier">stats
</span>
385 <span class=
"ruby-identifier">cache_stats
</span>
386 <span class=
"ruby-ivar">@stats
</span>
387 <span class=
"ruby-keyword kw">end
</span>
393 <div id=
"method-M000197" class=
"method-detail">
394 <a name=
"M000197"></a>
396 <div class=
"method-heading">
397 <span class=
"method-name">to_s
</span><span class=
"method-args">(file = nil)
</span>
400 <div class=
"method-description">
402 Alias for
<a href=
"Diff.html#M000196">patch
</a>
414 <div id=
"validator-badges">
415 <p><small><a href=
"http://validator.w3.org/check/referer">[Validate]
</a></small></p>