[cairo-commit] rcairo ChangeLog,1.172,1.173 Rakefile,1.2,1.3

Kouhei Sutou commit at pdx.freedesktop.org
Sat May 26 19:14:21 PDT 2007


Committed by: kou

Update of /cvs/cairo/rcairo
In directory kemper:/tmp/cvs-serv15433

Modified Files:
	ChangeLog Rakefile 
Log Message:
* Rakefile: supported document update.


Index: ChangeLog
===================================================================
RCS file: /cvs/cairo/rcairo/ChangeLog,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -d -r1.172 -r1.173
--- ChangeLog	27 May 2007 01:19:59 -0000	1.172
+++ ChangeLog	27 May 2007 02:14:09 -0000	1.173
@@ -1,5 +1,7 @@
 2007-05-27  Kouhei Sutou  <kou at cozmixng.org>
 
+	* Rakefile: supported document update.
+
 	* src/depend (install-so): used install-so instead of install.
 
 	* src/rb_cairo_font_options.c (Cairo::FontOptions#merge): renamed

Index: Rakefile
===================================================================
RCS file: /cvs/cairo/rcairo/Rakefile,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Rakefile	13 Apr 2007 13:15:39 -0000	1.2
+++ Rakefile	27 May 2007 02:14:09 -0000	1.3
@@ -12,8 +12,11 @@
   x.gsub(/^#{Regexp.escape(base_dir + File::SEPARATOR)}/, '')
 end
 
-$LOAD_PATH.unshift(File.join(base_dir, 'src'))
-$LOAD_PATH.unshift(File.join('src', 'lib'))
+cairo_ext_dir = File.join(base_dir, 'src')
+cairo_lib_dir = File.join(cairo_ext_dir, 'lib')
+$LOAD_PATH.unshift(cairo_ext_dir)
+$LOAD_PATH.unshift(cairo_lib_dir)
+ENV["RUBYLIB"] = "#{cairo_lib_dir}:#{cairo_ext_dir}:#{ENV['RUBYLIB']}"
 require 'cairo'
 
 manifest = File.join(base_dir, "Manifest.txt")
@@ -65,6 +68,7 @@
   project.changes = project.paragraphs_of(news, 0..1).join("\n\n")
   project.description = "Ruby bindings for cairo"
   project.need_tar = false
+  project.remote_rdoc_dir = "doc"
 end
 
 project.spec.dependencies.delete_if {|dependency| dependency.name == "hoe"}
@@ -101,3 +105,76 @@
     rm_f project.bin_files.collect {|f| f.sub(/^bin#{File::SEPARATOR}/, '')}
   end
 end
+
+
+langs = [
+  ["en", "English"],
+  ["ja", "日本語"],
+]
+
+rcairo_doc_dir = File.expand_path(File.join(base_dir, "..", "rcairo-doc"))
+rcairo_doc_css = File.join(rcairo_doc_dir, "doc.css")
+rcairo_doc_title_image = File.join(rcairo_doc_dir, "rcairo-title.png")
+doc_dir = "doc"
+doc_index = File.join(doc_dir, "index.html")
+doc_css = File.join(doc_dir, "doc.css")
+doc_title_image = File.join(doc_dir, "rcairo-title.png")
+task(doc_index).instance_variable_get("@actions").clear
+
+file doc_index => doc_dir do
+  mkdir_p doc_dir
+end
+
+file doc_title_image => rcairo_doc_title_image do
+  cp rcairo_doc_title_image, doc_title_image
+end
+
+file doc_css => [rcairo_doc_css, doc_title_image] do
+  cp rcairo_doc_css, doc_css
+end
+
+file doc_index => doc_css do
+  File.open(doc_index, "w") do |index|
+    index << <<-EOH
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+  <head>
+    <title>rcairo reference manual</title>
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+  </head>
+
+  <body>
+    <h1>rcairo reference manual</h1>
+
+    <ul>
+EOH
+
+    langs.each do |lang, native_lang|
+      index << <<-EOH
+      <li><a href="#{lang}/">#{native_lang}</a></li>
+EOH
+    end
+
+    index << <<-EOH
+    </ui>
+
+    <p><a href="../">Up</a></p>
+  </body>
+</html>
+EOH
+  end
+end
+
+langs.each do |lang,|
+  lang_doc_index = File.join(doc_dir, lang, "index.html")
+  task doc_index => lang_doc_index
+  file lang_doc_index do
+    lang_doc_dir = File.join(doc_dir, lang)
+    lang_rcairo_doc_dir = File.join(rcairo_doc_dir, lang)
+    mkdir_p lang_doc_dir
+    cp Dir[File.join(lang_rcairo_doc_dir, "*.rd")], lang_doc_dir
+    ruby File.join(rcairo_doc_dir, "update-html.rb"), lang_doc_dir
+    ruby File.join(rcairo_doc_dir, "update-html.rb"), lang_doc_dir
+    rm Dir[File.join(lang_doc_dir, "*.{rd,rdc,rbl}")]
+  end
+end



More information about the cairo-commit mailing list