# Gem\_server won't deliver css from alternate template

**URL:** <https://www.ruby-forum.com/t/gem-server-wont-deliver-css-from-alternate-template/113574>\
**Category:** Ruby\
**Created:** [September 2, 2007, 3:24am UTC](https://www.ruby-forum.com/t/gem-server-wont-deliver-css-from-alternate-template/113574 "2007-09-02T03:24:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stepheneb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@stepheneb](https://www.ruby-forum.com/u/stepheneb)\
**Post date:** [September 2, 2007, 3:24am UTC](https://www.ruby-forum.com/t/gem-server-wont-deliver-css-from-alternate-template/113574/1 "2007-09-02T03:24:11Z")

</div>

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

[Buckblog: 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 @@

 RubyGems Documentation Index - + 
@@ -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/projects/rubygems/)

[http://rubyforge.org/tracker/index.php?func=detail&aid=13589&group\_id=126&atid=577](http://rubyforge.org/tracker/index.php?func=detail&aid=13589&group_id=126&atid=577)
