Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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
View
@@ -20,9 +20,9 @@ class Gem::Commands::HelpCommand < Gem::Command
gem install --remote rake --test --rdoc --ri
* Install 'rake', but only version 0.3.1, even if dependencies
- are not met, and into a specific directory:
+ are not met, and into a user-specific directory:
- gem install rake --version 0.3.1 --force --install-dir $HOME/.gems
+ gem install rake --version 0.3.1 --force --user-install
* List local gems whose name begins with 'D':
2  lib/rubygems/remote_fetcher.rb
View
@@ -78,7 +78,7 @@ def download(spec, source_uri, install_dir = Gem.dir)
if File.writable?(install_dir)
cache_dir = File.join install_dir, 'cache'
else
- cache_dir = File.join(ENV['HOME'], '.gem', 'cache')
+ cache_dir = File.join(Gem.user_dir, 'cache')
end
gem_file_name = "#{spec.full_name}.gem"
5 test/test_gem_remote_fetcher.rb
View
@@ -275,8 +275,9 @@ def test_download_read_only
fetcher = util_fuck_with_fetcher File.read(@a1_gem)
fetcher.download(@a1, 'http://gems.example.com')
- assert File.exist?(File.join(@userhome, '.gem',
- 'cache', "#{@a1.full_name}.gem"))
+ assert File.exist?(File.join(@userhome, '.gem', Gem.ruby_engine,
+ Gem::ConfigMap[:ruby_version], 'cache',
+ "#{@a1.full_name}.gem"))
ensure
File.chmod 0755, File.join(@gemhome)
File.chmod 0755, File.join(@gemhome, 'cache')
Please sign in to comment.
Something went wrong with that request. Please try again.