282: def main_url
283: main_page = @options.main_page
284: ref = nil
285: if main_page
286: ref = AllReferences[main_page]
287: if ref
288: ref = ref.path
289: else
290: $stderr.puts "Could not find main page #{main_page}"
291: end
292: end
293:
294: unless ref
295: for file in @files
296: if file.document_self and file.context.global
297: ref = CGI.escapeHTML("#{CLASS_DIR}/#{file.context.module_name}.html")
298: break
299: end
300: end
301: end
302:
303: unless ref
304: for file in @files
305: if file.document_self and !file.context.global
306: ref = CGI.escapeHTML("#{CLASS_DIR}/#{file.context.module_name}.html")
307: break
308: end
309: end
310: end
311:
312: unless ref
313: $stderr.puts "Couldn't find anything to document"
314: $stderr.puts "Perhaps you've used :stopdoc: in all classes"
315: exit(1)
316: end
317:
318: ref
319: end