diff options
-rw-r--r-- | lib/rubygems/command.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/remote_fetcher.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/test_utilities.rb | 4 |
4 files changed, 7 insertions, 5 deletions
diff --git a/lib/rubygems/command.rb b/lib/rubygems/command.rb index 2fb3dab2fe..088f4add99 100644 --- a/lib/rubygems/command.rb +++ b/lib/rubygems/command.rb @@ -456,7 +456,9 @@ class Gem::Command until extra.empty? do ex = [] ex << extra.shift - ex << extra.shift if extra.first.to_s =~ /^[^-]/ + if (!extra.first.to_s.empty? && !extra.first.to_s.start_with?("-")) + ex << extra.shift + end result << ex if handles?(ex) end diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb index e260926da8..da88ec4509 100644 --- a/lib/rubygems/remote_fetcher.rb +++ b/lib/rubygems/remote_fetcher.rb @@ -252,7 +252,7 @@ class Gem::RemoteFetcher data = send "fetch_#{uri.scheme}", uri, mtime, head - if data and !head and uri.to_s =~ /\.gz$/ + if data and !head and uri.to_s.end_with?(".gz") begin data = Gem::Util.gunzip data rescue Zlib::GzipFile::Error diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index ba90974657..1d698074b9 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -2104,7 +2104,7 @@ class Gem::Specification < Gem::BasicSpecification end if @specification_version > CURRENT_SPECIFICATION_VERSION and - sym.to_s =~ /=$/ + sym.to_s.end_with?("=") warn "ignoring #{sym} loading #{full_name}" if $DEBUG else super diff --git a/lib/rubygems/test_utilities.rb b/lib/rubygems/test_utilities.rb index 0edf3d6a61..0ad167b19a 100644 --- a/lib/rubygems/test_utilities.rb +++ b/lib/rubygems/test_utilities.rb @@ -49,7 +49,7 @@ class Gem::FakeFetcher path = path.to_s @paths << path - raise ArgumentError, 'need full URI' unless path =~ %r{^https?://} + raise ArgumentError, 'need full URI' unless path.start_with?("https://", "http://") unless @data.key? path raise Gem::RemoteFetcher::FetchError.new("no data for #{path}", path) @@ -67,7 +67,7 @@ class Gem::FakeFetcher if data.respond_to?(:call) data.call else - if path.to_s =~ /gz$/ and not data.nil? and not data.empty? + if path.to_s.end_with?(".gz") and not data.nil? and not data.empty? data = Gem::Util.gunzip data end data |