gem_server won't deliver css from alternate template

  • Thread starter Stephen Bannasch
  • Start date
S

Stephen Bannasch

I like the way rdoc html looks better when using Jamis Buck's rdoc template:

http://weblog.jamisbuck.org/2005/4/8/rdoc-template

So I put a copy here:

/usr/local/lib/ruby/1.8/rdoc/generators/template/html/jamis.rb

and with a little help I can get rails to use it when making
documentation for my apps, itself, and the plugins I use.

I wanted to use it with the rdoc for my gems so I added a ~/.gemrc
file to my home directory with this in it:

rdoc: --template jamis --inline-source --line-numbers

Now when gem builds the rodc these options are used ...

BUT ...

gem_server doesn't actually serve the rdoc-style.css files that rdoc
creates -- instead it appears to delivers a copy of the standard rdoc
1.0.1 template that is hard-coded into gem_server.rb.

line 398 (rubygems/sever.rb):

s.mount_proc("/rdoc-style.css") do |req, res|
res['content-type'] = 'text/css'
res['date'] = File.stat(spec_dir).mtime
res.body << RDOC_CSS
end

rdoc appears to put a copy of rdoc-style.css in the root of every
html output folder it creates. However gem_server always uses it's
own css.

Ths fixes the problem by only using the hard-coded stylesheet for the
top level document.

--- rubygems/old_server.rb 2007-02-10 09:07:01.000000000 -0500
+++ rubygems/server.rb 2007-09-01 20:34:12.000000000 -0400
@@ -33,7 +33,7 @@
<head>
<title>RubyGems Documentation Index</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <link rel="stylesheet" href="rdoc-style.css" type="text/css"
media="screen" />
+ <link rel="stylesheet" href="gem-server-rdoc-style.css"
type="text/css" media="screen" />
</head>
<body>
<div id="fileHeader">
@@ -395,7 +395,7 @@
res.body << Gem::SourceIndex.from_gems_in(spec_dir).to_yaml
end

- s.mount_proc("/rdoc-style.css") do |req, res|
+ s.mount_proc("/gem-server-rdoc-style.css") do |req, res|
res['content-type'] = 'text/css'
res['date'] = File.stat(spec_dir).mtime
res.body << RDOC_CSS

Patch also sent to http://rubyforge.org/projects/rubygems/

http://rubyforge.org/tracker/index.php?func=detail&aid=13589&group_id=126&atid=577
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top