summaryrefslogtreecommitdiff
path: root/lib/rubygems/server.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-10 17:51:40 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-10 17:51:40 +0000
commit4f6779bac7b4e294bc473782d60cbd071f0d0f8d (patch)
treed37b54da20f8c0adf2d98e810aacc8259b0602ff /lib/rubygems/server.rb
parent31d355aaa9436e2b24efd5e6501cabd876267c46 (diff)
downloadruby-4f6779bac7b4e294bc473782d60cbd071f0d0f8d.tar.gz
* lib/rubygems: Update to RubyGems master 4bdc4f2. Important changes
in this commit: RubyGems now chooses the test server port reliably. Patch by akr. Partial implementation of bundler's Gemfile format. Refactorings to improve the new resolver. Fixes bugs in the resolver. * test/rubygems: Tests for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/server.rb')
-rw-r--r--lib/rubygems/server.rb18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/rubygems/server.rb b/lib/rubygems/server.rb
index 3ca588ae92..ca6dc683f5 100644
--- a/lib/rubygems/server.rb
+++ b/lib/rubygems/server.rb
@@ -445,7 +445,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
@spec_dirs = @gem_dirs.map { |gem_dir| File.join gem_dir, 'specifications' }
@spec_dirs.reject! { |spec_dir| !File.directory? spec_dir }
- Gem::Specification.dirs = @gem_dirs
+ reset_gems
@have_rdoc_4_plus = nil
end
@@ -470,7 +470,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
end
def latest_specs(req, res)
- Gem::Specification.reset
+ reset_gems
res['content-type'] = 'application/x-gzip'
@@ -531,7 +531,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
end
def quick(req, res)
- Gem::Specification.reset
+ reset_gems
res['content-type'] = 'text/plain'
add_date res
@@ -567,7 +567,8 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
end
def root(req, res)
- Gem::Specification.reset
+ reset_gems
+
add_date res
raise WEBrick::HTTPStatus::NotFound, "`#{req.path}' not found." unless
@@ -698,6 +699,13 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
end
##
+ # Updates the server to use the latest installed gems.
+
+ def reset_gems # :nodoc:
+ Gem::Specification.dirs = @gem_dirs
+ end
+
+ ##
# Returns true and prepares http response, if rdoc for the requested gem
# name pattern was found.
#
@@ -787,7 +795,7 @@ div.method-source-code pre { color: #ffdead; overflow: hidden; }
end
def specs(req, res)
- Gem::Specification.reset
+ reset_gems
add_date res