Subversion Info

Rev
35
Last Checked In
2008-09-22 15:14:43 (3 days ago)
Checked in by
deveiant

Parent

Included Modules

Class Index

Quicksearch

RDoc::Generator::Darkfish

A erb-based RDoc HTML generator

Constants

SVNRev
Subversion rev
SVNId
Subversion ID
GENERATOR_DIR
Path to this file‘s parent directory. Used to find templates and other resources.
VERSION
Release Version
SVNID_PATTERN
%q$Id: darkfish.rb 35 2008-09-22 15:14:43Z deveiant $"

Attributes

outputdir[R]
The output directory

Public Class Methods

for( options ) click to toggle source

Standard generator factory method

    # File lib/rdoc/generator/darkfish.rb, line 69
69:     def self::for( options )
70:         new( options )
71:     end
new( *args ) click to toggle source

Initialize a few instance variables before we start

    # File lib/rdoc/generator/darkfish.rb, line 79
79:     def initialize( *args )
80:         @template = nil
81:         @template_dir = GENERATOR_DIR + 'template/darkfish'
82:         
83:         @files      = []
84:         @classes    = []
85:         @hyperlinks = {}
86: 
87:         @basedir = Pathname.pwd.expand_path
88: 
89:         super
90:     end

Public Instance Methods

debug_msg( *msg ) click to toggle source

Output progress information if debugging is enabled

     # File lib/rdoc/generator/darkfish.rb, line 102
102:     def debug_msg( *msg )
103:         return unless $DEBUG
104:         $stderr.puts( *msg )
105:     end
gen_sub_directories() click to toggle source

Create the directories the generated docs will live in if they don‘t already exist.

     # File lib/rdoc/generator/darkfish.rb, line 110
110:     def gen_sub_directories
111:         @outputdir.mkpath
112:     end
generate( toplevels ) click to toggle source

Build the initial indices and output objects based on an array of TopLevel objects containing the extracted information.

     # File lib/rdoc/generator/darkfish.rb, line 130
130:     def generate( toplevels )
131:         @outputdir = Pathname.new( @options.op_dir ).expand_path( @basedir )
132:         if RDoc::Generator::Context.respond_to?( :build_indicies)
133:            @files, @classes = RDoc::Generator::Context.build_indicies( toplevels, @options )
134:         else
135:            @files, @classes = RDoc::Generator::Context.build_indices( toplevels, @options )
136:         end
137: 
138:         # Now actually write the output
139:         generate_xhtml( @options, @files, @classes )
140: 
141:     rescue StandardError => err
142:         debug_msg "%s: %s\n  %s" % [ err.class.name, err.message, err.backtrace.join("\n  ") ]
143:         raise
144:     end
generate_xhtml( options, files, classes ) click to toggle source

Generate output

     # File lib/rdoc/generator/darkfish.rb, line 153
153:     def generate_xhtml( options, files, classes )
154:         files = gen_into( @files )
155:         classes = gen_into( @classes )
156: 
157:         # Make a hash of class info keyed by class name
158:         classes_by_classname = classes.inject({}) {|hash, classinfo|
159:             hash[ classinfo['full_name'] ] = classinfo
160:             hash[ classinfo['full_name'] ][:outfile] =
161:                 classinfo['full_name'].gsub( /::/, '/' ) + '.html'
162:             hash
163:         }
164: 
165:         # Make a hash of file info keyed by path
166:         files_by_path = files.inject({}) {|hash, fileinfo|
167:             hash[ fileinfo['full_path'] ] = fileinfo
168:             hash[ fileinfo['full_path'] ][:outfile] = 
169:                 fileinfo['full_path'] + '.html'
170:             hash
171:         }
172:         
173:         self.write_style_sheet
174:         self.generate_index( options, files_by_path, classes_by_classname )
175:         self.generate_class_files( options, files_by_path, classes_by_classname )
176:         self.generate_file_files( options, files_by_path, classes_by_classname )
177:     end
write_style_sheet() click to toggle source

Copy over the stylesheet into the appropriate place in the output directory.

     # File lib/rdoc/generator/darkfish.rb, line 117
117:     def write_style_sheet
118:         debug_msg "Copying over static files"
119:         staticfiles = %w[rdoc.css js images]
120:         staticfiles.each do |path|
121:             FileUtils.cp_r( @template_dir + path, '.', :verbose => $DEBUG, :noop => $dryrun )
122:         end
123:     end

Protected Instance Methods

generate_class_files( options, files, classes ) click to toggle source

Generate a documentation file for each class present in the given hash of classes.

     # File lib/rdoc/generator/darkfish.rb, line 246
246:     def generate_class_files( options, files, classes )
247:         debug_msg "Generating class documentation in #@outputdir"
248:         templatefile = @template_dir + 'classpage.rhtml'
249:         outputdir = @outputdir
250: 
251:         modsort = self.get_sorted_module_list( classes )
252: 
253:         classes.sort_by {|k,v| k }.each do |classname, classinfo|
254:             debug_msg "  working on %s (%s)" % [ classname, classinfo[:outfile] ]
255:             outfile    = outputdir + classinfo[:outfile]
256:             rel_prefix = outputdir.relative_path_from( outfile.dirname )
257:             svninfo    = self.get_svninfo( classinfo )
258: 
259:             self.render_template( templatefile, binding(), outfile )
260:         end
261:     end
generate_file_files( options, files, classes ) click to toggle source

Generate a documentation file for each file present in the given hash of files.

     # File lib/rdoc/generator/darkfish.rb, line 266
266:     def generate_file_files( options, files, classes )
267:         debug_msg "Generating file documentation in #@outputdir"
268:         templatefile = @template_dir + 'filepage.rhtml'
269: 
270:         files.sort_by {|k,v| k }.each do |path, fileinfo|
271:             outfile     = @outputdir + fileinfo[:outfile]
272:             debug_msg "  working on %s (%s)" % [ path, outfile ]
273:             rel_prefix  = @outputdir.relative_path_from( outfile.dirname )
274:             context     = binding()
275: 
276:             debug_msg "  rending #{outfile}"
277:             self.render_template( templatefile, binding(), outfile )
278:         end
279:     end
generate_index( options, files, classes ) click to toggle source

