diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-07 01:19:28 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-07 01:19:28 +0000 |
commit | d5e810dbd24cb92dc86d2d5b048f239315b15ba8 (patch) | |
tree | 0656ac1f6abe26dd1f1349f25ece23a534b1a0dc /lib/rubygems/commands | |
parent | 738b8872ef871cbfd78730142049cd1fe94a95fa (diff) | |
download | ruby-d5e810dbd24cb92dc86d2d5b048f239315b15ba8.tar.gz |
* ChangeLog:
* lib/rubygems/basic_specification.rb (class Gem):
* lib/rubygems/commands/contents_command.rb (prefix or only the files that are requir):
* lib/rubygems/commands/install_command.rb (to write the specification by hand):
* lib/rubygems/commands/setup_command.rb (class Gem):
* lib/rubygems/commands/setup_command.rb (TEXT):
* lib/rubygems/compatibility.rb (module Gem):
* lib/rubygems/defaults.rb (module Gem):
* lib/rubygems/deprecate.rb (module Gem):
* lib/rubygems/installer.rb (class Gem):
* lib/rubygems/platform.rb (class Gem):
* lib/rubygems/rdoc.rb (class Gem):
* lib/rubygems/request_set/lockfile.rb (class Gem):
* lib/rubygems/resolver/installer_set.rb (class Gem):
* lib/rubygems/resolver.rb (class Gem):
* lib/rubygems/specification.rb (class Gem):
* lib/rubygems/test_case.rb (class Gem):
* lib/rubygems/test_case.rb (Also):
* lib/rubygems/uninstaller.rb (class Gem):
* lib/rubygems.rb (module Gem):
* test/rubygems/test_gem.rb (class TestGem):
* test/rubygems/test_gem_commands_contents_command.rb (lib):
* test/rubygems/test_gem_commands_environment_command.rb (class TestGemCommandsEnvironmentCommand):
* test/rubygems/test_gem_commands_install_command.rb (ERROR):
* test/rubygems/test_gem_commands_update_command.rb (class TestGemCommandsUpdateCommand):
* test/rubygems/test_gem_dependency_installer.rb (class TestGemDependencyInstaller):
* test/rubygems/test_gem_installer.rb (load Gem):
* test/rubygems/test_gem_installer.rb (gem):
* test/rubygems/test_gem_request_set_lockfile.rb (GEM):
* test/rubygems/test_gem_request_set_lockfile.rb (DEPENDENCIES):
* test/rubygems/test_gem_specification.rb (dependencies):
* test/rubygems/test_gem_specification.rb (duplicate dependency on b):
* test/rubygems/test_gem_uninstaller.rb (class TestGemUninstaller):
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r-- | lib/rubygems/commands/contents_command.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/commands/install_command.rb | 20 | ||||
-rw-r--r-- | lib/rubygems/commands/setup_command.rb | 16 |
3 files changed, 23 insertions, 19 deletions
diff --git a/lib/rubygems/commands/contents_command.rb b/lib/rubygems/commands/contents_command.rb index 97218848ed..603f1d072a 100644 --- a/lib/rubygems/commands/contents_command.rb +++ b/lib/rubygems/commands/contents_command.rb @@ -94,11 +94,11 @@ prefix or only the files that are requireable. spec.files.sort.map do |file| case file when /\A#{spec.bindir}\// - [Gem::ConfigMap[:bindir], $POSTMATCH] + [RbConfig::CONFIG['bindir'], $POSTMATCH] when /\.so\z/ - [Gem::ConfigMap[:archdir], file] + [RbConfig::CONFIG['archdir'], file] else - [Gem::ConfigMap[:rubylibdir], file] + [RbConfig::CONFIG['rubylibdir'], file] end end end diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb index 4485eb12e8..8219eef6ea 100644 --- a/lib/rubygems/commands/install_command.rb +++ b/lib/rubygems/commands/install_command.rb @@ -228,7 +228,18 @@ to write the specification by hand. For example: def install_gem_without_dependencies name, req # :nodoc: gem = nil - if remote? then + if local? then + if name =~ /\.gem$/ and File.file? name then + source = Gem::Source::SpecificFile.new name + spec = source.spec + else + source = Gem::Source::Local.new + spec = source.find_gem name, req + end + gem = source.download spec if spec + end + + if remote? and not gem then dependency = Gem::Dependency.new name, req dependency.prerelease = options[:prerelease] @@ -236,13 +247,6 @@ to write the specification by hand. For example: gem = fetcher.download_to_cache dependency end - if local? and not gem then - source = Gem::Source::Local.new - spec = source.find_gem name, req - - gem = source.download spec - end - inst = Gem::Installer.new gem, options inst.install diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index face77fae9..681db0dc1d 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -13,7 +13,7 @@ class Gem::Commands::SetupCommand < Gem::Command super 'setup', 'Install RubyGems', :format_executable => true, :document => %w[ri], - :site_or_vendor => :sitelibdir, + :site_or_vendor => 'sitelibdir', :destdir => '', :prefix => '', :previous_version => '' add_option '--previous-version=VERSION', @@ -36,7 +36,7 @@ class Gem::Commands::SetupCommand < Gem::Command add_option '--[no-]vendor', 'Install into vendorlibdir not sitelibdir' do |vendor, options| - options[:site_or_vendor] = vendor ? :vendorlibdir : :sitelibdir + options[:site_or_vendor] = vendor ? 'vendorlibdir' : 'sitelibdir' end add_option '--[no-]format-executable', @@ -343,19 +343,19 @@ TEXT site_or_vendor = options[:site_or_vendor] if prefix.empty? then - lib_dir = Gem::ConfigMap[site_or_vendor] - bin_dir = Gem::ConfigMap[:bindir] + lib_dir = RbConfig::CONFIG[site_or_vendor] + bin_dir = RbConfig::CONFIG['bindir'] else # Apple installed RubyGems into libdir, and RubyGems <= 1.1.0 gets # confused about installation location, so switch back to # sitelibdir/vendorlibdir. if defined?(APPLE_GEM_HOME) and # just in case Apple and RubyGems don't get this patched up proper. - (prefix == Gem::ConfigMap[:libdir] or + (prefix == RbConfig::CONFIG['libdir'] or # this one is important - prefix == File.join(Gem::ConfigMap[:libdir], 'ruby')) then - lib_dir = Gem::ConfigMap[site_or_vendor] - bin_dir = Gem::ConfigMap[:bindir] + prefix == File.join(RbConfig::CONFIG['libdir'], 'ruby')) then + lib_dir = RbConfig::CONFIG[site_or_vendor] + bin_dir = RbConfig::CONFIG['bindir'] else lib_dir = File.join prefix, 'lib' bin_dir = File.join prefix, 'bin' |