summaryrefslogtreecommitdiff
path: root/lib/rubygems
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-17 23:59:31 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-17 23:59:31 +0000
commit215fbc639fc63d4300a91ae4c8e30865f6a03f3c (patch)
tree13f0bc33bcdd0dca931c0af17a6ac1b70dd282f8 /lib/rubygems
parent9d4f37f51fb2ffdef5e318afb3cb81516dcba4f7 (diff)
Fix RubyGems for 1.9, r1780
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems')
-rw-r--r--lib/rubygems/commands/install_command.rb6
-rw-r--r--lib/rubygems/commands/query_command.rb8
-rw-r--r--lib/rubygems/commands/sources_command.rb8
-rw-r--r--lib/rubygems/dependency_installer.rb2
-rw-r--r--lib/rubygems/rubygems_version.rb2
-rw-r--r--lib/rubygems/source_index.rb8
-rwxr-xr-xlib/rubygems/validator.rb6
7 files changed, 21 insertions, 19 deletions
diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb
index 48cd3869f95..dad19380ea4 100644
--- a/lib/rubygems/commands/install_command.rb
+++ b/lib/rubygems/commands/install_command.rb
@@ -50,7 +50,11 @@ class Gem::Commands::InstallCommand < Gem::Command
installed_gems = []
- ENV['GEM_PATH'] = options[:install_dir] # HACK what does this do?
+ if options[:install_dir].nil? and RUBY_VERSION > '1.9' then
+ ENV.delete 'GEM_PATH'
+ else
+ ENV['GEM_PATH'] = options[:install_dir] # HACK what does this do?
+ end
install_options = {
:env_shebang => options[:env_shebang],
diff --git a/lib/rubygems/commands/query_command.rb b/lib/rubygems/commands/query_command.rb
index cc81f3f07ed..f4d6120bcd0 100644
--- a/lib/rubygems/commands/query_command.rb
+++ b/lib/rubygems/commands/query_command.rb
@@ -131,18 +131,18 @@ class Gem::Commands::QueryCommand < Gem::Command
versions[spec_tuple.first] << [spec_tuple, source_uri]
end
- versions = versions.sort_by do |(name,),|
+ versions = versions.sort_by do |(name,_),_|
name.downcase
end
versions.each do |gem_name, matching_tuples|
- matching_tuples = matching_tuples.sort_by do |(name, version,),|
+ matching_tuples = matching_tuples.sort_by do |(name, version,_),_|
version
end.reverse
seen = {}
- matching_tuples.delete_if do |(name, version,),|
+ matching_tuples.delete_if do |(name, version,_),_|
if seen[version] then
true
else
@@ -154,7 +154,7 @@ class Gem::Commands::QueryCommand < Gem::Command
entry = gem_name.dup
if options[:versions] then
- versions = matching_tuples.map { |(name, version,),| version }.uniq
+ versions = matching_tuples.map { |(name, version,_),_| version }.uniq
entry << " (#{versions.join ', '})"
end
diff --git a/lib/rubygems/commands/sources_command.rb b/lib/rubygems/commands/sources_command.rb
index f45438463c6..9aabb77cb12 100644
--- a/lib/rubygems/commands/sources_command.rb
+++ b/lib/rubygems/commands/sources_command.rb
@@ -111,10 +111,10 @@ Will cause RubyGems to revert to legacy indexes, degrading performance.
fetcher = Gem::SpecFetcher.fetcher
if fetcher.legacy_repos.empty? then
- Gem.sources.each do |source_uri|
- source_uri = URI.parse source_uri
- fetcher.load_specs source_uri, 'specs'
- fetcher.load_specs source_uri, 'latest_specs'
+ Gem.sources.each do |update_uri|
+ update_uri = URI.parse update_uri
+ fetcher.load_specs update_uri, 'specs'
+ fetcher.load_specs update_uri, 'latest_specs'
end
else
Gem::SourceInfoCache.cache true
diff --git a/lib/rubygems/dependency_installer.rb b/lib/rubygems/dependency_installer.rb
index b849d37245f..8636599fbc2 100644
--- a/lib/rubygems/dependency_installer.rb
+++ b/lib/rubygems/dependency_installer.rb
@@ -133,7 +133,7 @@ class Gem::DependencyInstaller
deps.each do |dep|
results = find_gems_with_sources(dep).reverse
- results.reject! do |spec,|
+ results.reject! do
@source_index.any? do |_, installed_spec|
dep.name == installed_spec.name and
dep.version_requirements.satisfied_by? installed_spec.version
diff --git a/lib/rubygems/rubygems_version.rb b/lib/rubygems/rubygems_version.rb
index d4d4af05587..453f9b57b60 100644
--- a/lib/rubygems/rubygems_version.rb
+++ b/lib/rubygems/rubygems_version.rb
@@ -2,5 +2,5 @@
# This file is auto-generated by build scripts.
# See: rake update_version
module Gem
- RubyGemsVersion = '1.1.1.1778'
+ RubyGemsVersion = '1.1.1'
end
diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb
index b940b83cf87..1eefd8c1490 100644
--- a/lib/rubygems/source_index.rb
+++ b/lib/rubygems/source_index.rb
@@ -300,14 +300,12 @@ class Gem::SourceIndex
outdateds = []
latest_specs.each do |local|
- name = local.name
-
- dependency = Gem::Dependency.new name, ">= #{local.version}"
+ dependency = Gem::Dependency.new local.name, ">= #{local.version}"
begin
fetcher = Gem::SpecFetcher.fetcher
remotes = fetcher.find_matching dependency
- remotes = remotes.map { |(name, version,),| version }
+ remotes = remotes.map { |(name, version,_),_| version }
rescue Gem::RemoteFetcher::FetchError => e
raise unless fetcher.warn_legacy e do
require 'rubygems/source_info_cache'
@@ -320,7 +318,7 @@ class Gem::SourceIndex
latest = remotes.sort.last
- outdateds << name if latest and local.version < latest
+ outdateds << local.name if latest and local.version < latest
end
outdateds
diff --git a/lib/rubygems/validator.rb b/lib/rubygems/validator.rb
index 41c457c3cfc..8aaaa5a413a 100755
--- a/lib/rubygems/validator.rb
+++ b/lib/rubygems/validator.rb
@@ -42,7 +42,7 @@ module Gem
#
# gem_path:: [String] Path to gem file
def verify_gem_file(gem_path)
- File.open gem_path, 'rb' do |file|
+ open gem_path, Gem.binary_mode do |file|
gem_data = file.read
verify_gem gem_data
end
@@ -91,7 +91,7 @@ module Gem
begin
verify_gem_file(gem_path)
- File.open(gem_path, 'rb') do |file|
+ open gem_path, Gem.binary_mode do |file|
format = Gem::Format.from_file_by_path(gem_path)
format.file_entries.each do |entry, data|
# Found this file. Delete it from list
@@ -99,7 +99,7 @@ module Gem
next unless data # HACK `gem check -a mkrf`
- File.open(File.join(gem_directory, entry['path']), 'rb') do |f|
+ open File.join(gem_directory, entry['path']), Gem.binary_mode do |f|
unless Gem::MD5.hexdigest(f.read).to_s ==
Gem::MD5.hexdigest(data).to_s then
errors[gem_name] << ErrorData.new(entry['path'], "installed file doesn't match original from gem")