#!/usr/bin/env ruby
# 表題: やまだ由用の rd2 実行スクリプト
# 履歴: 2003/10/06
require '/home/yukiko/lib/rd2-yukiko'

# rd のコマンド

# dennou-t
 $rd2html =  'rd2 --r /home/yukiko/lib/ruby/site_ruby/1.6/rd/rd2html-ext-lib --with-part=html:include --out-code=euc --with-css=../../include/ape.css  --ref-extension --native-inline'

# asa
# $rd2html =  'rd2 --r rd/rd2html-ext-lib --with-part=html:include --out-code=euc --with-css=include/style.css  --ref-extension --native-inline'

# www
#  $rd2html =  '/home/yukiko/bin/rd2 --r /home/yukiko/lib/ruby/site_ruby/1.8/rd/rd2html-ext-lib --with-part=html:include --out-code=euc --with-css=include/asa.css  --ref-extension --native-inline --enable-br'



# main()
=begin
Dir.chdir(Dir.pwd)
File.delete("tmp.rd") if File.exist?("tmp.rd")

if ARGV[0] == nil
  rd2start_all
else
  rd2start(ARGV[0])  
end
=end

# dennou
if ARGV[0] == nil
  rd2start_all
  Dir.foreach(Dir.pwd + "/..") { |infile|
    if infile =~ /.html$/
      File.delete(Dir.pwd + "/../" + infile)  if infile =~ /^table/
    end
  } 
elsif ARGV[0] == "clean"
  Dir.foreach(Dir.pwd) { |infile|
    if infile =~ /.html$/
      File.delete(infile)  unless infile =~ /^table/
    end
  }    
else
  rd2start(ARGV[0])
end


