summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands')
-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
3 files changed, 13 insertions, 9 deletions
diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb
index 48cd3869f9..dad19380ea 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 cc81f3f07e..f4d6120bcd 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 f45438463c..9aabb77cb1 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