#!/usr/bin/env ruby

$LOAD_PATH << "../../../lib" unless $LOAD_PATH.include?("../../../lib")
require "qwik/util-path"

src = <<"EOT"
/* Copyright (C) 2003-2005 Kouichirou Eto, All rights reserved.
   This is free software with ABSOLUTELY NO WARRANTY.
   You can redistribute it and/or modify it under the terms of the GNU GPL2. */

EOT

path = ".".path
path.each_entry {|file|
  f = file.to_s
  next unless /\.css\z/ =~ f
  s = ""
  file.open {|f|
    while line = f.gets
      line.sub!(/\/\/.+$/, "")
      case line
      when /\A\/\//, /\A\s*$/
	# do nothing
      when /\A\/\*.+\*\/$/
	# do nothing
      else
	s << line
      end
    end
    f.read
  }
  src << s
}

"../all.css".path.open("wb") {|f|
  f.puts src
}
