aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Richard Brown <rbrown@exherbo.org> 2008-01-15 22:23:54 +0000
committerAvatar Richard Brown <rbrown@exherbo.org> 2008-01-15 22:23:54 +0000
commite9b0bf0afb5f085323cbb70ffca5f4b6ada8b81d (patch)
tree3700551a056aad26764edf0649396252466e7da4
parent46a67ade41a654b6951492cc5ec8b289310371a9 (diff)
downloadpaludis-e9b0bf0afb5f085323cbb70ffca5f4b6ada8b81d.tar.gz
paludis-e9b0bf0afb5f085323cbb70ffca5f4b6ada8b81d.tar.xz
(ruby) Use allison for rdoc template.
-rw-r--r--configure.ac24
-rw-r--r--doc/api/ruby/Makefile.am2
-rw-r--r--doc/api/ruby/create_ruby_doc.rb5
3 files changed, 30 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index cdd8a34..445554d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -876,9 +876,33 @@ if test "x$enable_ruby" = "xyes" ; then
fi
AC_MSG_RESULT([$RUBY_INSTALL_DIR])
AC_SUBST([RUBY_INSTALL_DIR])
+
+ AC_MSG_CHECKING([whether to build the Ruby documentation])
+ AC_ARG_ENABLE([ruby-doc],
+ AS_HELP_STRING([--enable-ruby-doc], [Enable Ruby documentation (default: disable)]),
+ enable_ruby_doc=$enableval,
+ enable_ruby_doc=no)
+ AC_MSG_RESULT($enable_ruby_doc)
+
+ if test "x$enable_ruby_doc" = "xyes" ; then
+ AC_MSG_CHECKING([for allison])
+ if ruby -rubygems -e "require 'allison'" >/dev/null 2>/dev/null ; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR([allison (http://blog.evanweaver.com/files/doc/fauna/allison/files/README.html) is needed to build Ruby documentation])
+ fi
+
+ AC_MSG_CHECKING([for syntax])
+ if ruby -rubygems -e "require 'syntax/convertors/html'" >/dev/null 2>/dev/null ; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_ERROR([syntax (http://syntax.rubyforge.org) is needed to build Ruby documentation])
+ fi
+ fi
fi
AM_CONDITIONAL([ENABLE_RUBY], test "x$enable_ruby" = "xyes")
+AM_CONDITIONAL([ENABLE_RUBY_DOC], test "x$enable_ruby_doc" = "xyes")
dnl }}}
dnl {{{ python interface
diff --git a/doc/api/ruby/Makefile.am b/doc/api/ruby/Makefile.am
index c4826ca..12be425 100644
--- a/doc/api/ruby/Makefile.am
+++ b/doc/api/ruby/Makefile.am
@@ -38,7 +38,7 @@ examples = \
EXTRA_DIST = $(examples) \
ruby_syntax.css
-if ENABLE_RUBY
+if ENABLE_RUBY_DOC
all-local : rdoc
diff --git a/doc/api/ruby/create_ruby_doc.rb b/doc/api/ruby/create_ruby_doc.rb
index f510af1..221ad24 100644
--- a/doc/api/ruby/create_ruby_doc.rb
+++ b/doc/api/ruby/create_ruby_doc.rb
@@ -3,6 +3,10 @@
require 'rdoc/rdoc'
+gps = Gem::GemPathSearcher.new;
+allison_spec = gps.find('allison.rb');
+allison = "#{Gem::dir}/gems/#{allison_spec.name}-#{allison_spec.version}/lib/allison.rb"
+
module RDoc
class C_Parser_Paludis < C_Parser
@@ -77,6 +81,7 @@ module RDoc
end
end
begin
+ ARGV << '--template' << allison
r = RDoc::RDoc.new
r.document(ARGV)
rescue RDoc::RDocError => e