aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/remote_fetcher.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-06 05:13:08 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-06 05:13:08 +0000
commitafae107a4c969845c58985159a0ce51f80e920ca (patch)
treec09681f9e9d9fcb1ef014d6783b2ac41a034a86e /lib/rubygems/remote_fetcher.rb
parent5ffc1a3aaa5f63465fb210d08070e380c67916dc (diff)
downloadruby-afae107a4c969845c58985159a0ce51f80e920ca.tar.gz
* lib/rubygems/package.rb: Set rubygems_version before validation.
Fixes issue with bundler. * test/rubygems/test_gem_package.rb: Test for above. * lib/rubygems/remote_fetcher.rb: Only update the cache when we have permission. [ruby-trunk - Bug #7509] * lib/rubygems/source.rb (class Gem): ditto * test/rubygems/test_gem_remote_fetcher.rb: Test for above. * lib/rubygems/test_utilities.rb: ditto * lib/rubygems/specification.rb: Derive base_dir properly for default gems. [ruby-trunk - Bug #7496] * test/rubygems/test_gem_specification.rb: Test for above. * lib/rubygems.rb: Untaint Dir.pwd when searching for gemdeps files for operation under $SAFE=1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/remote_fetcher.rb')
-rw-r--r--lib/rubygems/remote_fetcher.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb
index 4bb2e3604f..cc3d3cf860 100644
--- a/lib/rubygems/remote_fetcher.rb
+++ b/lib/rubygems/remote_fetcher.rb
@@ -294,7 +294,7 @@ class Gem::RemoteFetcher
# Downloads +uri+ to +path+ if necessary. If no path is given, it just
# passes the data.
- def cache_update_path(uri, path = nil)
+ def cache_update_path uri, path = nil, update = true
mtime = path && File.stat(path).mtime rescue nil
if mtime && Net::HTTPNotModified === fetch_path(uri, mtime, true)
@@ -302,7 +302,7 @@ class Gem::RemoteFetcher
else
data = fetch_path(uri)
- if path
+ if update and path then
open(path, 'wb') do |io|
io.write data
end