Generate an index page which lists all the classes which are documented.

     # File lib/rdoc/generator/darkfish.rb, line 210
210:     def generate_index( options, files, classes )
211:         debug_msg "Rendering the index page..."
212: 
213:         templatefile = @template_dir + 'index.rhtml'
214:         template_src = templatefile.read
215:         template = ERB.new( template_src, nil, '<>' )
216:         template.filename = templatefile.to_s
217:         context = binding()
218: 
219:         modsort = self.get_sorted_module_list( classes )
220:         output = nil
221:         begin
222:             output = template.result( context )
223:         rescue NoMethodError => err
224:             raise "Error while evaluating %s: %s (at %p)" % [
225:                 templatefile,
226:                 err.message,
227:                 eval( "_erbout[-50,50]", context )
228:             ]
229:         end
230: 
231:         outfile = @basedir + @options.op_dir + 'index.html'
232:         unless $dryrun
233:             debug_msg "Outputting to %s" % [outfile.expand_path]
234:             outfile.open( 'w', 0644 ) do |fh|
235:                 fh.print( output )
236:             end
237:         else
238:             debug_msg "Would have output to %s" % [outfile.expand_path]
239:         end
240:     end
get_sorted_module_list( classes ) click to toggle source

Return a list of the documented modules sorted by salience first, then by name.

     # File lib/rdoc/generator/darkfish.rb, line 186
186:     def get_sorted_module_list( classes )
187:         nscounts = classes.keys.inject({}) do |counthash, name|
188:             toplevel = name.gsub( /::.*/, '' )
189:             counthash[toplevel] ||= 0
190:             counthash[toplevel] += 1
191:             
192:             counthash
193:         end
194: 
195:         # Sort based on how often the toplevel namespace occurs, and then on the name 
196:         # of the module -- this works for projects that put their stuff into a 
197:         # namespace, of course, but doesn't hurt if they don't.
198:         return classes.keys.sort_by do |name| 
199:             toplevel = name.gsub( /::.*/, '' )
200:             [
201:                 nscounts[ toplevel ] * -1,
202:                 name
203:             ]
204:         end
205:     end
get_svninfo( classinfo ) click to toggle source

Try to extract Subversion information out of the first constant whose value looks like a subversion Id tag. If no matching constant is found, and empty hash is returned.

     # File lib/rdoc/generator/darkfish.rb, line 312
312:     def get_svninfo( classinfo )
313:         return {} unless classinfo['sections']
314:         constants = classinfo['sections'].first['constants'] or return {}
315:     
316:         constants.find {|c| c['value'] =~ SVNID_PATTERN } or return {}
317: 
318:         filename, rev, date, time, committer = $~.captures
319:         commitdate = Time.parse( date + ' ' + time )
320:         
321:         return {
322:             :filename    => filename,
323:             :rev         => Integer( rev ),
324:             :commitdate  => commitdate,
325:             :commitdelta => time_delta_string( Time.now.to_i - commitdate.to_i ),
326:             :committer   => committer,
327:         }
328:     end
render_template( templatefile, context, outfile ) click to toggle source

Load and render the erb template in the given templatefile within the specified context (a Binding object) and write it out to outfile. Both templatefile and outfile should be Pathname-like objects.

     # File lib/rdoc/generator/darkfish.rb, line 334
334:     def render_template( templatefile, context, outfile )
335:         template_src = templatefile.read
336:         template = ERB.new( template_src, nil, '<>' )
337:         template.filename = templatefile.to_s
338: 
339:         output = begin
340:             template.result( context )
341:         rescue NoMethodError => err
342:             raise "Error while evaluating %s: %s (at %p)" % [
343:                 templatefile.to_s,
344:                 err.message,
345:                 eval( "_erbout[-50,50]", context )
346:             ]
347:         end
348: 
349:         unless $dryrun
350:             outfile.dirname.mkpath
351:             outfile.open( 'w', 0644 ) do |ofh|
352:                 ofh.print( output )
353:             end
354:         else
355:             debug_msg "  would have written %d bytes to %s" %
356:             [ output.length, outfile ]
357:         end
358:     end
time_delta_string( seconds ) click to toggle source

Return a string describing the amount of time in the given number of seconds in terms a human can understand easily.

     # File lib/rdoc/generator/darkfish.rb, line 284
284:     def time_delta_string( seconds )
285:         return 'less than a minute' if seconds < 1.minute 
286:         return (seconds / 1.minute).to_s + ' minute' + (seconds/60 == 1 ? '' : 's') if seconds < 50.minutes
287:         return 'about one hour' if seconds < 90.minutes
288:         return (seconds / 1.hour).to_s + ' hours' if seconds < 18.hours
289:         return 'one day' if seconds < 1.day
290:         return 'about one day' if seconds < 2.days
291:         return (seconds / 1.day).to_s + ' days' if seconds < 1.week
292:         return 'about one week' if seconds < 2.week
293:         return (seconds / 1.week).to_s + ' weeks' if seconds < 3.months
294:         return (seconds / 1.month).to_s + ' months' if seconds < 1.year
295:         return (seconds / 1.year).to_s + ' years'
296:     end

secsequence

--- SEC00006

seccomment

--- ""

attributes

--- 
- name: outputdir
  rw: R
  a_desc: |+
    
    The output directory
    

method_list

