Permalink
Browse files

@gem_dir is gone, so add some workarounds

git-svn-id: http://rubygems.rubyforge.org/svn/trunk@2504 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information...
drbrain
drbrain committed Apr 22, 2010
1 parent 9e96330 commit 59b6127ddf3dc7ee07f2c8552afde8fcf1271406
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/rubygems/server.rb
View
@@ -432,6 +432,9 @@ def self.run(options)
options[:addresses]).run
end
+ ##
+ # Only the first directory in gem_dirs is used for serving gems
+
def initialize(gem_dirs, port, daemon, addresses = nil)
Socket.do_not_reverse_lookup = true
@@ -730,7 +733,7 @@ def rdoc(req, res)
# documentation - just put it underneath the main doc folder.
def show_rdoc_for_pattern(pattern, res)
- found_gems = Dir.glob("#{@gem_dir}/doc/#{pattern}").select {|path|
+ found_gems = Dir.glob("{#{@gem_dirs.join ','}}/doc/#{pattern}").select {|path|
File.exist? File.join(path, 'rdoc/index.html')
}
case found_gems.length
@@ -794,7 +797,7 @@ def run
paths = { "/gems" => "/cache/", "/doc_root" => "/doc/" }
paths.each do |mount_point, mount_dir|
@server.mount(mount_point, WEBrick::HTTPServlet::FileHandler,
- File.join(@gem_dir, mount_dir), true)
+ File.join(@gem_dir.first, mount_dir), true)
end
trap("INT") { @server.shutdown; exit! }

0 comments on commit 59b6127

Please sign in to comment.