aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/local_remote_options.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-09 21:38:59 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-09 21:38:59 +0000
commit31c94ffeb5f09d09ac2c86fc9e6614e38251a43d (patch)
tree10e44506238c7af3d7c9d822111996731726e38d /lib/rubygems/local_remote_options.rb
parenta6afbaeb3be396c0fdea3b9077d9256c59edcfca (diff)
downloadruby-31c94ffeb5f09d09ac2c86fc9e6614e38251a43d.tar.gz
Update to RubyGems 1.3.4 r2223
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/local_remote_options.rb')
-rw-r--r--lib/rubygems/local_remote_options.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/rubygems/local_remote_options.rb b/lib/rubygems/local_remote_options.rb
index 730cb69b83..e238c7292c 100644
--- a/lib/rubygems/local_remote_options.rb
+++ b/lib/rubygems/local_remote_options.rb
@@ -23,7 +23,9 @@ module Gem::LocalRemoteOptions
raise OptionParser::InvalidArgument, value
end
- raise OptionParser::InvalidArgument, value unless uri.scheme == 'http'
+ unless ['http', 'https', 'file'].include?(uri.scheme)
+ raise OptionParser::InvalidArgument, value
+ end
value
end
@@ -90,7 +92,7 @@ module Gem::LocalRemoteOptions
source << '/' if source !~ /\/\z/
if options[:added_source] then
- Gem.sources << source
+ Gem.sources << source unless Gem.sources.include?(source)
else
options[:added_source] = true
Gem.sources.replace [source]
@@ -99,10 +101,9 @@ module Gem::LocalRemoteOptions
end
##
- # Add the --update-source option
+ # Add the --update-sources option
def add_update_sources_option
-
add_option(:"Local/Remote", '-u', '--[no-]update-sources',
'Update local source cache') do |value, options|
Gem.configuration.update_sources = value