This file is indexed.

/usr/share/doc/ruby-haml/yardoc/Haml/Shared.html is in ruby-haml 3.1.4-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=c" />
<title>
  Module: Haml::Shared
  
    &mdash; Haml Documentation
  
</title>

  <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '..';
  if (relpath != '') relpath += '/';
</script>

  <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>


  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="../_index.html">Index (S)</a> &raquo; 
    <span class='title'><span class='object_link'><a href="../Haml.html" title="Haml (module)">Haml</a></span></span>
     &raquo; 
    <span class="title">Shared</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a id="class_list_link" href="#">Class List</a>
  
    <a id="method_list_link" href="#">Method List</a>
  
    <a id="file_list_link" href="#">File List</a>
  
</div>
      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Module: Haml::Shared
  
  
  
</h1>

<dl class="box">
  
  
    
      <dt class="r1">Extended by:</dt>
      <dd class="r1"><span class='object_link'><a href="" title="Haml::Shared (module)">Shared</a></span></dd>
      
    
  
    
  
  
    <dt class="r2">Included in:</dt>
    <dd class="r2"><span class='object_link'><a href="" title="Haml::Shared (module)">Shared</a></span></dd>
    
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">/build/buildd/ruby-haml-3.1.4/lib/haml/shared.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>This module contains functionality that&#8217;s shared between Haml and Sass.</p>

  </div>
</div>
<div class="tags">
  

</div>




  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#balance-instance_method" title="#balance (instance method)">- ((String, String)) <strong>balance</strong>(scanner, start, finish, count = 0) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Moves a scanner through a balanced pair of characters.</p></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#handle_interpolation-instance_method" title="#handle_interpolation (instance method)">- (String) <strong>handle_interpolation</strong>(str) {|scan| ... }</a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Scans through a string looking for the interoplation-opening <code>#{</code> and, when it&#8217;s found, yields the scanner to the calling code so it can handle it properly.</p>

<p>The scanner will have any backslashes immediately in front of the <code>#{</code> as the second capture group (<code>scan[2]</code>), and the text prior to that as the first (<code>scan[1]</code>)..</p></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#human_indentation-instance_method" title="#human_indentation (instance method)">- (String) <strong>human_indentation</strong>(indentation, was = false) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>Formats a string for use in error messages about indentation.</p></div></span>
  
</li>

      
    </ul>
  



  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="balance-instance_method">
  
    - (<tt>(String, String)</tt>) <strong>balance</strong>(scanner, start, finish, count = 0) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Moves a scanner through a balanced pair of characters. For example:</p>

<pre class="code">Foo (Bar (Baz bang) bop) (Bang (bop bip))
^                       ^
from                    to</pre>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='name'>scanner</span>
      
      
        <span class='type'>(<tt>StringScanner</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The string scanner to move</p></div>
      
    </li>
  
    <li>
      
        <span class='name'>start</span>
      
      
        <span class='type'>(<tt>Character</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The character opening the balanced pair. A <code>Fixnum</code> in 1.8, a <code>String</code> in 1.9</p></div>
      
    </li>
  
    <li>
      
        <span class='name'>finish</span>
      
      
        <span class='type'>(<tt>Character</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The character closing the balanced pair. A <code>Fixnum</code> in 1.8, a <code>String</code> in 1.9</p></div>
      
    </li>
  
    <li>
      
        <span class='name'>count</span>
      
      
        <span class='type'>(<tt>Fixnum</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>0</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>The number of opening characters matched before calling this method</p></div>
      
    </li>
  
</ul>

<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>(String, String)</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The string matched within the balanced pair and the rest of the string. <code>[&quot;Foo (Bar (Baz bang) bop)&quot;, &quot; (Bang (bop bip))&quot;]</code> in the example above.</p></div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


41
42
43
44
45
46
47
48
49
50
51</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/build/buildd/ruby-haml-3.1.4/lib/haml/shared.rb', line 41</span>

def balance(scanner, start, finish, count = 0)
  str = ''
  scanner = StringScanner.new(scanner) unless scanner.is_a? StringScanner
  regexp = Regexp.new(&quot;(.*?)[\\#{start.chr}\\#{finish.chr}]&quot;, Regexp::MULTILINE)
  while scanner.scan(regexp)
    str &lt;&lt; scanner.matched
    count += 1 if scanner.matched[-1] == start
    count -= 1 if scanner.matched[-1] == finish
    return [str.strip, scanner.rest] if count == 0
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="handle_interpolation-instance_method">
  
    - (<tt>String</tt>) <strong>handle_interpolation</strong>(str) {|scan| ... }
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Scans through a string looking for the interoplation-opening <code>#{</code> and, when it&#8217;s found, yields the scanner to the calling code so it can handle it properly.</p>

<p>The scanner will have any backslashes immediately in front of the <code>#{</code> as the second capture group (<code>scan[2]</code>), and the text prior to that as the first (<code>scan[1]</code>).</p>

  </div>
</div>
<div class="tags">
  
<h3>Yield Parameters:</h3>
<ul class="yieldparam">
  
    <li>
      
        <span class='name'>scan</span>
      
      
        <span class='type'>(<tt>StringScanner</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The scanner scanning through the string</p></div>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The text remaining in the scanner after all <code>#{</code>s have been processed</p></div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


18
19
20
21
22</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/build/buildd/ruby-haml-3.1.4/lib/haml/shared.rb', line 18</span>

def handle_interpolation(str)
  scan = StringScanner.new(str)
  yield scan while scan.scan(/(.*?)(\\*)\#\{/)
  scan.rest
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="human_indentation-instance_method">
  
    - (<tt>String</tt>) <strong>human_indentation</strong>(indentation, was = false) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Formats a string for use in error messages about indentation.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='name'>indentation</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The string used for indentation</p></div>
      
    </li>
  
    <li>
      
        <span class='name'>was</span>
      
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
        <em class="default">(defaults to: <tt>false</tt>)</em>
      
      
        &mdash;
        <div class='inline'><p>Whether or not to add <code>&quot;was&quot;</code> or <code>&quot;were&quot;</code> (depending on how many characters were in <code>indentation</code>)</p></div>
      
    </li>
  
</ul>

<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>The name of the indentation (e.g. <code>&quot;12 spaces&quot;</code>, <code>&quot;1 tab&quot;</code>)</p></div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/build/buildd/ruby-haml-3.1.4/lib/haml/shared.rb', line 59</span>

def human_indentation(indentation, was = false)
  if !indentation.include?(?\t)
    noun = 'space'
  elsif !indentation.include?(?\s)
    noun = 'tab'
  else
    return indentation.inspect + (was ? ' was' : '')
  end

  singular = indentation.length == 1
  if was
    was = singular ? ' was' : ' were'
  else
    was = ''
  end

  &quot;#{indentation.length} #{noun}#{'s' unless singular}#{was}&quot;
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Tue Jan  3 12:26:12 2012 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.7.4 (ruby-1.8.7).
</div>

  </body>
</html>