Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated remote fetcher to use Gem.user_dir

git-svn-id: http://rubygems.rubyforge.org/svn/trunk@1838 3d4018f9-ac1a-0410-99e9-8a154d859a19
  • Loading branch information...
commit b730cdfd6638359359a5e4abf10199a83633c4da 1 parent 947f070
technomancy authored
4 lib/rubygems/commands/help_command.rb
@@ -20,9 +20,9 @@ class Gem::Commands::HelpCommand < Gem::Command
20 20 gem install --remote rake --test --rdoc --ri
21 21
22 22 * Install 'rake', but only version 0.3.1, even if dependencies
23   - are not met, and into a specific directory:
  23 + are not met, and into a user-specific directory:
24 24
25   - gem install rake --version 0.3.1 --force --install-dir $HOME/.gems
  25 + gem install rake --version 0.3.1 --force --user-install
26 26
27 27 * List local gems whose name begins with 'D':
28 28
2  lib/rubygems/remote_fetcher.rb
@@ -78,7 +78,7 @@ def download(spec, source_uri, install_dir = Gem.dir)
78 78 if File.writable?(install_dir)
79 79 cache_dir = File.join install_dir, 'cache'
80 80 else
81   - cache_dir = File.join(ENV['HOME'], '.gem', 'cache')
  81 + cache_dir = File.join(Gem.user_dir, 'cache')
82 82 end
83 83
84 84 gem_file_name = "#{spec.full_name}.gem"
5 test/test_gem_remote_fetcher.rb
@@ -275,8 +275,9 @@ def test_download_read_only
275 275
276 276 fetcher = util_fuck_with_fetcher File.read(@a1_gem)
277 277 fetcher.download(@a1, 'http://gems.example.com')
278   - assert File.exist?(File.join(@userhome, '.gem',
279   - 'cache', "#{@a1.full_name}.gem"))
  278 + assert File.exist?(File.join(@userhome, '.gem', Gem.ruby_engine,
  279 + Gem::ConfigMap[:ruby_version], 'cache',
  280 + "#{@a1.full_name}.gem"))
280 281 ensure
281 282 File.chmod 0755, File.join(@gemhome)
282 283 File.chmod 0755, File.join(@gemhome, 'cache')

0 comments on commit b730cdf

Please sign in to comment.
Something went wrong with that request. Please try again.