Method: Generators::PuppetGenerator#main_url

Defined in:
lib/puppet/util/rdoc/generators/puppet_generator.rb

#main_urlObject

returns the initial_page url



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
# File 'lib/puppet/util/rdoc/generators/puppet_generator.rb', line 312

def main_url
  main_page = @options.main_page
  ref = nil
  if main_page
    ref = AllReferences[main_page]
    if ref
      ref = ref.path
    else
      $stderr.puts "Could not find main page #{main_page}"
    end
  end

  unless ref
    @files.each do |file|
      if file.document_self and file.context.global
        ref = CGI.escapeHTML("#{CLASS_DIR}/#{file.context.module_name}.html")
        break
      end
    end
  end

  unless ref
    @files.each do |file|
      if file.document_self and !file.context.global
        ref = CGI.escapeHTML("#{CLASS_DIR}/#{file.context.module_name}.html")
        break
      end
    end
  end

  unless ref
    $stderr.puts "Couldn't find anything to document"
    $stderr.puts "Perhaps you've used :stopdoc: in all classes"
    exit(1)
  end

  ref
end