From ec519b9b43db7756fcc2c19020ece2d7e2263fe4 Mon Sep 17 00:00:00 2001 From: drbrain Date: Sun, 13 Jan 2008 03:13:37 +0000 Subject: Complete RDoc namespace change git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/generator/xml/rdf.rb | 113 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 lib/rdoc/generator/xml/rdf.rb (limited to 'lib/rdoc/generator/xml/rdf.rb') diff --git a/lib/rdoc/generator/xml/rdf.rb b/lib/rdoc/generator/xml/rdf.rb new file mode 100644 index 0000000000..7b15c69a18 --- /dev/null +++ b/lib/rdoc/generator/xml/rdf.rb @@ -0,0 +1,113 @@ +require 'rdoc/generator/xml' + +module RDoc::Generator::XML::RDF + + CONTENTS_RDF = <<-EOF +<% if defined? classes and classes["description"] then %> + +<%= classes["description"] %> + +<% end %> + +<% if defined? files and files["requires"] then %> +<% files["requires"].each do |requires| %> + " /> +<% end # files["requires"] %> +<% end %> + +<% if defined? classes and classes["includes"] then %> + +<% classes["includes"].each do |includes| %> + " /> +<% end # includes["includes"] %> + +<% end %> + +<% if defined? classes and classes["sections"] then %> +<% classes["sections"].each do |sections| %> +<% if sections["attributes"] then %> +<% sections["attributes"].each do |attributes| %> + + "> +<% if attributes["rw"] then %> + <%= attributes["rw"] %> +<% end %> + <%= attributes["a_desc"] %> + + +<% end # sections["attributes"] %> +<% end %> + +<% if sections["method_list"] then %> +<% sections["method_list"].each do |method_list| %> +<% if method_list["methods"] then %> +<% method_list["methods"].each do |methods| %> + + " rd:visibility="<%= methods["type"] %>" + rd:category="<%= methods["category"] %>" rd:id="<%= methods["aref"] %>"> + <%= methods["params"] %> +<% if methods["m_desc"] then %> + +<%= methods["m_desc"] %> + +<% end %> +<% if methods["sourcecode"] then %> + +<%= methods["sourcecode"] %> + +<% end %> + + +<% end # method_list["methods"] %> +<% end %> +<% end # sections["method_list"] %> +<% end %> + +<% end # classes["sections"] %> +<% end %> + EOF + +######################################################################## + + ONE_PAGE = %{ + + + +<% values["files"].each do |files| %> + " rd:id="<%= files["href"] %>"> + <%= files["full_path"] %> + <%= files["dtm_modified"] %> +} + CONTENTS_RDF + %{ + +<% end # values["files"] %> +<% values["classes"].each do |classes| %> + <<%= values["classmod"] %> rd:name="<%= classes["full_name"] %>" rd:id="<%= classes["full_name"] %>"> + +<% if classes["infiles"] then %> + +<% classes["infiles"].each do |infiles| %> + + " +<% if infiles["full_path_url"] then %> + rdf:about="<%= infiles["full_path_url"] %>" +<% end %> + /> + +<% end # classes["infiles"] %> + +<% end %> +<% if classes["parent"] then %> + <%= href classes["par_url"], classes["parent"] %> +<% end %> + +} + CONTENTS_RDF + %{ + > +<% end # values["classes"] %> + + +} + +end + -- cgit v1.2.3