build_doc.rb in rio-0.3.8 vs build_doc.rb in rio-0.3.9
- old
+ new
@@ -1,9 +1,9 @@
#!/usr/bin/env ruby
#--
# ===============================================================================
-# Copyright (c) 2005, 2006 Christopher Kleckner
+# Copyright (c) 2005,2006,2007 Christopher Kleckner
# All rights reserved
#
# This file is part of the Rio library for ruby.
#
# Rio is free software; you can redistribute it and/or modify
@@ -26,42 +26,44 @@
# from the distribution directory.
#++
$:.unshift 'lib'
require 'rio'
+require 'rio/prompt'
+require 'doc/pkg_def'
module DFLT
RDOC_DIR = rio('doc/rdoc')
end
-puts "Rio interactive RDoc installer."
+#puts "Rio interactive RDoc installer."
-rdoc_dir = rio(?-).print!("Where shall I build the rdoc documentation[#{DFLT::RDOC_DIR}]: ").chomp.gets.strip
+rdoc_dir = RIO.promptd('Where shall I build the rdoc documentation',DFLT::RDOC_DIR)
rdoc_dir = DFLT::RDOC_DIR if rdoc_dir.empty?
rdoc_dir = rio(rdoc_dir)
-puts "Building the Rio RDoc documentation in '#{rdoc_dir}'"
+argv = []
+argv << '--op' << rdoc_dir.to_s
+argv += PKG::RDOC_OPTIONS
+argv += PKG::FILES::DOC
-RDOC_OPTIONS = ['--line-numbers', '-m RIO::Doc::SYNOPSIS',"--op #{rdoc_dir}", "-T doc/generators/template/html/rio"]
+require 'rdoc/rdoc'
+begin
+ r = RDoc::RDoc.new
+ r.document(argv)
+rescue RDoc::RDocError => e
+ $stderr.puts e.message
+ exit(1)
+end
-rdoc_files = [
- rio('README'),
- rio('lib/rio.rb'),
- rio('lib/rio/')['kernel.rb','constructor.rb'],
- rio('lib/rio/doc')['*.rb'],
- rio('lib/rio/if').skipfiles('yaml.rb').files['*.rb'],
-]
-
-cmd = sprintf("rdoc %s %s",RDOC_OPTIONS.join(' '),rdoc_files.join(' '))
-
-rio(?-,cmd) > ?-
-
docindex = (rdoc_dir/'index.html').abs.to_url
msg = "Please point your browser at '#{docindex}'"
lin = ">" + ">" * (msg.length+2) + ">"
puts
puts lin
puts "> " + msg + " >"
puts lin
+__END__
+