--- 
- methods: 
  - visibility: public
    aref: M000001
    name: for
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 69</span>\n\
      69:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-keyword kw\">self</span><span class=\"ruby-operator\">::</span><span class=\"ruby-keyword kw\">for</span>( <span class=\"ruby-identifier\">options</span> )\n\
      70:         <span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">options</span> )\n\
      71:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Standard generator factory method
      </p>
    params: ( options )
  - visibility: public
    aref: M000002
    name: new
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 79</span>\n\
      79:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">initialize</span>( <span class=\"ruby-operator\">*</span><span class=\"ruby-identifier\">args</span> )\n\
      80:         <span class=\"ruby-ivar\">@template</span> = <span class=\"ruby-keyword kw\">nil</span>\n\
      81:         <span class=\"ruby-ivar\">@template_dir</span> = <span class=\"ruby-constant\">GENERATOR_DIR</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">'template/darkfish'</span>\n\
      82:         \n\
      83:         <span class=\"ruby-ivar\">@files</span>      = []\n\
      84:         <span class=\"ruby-ivar\">@classes</span>    = []\n\
      85:         <span class=\"ruby-ivar\">@hyperlinks</span> = {}\n\
      86: \n\
      87:         <span class=\"ruby-ivar\">@basedir</span> = <span class=\"ruby-constant\">Pathname</span>.<span class=\"ruby-identifier\">pwd</span>.<span class=\"ruby-identifier\">expand_path</span>\n\
      88: \n\
      89:         <span class=\"ruby-keyword kw\">super</span>\n\
      90:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Initialize a few instance variables before we start
      </p>
    params: ( *args )
  category: Class
  type: Public
- methods: 
  - visibility: public
    aref: M000003
    name: debug_msg
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 102</span>\n\
      102:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">debug_msg</span>( <span class=\"ruby-operator\">*</span><span class=\"ruby-identifier\">msg</span> )\n\
      103:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-identifier\">$DEBUG</span>\n\
      104:         <span class=\"ruby-identifier\">$stderr</span>.<span class=\"ruby-identifier\">puts</span>( <span class=\"ruby-operator\">*</span><span class=\"ruby-identifier\">msg</span> )\n\
      105:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Output progress information if debugging is enabled
      </p>
    params: ( *msg )
  - visibility: public
    aref: M000004
    name: gen_sub_directories
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 110</span>\n\
      110:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">gen_sub_directories</span>\n\
      111:         <span class=\"ruby-ivar\">@outputdir</span>.<span class=\"ruby-identifier\">mkpath</span>\n\
      112:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Create the directories the generated docs will live in if they don&#8216;t
      already exist.
      </p>
    params: ()
  - visibility: public
    aref: M000006
    name: generate
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 130</span>\n\
      130:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">generate</span>( <span class=\"ruby-identifier\">toplevels</span> )\n\
      131:         <span class=\"ruby-ivar\">@outputdir</span> = <span class=\"ruby-constant\">Pathname</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-ivar\">@options</span>.<span class=\"ruby-identifier\">op_dir</span> ).<span class=\"ruby-identifier\">expand_path</span>( <span class=\"ruby-ivar\">@basedir</span> )\n\
      132:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-constant\">RDoc</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Generator</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Context</span>.<span class=\"ruby-identifier\">respond_to?</span>( <span class=\"ruby-identifier\">:build_indicies</span>)\n\
      133:            <span class=\"ruby-ivar\">@files</span>, <span class=\"ruby-ivar\">@classes</span> = <span class=\"ruby-constant\">RDoc</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Generator</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Context</span>.<span class=\"ruby-identifier\">build_indicies</span>( <span class=\"ruby-identifier\">toplevels</span>, <span class=\"ruby-ivar\">@options</span> )\n\
      134:         <span class=\"ruby-keyword kw\">else</span>\n\
      135:            <span class=\"ruby-ivar\">@files</span>, <span class=\"ruby-ivar\">@classes</span> = <span class=\"ruby-constant\">RDoc</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Generator</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Context</span>.<span class=\"ruby-identifier\">build_indices</span>( <span class=\"ruby-identifier\">toplevels</span>, <span class=\"ruby-ivar\">@options</span> )\n\
      136:         <span class=\"ruby-keyword kw\">end</span>\n\
      137: \n\
      138:         <span class=\"ruby-comment cmt\"># Now actually write the output</span>\n\
      139:         <span class=\"ruby-identifier\">generate_xhtml</span>( <span class=\"ruby-ivar\">@options</span>, <span class=\"ruby-ivar\">@files</span>, <span class=\"ruby-ivar\">@classes</span> )\n\
      140: \n\
      141:     <span class=\"ruby-keyword kw\">rescue</span> <span class=\"ruby-constant\">StandardError</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">err</span>\n\
      142:         <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-value str\">&quot;%s: %s\\n  %s&quot;</span> <span class=\"ruby-operator\">%</span> [ <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">class</span>.<span class=\"ruby-identifier\">name</span>, <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">message</span>, <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">backtrace</span>.<span class=\"ruby-identifier\">join</span>(<span class=\"ruby-value str\">&quot;\\n  &quot;</span>) ]\n\
      143:         <span class=\"ruby-identifier\">raise</span>\n\
      144:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Build the initial indices and output objects based on an array of TopLevel
      objects containing the extracted information.
      </p>
    params: ( toplevels )
  - visibility: public
    aref: M000007
    name: generate_xhtml
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 153</span>\n\
      153:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">generate_xhtml</span>( <span class=\"ruby-identifier\">options</span>, <span class=\"ruby-identifier\">files</span>, <span class=\"ruby-identifier\">classes</span> )\n\
      154:         <span class=\"ruby-identifier\">files</span> = <span class=\"ruby-identifier\">gen_into</span>( <span class=\"ruby-ivar\">@files</span> )\n\
      155:         <span class=\"ruby-identifier\">classes</span> = <span class=\"ruby-identifier\">gen_into</span>( <span class=\"ruby-ivar\">@classes</span> )\n\
      156: \n\
      157:         <span class=\"ruby-comment cmt\"># Make a hash of class info keyed by class name</span>\n\
      158:         <span class=\"ruby-identifier\">classes_by_classname</span> = <span class=\"ruby-identifier\">classes</span>.<span class=\"ruby-identifier\">inject</span>({}) {<span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">hash</span>, <span class=\"ruby-identifier\">classinfo</span><span class=\"ruby-operator\">|</span>\n\
      159:             <span class=\"ruby-identifier\">hash</span>[ <span class=\"ruby-identifier\">classinfo</span>[<span class=\"ruby-value str\">'full_name'</span>] ] = <span class=\"ruby-identifier\">classinfo</span>\n\
      160:             <span class=\"ruby-identifier\">hash</span>[ <span class=\"ruby-identifier\">classinfo</span>[<span class=\"ruby-value str\">'full_name'</span>] ][<span class=\"ruby-identifier\">:outfile</span>] =\n\
      161:                 <span class=\"ruby-identifier\">classinfo</span>[<span class=\"ruby-value str\">'full_name'</span>].<span class=\"ruby-identifier\">gsub</span>( <span class=\"ruby-regexp re\">/::/</span>, <span class=\"ruby-value str\">'/'</span> ) <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">'.html'</span>\n\
      162:             <span class=\"ruby-identifier\">hash</span>\n\
      163:         }\n\
      164: \n\
      165:         <span class=\"ruby-comment cmt\"># Make a hash of file info keyed by path</span>\n\
      166:         <span class=\"ruby-identifier\">files_by_path</span> = <span class=\"ruby-identifier\">files</span>.<span class=\"ruby-identifier\">inject</span>({}) {<span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">hash</span>, <span class=\"ruby-identifier\">fileinfo</span><span class=\"ruby-operator\">|</span>\n\
      167:             <span class=\"ruby-identifier\">hash</span>[ <span class=\"ruby-identifier\">fileinfo</span>[<span class=\"ruby-value str\">'full_path'</span>] ] = <span class=\"ruby-identifier\">fileinfo</span>\n\
      168:             <span class=\"ruby-identifier\">hash</span>[ <span class=\"ruby-identifier\">fileinfo</span>[<span class=\"ruby-value str\">'full_path'</span>] ][<span class=\"ruby-identifier\">:outfile</span>] = \n\
      169:                 <span class=\"ruby-identifier\">fileinfo</span>[<span class=\"ruby-value str\">'full_path'</span>] <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">'.html'</span>\n\
      170:             <span class=\"ruby-identifier\">hash</span>\n\
      171:         }\n\
      172:         \n\
      173:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">write_style_sheet</span>\n\
      174:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">generate_index</span>( <span class=\"ruby-identifier\">options</span>, <span class=\"ruby-identifier\">files_by_path</span>, <span class=\"ruby-identifier\">classes_by_classname</span> )\n\
      175:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">generate_class_files</span>( <span class=\"ruby-identifier\">options</span>, <span class=\"ruby-identifier\">files_by_path</span>, <span class=\"ruby-identifier\">classes_by_classname</span> )\n\
      176:         <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">generate_file_files</span>( <span class=\"ruby-identifier\">options</span>, <span class=\"ruby-identifier\">files_by_path</span>, <span class=\"ruby-identifier\">classes_by_classname</span> )\n\
      177:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Generate output
      </p>
    params: ( options, files, classes )
  - visibility: public
    aref: M000005
    name: write_style_sheet
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 117</span>\n\
      117:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">write_style_sheet</span>\n\
      118:         <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-value str\">&quot;Copying over static files&quot;</span>\n\
      119:         <span class=\"ruby-identifier\">staticfiles</span> = <span class=\"ruby-node\">%w[rdoc.css js images]</span>\n\
      120:         <span class=\"ruby-identifier\">staticfiles</span>.<span class=\"ruby-identifier\">each</span> <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">path</span><span class=\"ruby-operator\">|</span>\n\
      121:             <span class=\"ruby-constant\">FileUtils</span>.<span class=\"ruby-identifier\">cp_r</span>( <span class=\"ruby-ivar\">@template_dir</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-identifier\">path</span>, <span class=\"ruby-value str\">'.'</span>, <span class=\"ruby-identifier\">:verbose</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">$DEBUG</span>, <span class=\"ruby-identifier\">:noop</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">$dryrun</span> )\n\
      122:         <span class=\"ruby-keyword kw\">end</span>\n\
      123:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Copy over the stylesheet into the appropriate place in the output
      directory.
      </p>
    params: ()
  category: Instance
  type: Public
- methods: 
  - visibility: protected
    aref: M000010
    name: generate_class_files
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 246</span>\n\
      246:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">generate_class_files</span>( <span class=\"ruby-identifier\">options</span>, <span class=\"ruby-identifier\">files</span>, <span class=\"ruby-identifier\">classes</span> )\n\
      247:         <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-value str\">&quot;Generating class documentation in #@outputdir&quot;</span>\n\
      248:         <span class=\"ruby-identifier\">templatefile</span> = <span class=\"ruby-ivar\">@template_dir</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">'classpage.rhtml'</span>\n\
      249:         <span class=\"ruby-identifier\">outputdir</span> = <span class=\"ruby-ivar\">@outputdir</span>\n\
      250: \n\
      251:         <span class=\"ruby-identifier\">modsort</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">get_sorted_module_list</span>( <span class=\"ruby-identifier\">classes</span> )\n\
      252: \n\
      253:         <span class=\"ruby-identifier\">classes</span>.<span class=\"ruby-identifier\">sort_by</span> {<span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">k</span>,<span class=\"ruby-identifier\">v</span><span class=\"ruby-operator\">|</span> <span class=\"ruby-identifier\">k</span> }.<span class=\"ruby-identifier\">each</span> <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">classname</span>, <span class=\"ruby-identifier\">classinfo</span><span class=\"ruby-operator\">|</span>\n\
      254:             <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-value str\">&quot;  working on %s (%s)&quot;</span> <span class=\"ruby-operator\">%</span> [ <span class=\"ruby-identifier\">classname</span>, <span class=\"ruby-identifier\">classinfo</span>[<span class=\"ruby-identifier\">:outfile</span>] ]\n\
      255:             <span class=\"ruby-identifier\">outfile</span>    = <span class=\"ruby-identifier\">outputdir</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-identifier\">classinfo</span>[<span class=\"ruby-identifier\">:outfile</span>]\n\
      256:             <span class=\"ruby-identifier\">rel_prefix</span> = <span class=\"ruby-identifier\">outputdir</span>.<span class=\"ruby-identifier\">relative_path_from</span>( <span class=\"ruby-identifier\">outfile</span>.<span class=\"ruby-identifier\">dirname</span> )\n\
      257:             <span class=\"ruby-identifier\">svninfo</span>    = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">get_svninfo</span>( <span class=\"ruby-identifier\">classinfo</span> )\n\
      258: \n\
      259:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">render_template</span>( <span class=\"ruby-identifier\">templatefile</span>, <span class=\"ruby-identifier\">binding</span>(), <span class=\"ruby-identifier\">outfile</span> )\n\
      260:         <span class=\"ruby-keyword kw\">end</span>\n\
      261:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Generate a documentation file for each class present in the given hash of
      <tt>classes</tt>.
      </p>
    params: ( options, files, classes )
  - visibility: protected
    aref: M000011
    name: generate_file_files
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 266</span>\n\
      266:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">generate_file_files</span>( <span class=\"ruby-identifier\">options</span>, <span class=\"ruby-identifier\">files</span>, <span class=\"ruby-identifier\">classes</span> )\n\
      267:         <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-value str\">&quot;Generating file documentation in #@outputdir&quot;</span>\n\
      268:         <span class=\"ruby-identifier\">templatefile</span> = <span class=\"ruby-ivar\">@template_dir</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">'filepage.rhtml'</span>\n\
      269: \n\
      270:         <span class=\"ruby-identifier\">files</span>.<span class=\"ruby-identifier\">sort_by</span> {<span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">k</span>,<span class=\"ruby-identifier\">v</span><span class=\"ruby-operator\">|</span> <span class=\"ruby-identifier\">k</span> }.<span class=\"ruby-identifier\">each</span> <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">path</span>, <span class=\"ruby-identifier\">fileinfo</span><span class=\"ruby-operator\">|</span>\n\
      271:             <span class=\"ruby-identifier\">outfile</span>     = <span class=\"ruby-ivar\">@outputdir</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-identifier\">fileinfo</span>[<span class=\"ruby-identifier\">:outfile</span>]\n\
      272:             <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-value str\">&quot;  working on %s (%s)&quot;</span> <span class=\"ruby-operator\">%</span> [ <span class=\"ruby-identifier\">path</span>, <span class=\"ruby-identifier\">outfile</span> ]\n\
      273:             <span class=\"ruby-identifier\">rel_prefix</span>  = <span class=\"ruby-ivar\">@outputdir</span>.<span class=\"ruby-identifier\">relative_path_from</span>( <span class=\"ruby-identifier\">outfile</span>.<span class=\"ruby-identifier\">dirname</span> )\n\
      274:             <span class=\"ruby-identifier\">context</span>     = <span class=\"ruby-identifier\">binding</span>()\n\
      275: \n\
      276:             <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-node\">&quot;  rending #{outfile}&quot;</span>\n\
      277:             <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">render_template</span>( <span class=\"ruby-identifier\">templatefile</span>, <span class=\"ruby-identifier\">binding</span>(), <span class=\"ruby-identifier\">outfile</span> )\n\
      278:         <span class=\"ruby-keyword kw\">end</span>\n\
      279:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Generate a documentation file for each file present in the given hash of
      <tt>files</tt>.
      </p>
    params: ( options, files, classes )
  - visibility: protected
    aref: M000009
    name: generate_index
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 210</span>\n\
      210:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">generate_index</span>( <span class=\"ruby-identifier\">options</span>, <span class=\"ruby-identifier\">files</span>, <span class=\"ruby-identifier\">classes</span> )\n\
      211:         <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-value str\">&quot;Rendering the index page...&quot;</span>\n\
      212: \n\
      213:         <span class=\"ruby-identifier\">templatefile</span> = <span class=\"ruby-ivar\">@template_dir</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">'index.rhtml'</span>\n\
      214:         <span class=\"ruby-identifier\">template_src</span> = <span class=\"ruby-identifier\">templatefile</span>.<span class=\"ruby-identifier\">read</span>\n\
      215:         <span class=\"ruby-identifier\">template</span> = <span class=\"ruby-constant\">ERB</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">template_src</span>, <span class=\"ruby-keyword kw\">nil</span>, <span class=\"ruby-value str\">'&lt;&gt;'</span> )\n\
      216:         <span class=\"ruby-identifier\">template</span>.<span class=\"ruby-identifier\">filename</span> = <span class=\"ruby-identifier\">templatefile</span>.<span class=\"ruby-identifier\">to_s</span>\n\
      217:         <span class=\"ruby-identifier\">context</span> = <span class=\"ruby-identifier\">binding</span>()\n\
      218: \n\
      219:         <span class=\"ruby-identifier\">modsort</span> = <span class=\"ruby-keyword kw\">self</span>.<span class=\"ruby-identifier\">get_sorted_module_list</span>( <span class=\"ruby-identifier\">classes</span> )\n\
      220:         <span class=\"ruby-identifier\">output</span> = <span class=\"ruby-keyword kw\">nil</span>\n\
      221:         <span class=\"ruby-keyword kw\">begin</span>\n\
      222:             <span class=\"ruby-identifier\">output</span> = <span class=\"ruby-identifier\">template</span>.<span class=\"ruby-identifier\">result</span>( <span class=\"ruby-identifier\">context</span> )\n\
      223:         <span class=\"ruby-keyword kw\">rescue</span> <span class=\"ruby-constant\">NoMethodError</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">err</span>\n\
      224:             <span class=\"ruby-identifier\">raise</span> <span class=\"ruby-value str\">&quot;Error while evaluating %s: %s (at %p)&quot;</span> <span class=\"ruby-operator\">%</span> [\n\
      225:                 <span class=\"ruby-identifier\">templatefile</span>,\n\
      226:                 <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">message</span>,\n\
      227:                 <span class=\"ruby-identifier\">eval</span>( <span class=\"ruby-value str\">&quot;_erbout[-50,50]&quot;</span>, <span class=\"ruby-identifier\">context</span> )\n\
      228:             ]\n\
      229:         <span class=\"ruby-keyword kw\">end</span>\n\
      230: \n\
      231:         <span class=\"ruby-identifier\">outfile</span> = <span class=\"ruby-ivar\">@basedir</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-ivar\">@options</span>.<span class=\"ruby-identifier\">op_dir</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">'index.html'</span>\n\
      232:         <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-identifier\">$dryrun</span>\n\
      233:             <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-value str\">&quot;Outputting to %s&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">outfile</span>.<span class=\"ruby-identifier\">expand_path</span>]\n\
      234:             <span class=\"ruby-identifier\">outfile</span>.<span class=\"ruby-identifier\">open</span>( <span class=\"ruby-value str\">'w'</span>, <span class=\"ruby-value\">0644</span> ) <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">fh</span><span class=\"ruby-operator\">|</span>\n\
      235:                 <span class=\"ruby-identifier\">fh</span>.<span class=\"ruby-identifier\">print</span>( <span class=\"ruby-identifier\">output</span> )\n\
      236:             <span class=\"ruby-keyword kw\">end</span>\n\
      237:         <span class=\"ruby-keyword kw\">else</span>\n\
      238:             <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-value str\">&quot;Would have output to %s&quot;</span> <span class=\"ruby-operator\">%</span> [<span class=\"ruby-identifier\">outfile</span>.<span class=\"ruby-identifier\">expand_path</span>]\n\
      239:         <span class=\"ruby-keyword kw\">end</span>\n\
      240:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Generate an index page which lists all the classes which are documented.
      </p>
    params: ( options, files, classes )
  - visibility: protected
    aref: M000008
    name: get_sorted_module_list
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 186</span>\n\
      186:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">get_sorted_module_list</span>( <span class=\"ruby-identifier\">classes</span> )\n\
      187:         <span class=\"ruby-identifier\">nscounts</span> = <span class=\"ruby-identifier\">classes</span>.<span class=\"ruby-identifier\">keys</span>.<span class=\"ruby-identifier\">inject</span>({}) <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">counthash</span>, <span class=\"ruby-identifier\">name</span><span class=\"ruby-operator\">|</span>\n\
      188:             <span class=\"ruby-identifier\">toplevel</span> = <span class=\"ruby-identifier\">name</span>.<span class=\"ruby-identifier\">gsub</span>( <span class=\"ruby-regexp re\">/::.*/</span>, <span class=\"ruby-value str\">''</span> )\n\
      189:             <span class=\"ruby-identifier\">counthash</span>[<span class=\"ruby-identifier\">toplevel</span>] <span class=\"ruby-operator\">||=</span> <span class=\"ruby-value\">0</span>\n\
      190:             <span class=\"ruby-identifier\">counthash</span>[<span class=\"ruby-identifier\">toplevel</span>] <span class=\"ruby-operator\">+=</span> <span class=\"ruby-value\">1</span>\n\
      191:             \n\
      192:             <span class=\"ruby-identifier\">counthash</span>\n\
      193:         <span class=\"ruby-keyword kw\">end</span>\n\
      194: \n\
      195:         <span class=\"ruby-comment cmt\"># Sort based on how often the toplevel namespace occurs, and then on the name </span>\n\
      196:         <span class=\"ruby-comment cmt\"># of the module -- this works for projects that put their stuff into a </span>\n\
      197:         <span class=\"ruby-comment cmt\"># namespace, of course, but doesn't hurt if they don't.</span>\n\
      198:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-identifier\">classes</span>.<span class=\"ruby-identifier\">keys</span>.<span class=\"ruby-identifier\">sort_by</span> <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">name</span><span class=\"ruby-operator\">|</span> \n\
      199:             <span class=\"ruby-identifier\">toplevel</span> = <span class=\"ruby-identifier\">name</span>.<span class=\"ruby-identifier\">gsub</span>( <span class=\"ruby-regexp re\">/::.*/</span>, <span class=\"ruby-value str\">''</span> )\n\
      200:             [\n\
      201:                 <span class=\"ruby-identifier\">nscounts</span>[ <span class=\"ruby-identifier\">toplevel</span> ] <span class=\"ruby-operator\">*</span> <span class=\"ruby-value\">-1</span>,\n\
      202:                 <span class=\"ruby-identifier\">name</span>\n\
      203:             ]\n\
      204:         <span class=\"ruby-keyword kw\">end</span>\n\
      205:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Return a list of the documented modules sorted by salience first, then by
      name.
      </p>
    params: ( classes )
  - visibility: protected
    aref: M000013
    name: get_svninfo
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 312</span>\n\
      312:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">get_svninfo</span>( <span class=\"ruby-identifier\">classinfo</span> )\n\
      313:         <span class=\"ruby-keyword kw\">return</span> {} <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-identifier\">classinfo</span>[<span class=\"ruby-value str\">'sections'</span>]\n\
      314:         <span class=\"ruby-identifier\">constants</span> = <span class=\"ruby-identifier\">classinfo</span>[<span class=\"ruby-value str\">'sections'</span>].<span class=\"ruby-identifier\">first</span>[<span class=\"ruby-value str\">'constants'</span>] <span class=\"ruby-keyword kw\">or</span> <span class=\"ruby-keyword kw\">return</span> {}\n\
      315:     \n\
      316:         <span class=\"ruby-identifier\">constants</span>.<span class=\"ruby-identifier\">find</span> {<span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">c</span><span class=\"ruby-operator\">|</span> <span class=\"ruby-identifier\">c</span>[<span class=\"ruby-value str\">'value'</span>] <span class=\"ruby-operator\">=~</span> <span class=\"ruby-constant\">SVNID_PATTERN</span> } <span class=\"ruby-keyword kw\">or</span> <span class=\"ruby-keyword kw\">return</span> {}\n\
      317: \n\
      318:         <span class=\"ruby-identifier\">filename</span>, <span class=\"ruby-identifier\">rev</span>, <span class=\"ruby-identifier\">date</span>, <span class=\"ruby-identifier\">time</span>, <span class=\"ruby-identifier\">committer</span> = <span class=\"ruby-identifier\">$~</span>.<span class=\"ruby-identifier\">captures</span>\n\
      319:         <span class=\"ruby-identifier\">commitdate</span> = <span class=\"ruby-constant\">Time</span>.<span class=\"ruby-identifier\">parse</span>( <span class=\"ruby-identifier\">date</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">' '</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-identifier\">time</span> )\n\
      320:         \n\
      321:         <span class=\"ruby-keyword kw\">return</span> {\n\
      322:             <span class=\"ruby-identifier\">:filename</span>    =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">filename</span>,\n\
      323:             <span class=\"ruby-identifier\">:rev</span>         =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-constant\">Integer</span>( <span class=\"ruby-identifier\">rev</span> ),\n\
      324:             <span class=\"ruby-identifier\">:commitdate</span>  =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">commitdate</span>,\n\
      325:             <span class=\"ruby-identifier\">:commitdelta</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">time_delta_string</span>( <span class=\"ruby-constant\">Time</span>.<span class=\"ruby-identifier\">now</span>.<span class=\"ruby-identifier\">to_i</span> <span class=\"ruby-operator\">-</span> <span class=\"ruby-identifier\">commitdate</span>.<span class=\"ruby-identifier\">to_i</span> ),\n\
      326:             <span class=\"ruby-identifier\">:committer</span>   =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">committer</span>,\n\
      327:         }\n\
      328:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Try to extract Subversion information out of the first constant whose value
      looks like a subversion Id tag. If no matching constant is found, and empty
      hash is returned.
      </p>
    params: ( classinfo )
  - visibility: protected
    aref: M000014
    name: render_template
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 334</span>\n\
      334:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">render_template</span>( <span class=\"ruby-identifier\">templatefile</span>, <span class=\"ruby-identifier\">context</span>, <span class=\"ruby-identifier\">outfile</span> )\n\
      335:         <span class=\"ruby-identifier\">template_src</span> = <span class=\"ruby-identifier\">templatefile</span>.<span class=\"ruby-identifier\">read</span>\n\
      336:         <span class=\"ruby-identifier\">template</span> = <span class=\"ruby-constant\">ERB</span>.<span class=\"ruby-identifier\">new</span>( <span class=\"ruby-identifier\">template_src</span>, <span class=\"ruby-keyword kw\">nil</span>, <span class=\"ruby-value str\">'&lt;&gt;'</span> )\n\
      337:         <span class=\"ruby-identifier\">template</span>.<span class=\"ruby-identifier\">filename</span> = <span class=\"ruby-identifier\">templatefile</span>.<span class=\"ruby-identifier\">to_s</span>\n\
      338: \n\
      339:         <span class=\"ruby-identifier\">output</span> = <span class=\"ruby-keyword kw\">begin</span>\n\
      340:             <span class=\"ruby-identifier\">template</span>.<span class=\"ruby-identifier\">result</span>( <span class=\"ruby-identifier\">context</span> )\n\
      341:         <span class=\"ruby-keyword kw\">rescue</span> <span class=\"ruby-constant\">NoMethodError</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">err</span>\n\
      342:             <span class=\"ruby-identifier\">raise</span> <span class=\"ruby-value str\">&quot;Error while evaluating %s: %s (at %p)&quot;</span> <span class=\"ruby-operator\">%</span> [\n\
      343:                 <span class=\"ruby-identifier\">templatefile</span>.<span class=\"ruby-identifier\">to_s</span>,\n\
      344:                 <span class=\"ruby-identifier\">err</span>.<span class=\"ruby-identifier\">message</span>,\n\
      345:                 <span class=\"ruby-identifier\">eval</span>( <span class=\"ruby-value str\">&quot;_erbout[-50,50]&quot;</span>, <span class=\"ruby-identifier\">context</span> )\n\
      346:             ]\n\
      347:         <span class=\"ruby-keyword kw\">end</span>\n\
      348: \n\
      349:         <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-identifier\">$dryrun</span>\n\
      350:             <span class=\"ruby-identifier\">outfile</span>.<span class=\"ruby-identifier\">dirname</span>.<span class=\"ruby-identifier\">mkpath</span>\n\
      351:             <span class=\"ruby-identifier\">outfile</span>.<span class=\"ruby-identifier\">open</span>( <span class=\"ruby-value str\">'w'</span>, <span class=\"ruby-value\">0644</span> ) <span class=\"ruby-keyword kw\">do</span> <span class=\"ruby-operator\">|</span><span class=\"ruby-identifier\">ofh</span><span class=\"ruby-operator\">|</span>\n\
      352:                 <span class=\"ruby-identifier\">ofh</span>.<span class=\"ruby-identifier\">print</span>( <span class=\"ruby-identifier\">output</span> )\n\
      353:             <span class=\"ruby-keyword kw\">end</span>\n\
      354:         <span class=\"ruby-keyword kw\">else</span>\n\
      355:             <span class=\"ruby-identifier\">debug_msg</span> <span class=\"ruby-value str\">&quot;  would have written %d bytes to %s&quot;</span> <span class=\"ruby-operator\">%</span>\n\
      356:             [ <span class=\"ruby-identifier\">output</span>.<span class=\"ruby-identifier\">length</span>, <span class=\"ruby-identifier\">outfile</span> ]\n\
      357:         <span class=\"ruby-keyword kw\">end</span>\n\
      358:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Load and render the erb template in the given <tt>templatefile</tt> within
      the specified <tt>context</tt> (a Binding object) and write it out to
      <tt>outfile</tt>. Both <tt>templatefile</tt> and <tt>outfile</tt> should be
      Pathname-like objects.
      </p>
    params: ( templatefile, context, outfile )
  - visibility: protected
    aref: M000012
    name: time_delta_string
    sourcecode: "     <span class=\"ruby-comment cmt\"># File lib/rdoc/generator/darkfish.rb, line 284</span>\n\
      284:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">time_delta_string</span>( <span class=\"ruby-identifier\">seconds</span> )\n\
      285:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-value str\">'less than a minute'</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">&lt;</span> <span class=\"ruby-value\">1</span>.<span class=\"ruby-identifier\">minute</span> \n\
      286:         <span class=\"ruby-keyword kw\">return</span> (<span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">/</span> <span class=\"ruby-value\">1</span>.<span class=\"ruby-identifier\">minute</span>).<span class=\"ruby-identifier\">to_s</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">' minute'</span> <span class=\"ruby-operator\">+</span> (<span class=\"ruby-identifier\">seconds</span><span class=\"ruby-operator\">/</span><span class=\"ruby-value\">60</span> <span class=\"ruby-operator\">==</span> <span class=\"ruby-value\">1</span> <span class=\"ruby-operator\">?</span> <span class=\"ruby-value str\">''</span> <span class=\"ruby-operator\">:</span> <span class=\"ruby-value str\">'s'</span>) <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">&lt;</span> <span class=\"ruby-value\">50</span>.<span class=\"ruby-identifier\">minutes</span>\n\
      287:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-value str\">'about one hour'</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">&lt;</span> <span class=\"ruby-value\">90</span>.<span class=\"ruby-identifier\">minutes</span>\n\
      288:         <span class=\"ruby-keyword kw\">return</span> (<span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">/</span> <span class=\"ruby-value\">1</span>.<span class=\"ruby-identifier\">hour</span>).<span class=\"ruby-identifier\">to_s</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">' hours'</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">&lt;</span> <span class=\"ruby-value\">18</span>.<span class=\"ruby-identifier\">hours</span>\n\
      289:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-value str\">'one day'</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">&lt;</span> <span class=\"ruby-value\">1</span>.<span class=\"ruby-identifier\">day</span>\n\
      290:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-value str\">'about one day'</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">&lt;</span> <span class=\"ruby-value\">2</span>.<span class=\"ruby-identifier\">days</span>\n\
      291:         <span class=\"ruby-keyword kw\">return</span> (<span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">/</span> <span class=\"ruby-value\">1</span>.<span class=\"ruby-identifier\">day</span>).<span class=\"ruby-identifier\">to_s</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">' days'</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">&lt;</span> <span class=\"ruby-value\">1</span>.<span class=\"ruby-identifier\">week</span>\n\
      292:         <span class=\"ruby-keyword kw\">return</span> <span class=\"ruby-value str\">'about one week'</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">&lt;</span> <span class=\"ruby-value\">2</span>.<span class=\"ruby-identifier\">week</span>\n\
      293:         <span class=\"ruby-keyword kw\">return</span> (<span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">/</span> <span class=\"ruby-value\">1</span>.<span class=\"ruby-identifier\">week</span>).<span class=\"ruby-identifier\">to_s</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">' weeks'</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">&lt;</span> <span class=\"ruby-value\">3</span>.<span class=\"ruby-identifier\">months</span>\n\
      294:         <span class=\"ruby-keyword kw\">return</span> (<span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">/</span> <span class=\"ruby-value\">1</span>.<span class=\"ruby-identifier\">month</span>).<span class=\"ruby-identifier\">to_s</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">' months'</span> <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">&lt;</span> <span class=\"ruby-value\">1</span>.<span class=\"ruby-identifier\">year</span>\n\
      295:         <span class=\"ruby-keyword kw\">return</span> (<span class=\"ruby-identifier\">seconds</span> <span class=\"ruby-operator\">/</span> <span class=\"ruby-value\">1</span>.<span class=\"ruby-identifier\">year</span>).<span class=\"ruby-identifier\">to_s</span> <span class=\"ruby-operator\">+</span> <span class=\"ruby-value str\">' years'</span>\n\
      296:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      Return a string describing the amount of time in the given number of
      seconds in terms a human can understand easily.
      </p>
    params: ( seconds )
  category: Instance
  type: Protected

sectitle

--- 

constants

--- 
- name: SVNRev
  desc: |+
    
    Subversion rev
    
  value: "%$Rev: 35 $"
- name: SVNId
  desc: |+
    
    Subversion ID
    
  value: "%$Id: darkfish.rb 35 2008-09-22 15:14:43Z deveiant $"
- name: GENERATOR_DIR
  desc: |+
    
    Path to this file&#8216;s parent directory. Used to find templates and
    other resources.
    
  value: Pathname.new( __FILE__ ).expand_path.dirname
- name: VERSION
  desc: |+
    
    Release Version
    
  value: "'1.1.5'"
- name: SVNID_PATTERN
  desc: |+
    
    %q$Id: darkfish.rb 35 2008-09-22 15:14:43Z deveiant $"
    
  value: "/         \\$Id:\\s              (\\S+)\\s                  # filename             (\\d+)\\s                  # rev             (\\d{4}-\\d{2}-\\d{2})\\s    # Date (YYYY-MM-DD)             (\\d{2}:\\d{2}:\\d{2}Z)\\s   # Time (HH:MM:SSZ)             (\\w+)\\s                # committer         \\$$     /x"

[Validate]

Generated with the Darkfish Rdoc Generator.