diff options
author | Olle Jonsson <olle.jonsson@auctionet.com> | 2020-04-19 18:06:02 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-06-05 07:32:42 +0900 |
commit | f61ee674d8c5871e8e81b1a7f5884635a0ee9803 (patch) | |
tree | aa956731f75c20eaa39b7366d0428155df685a77 /lib/rubygems/specification.rb | |
parent | dd5b918cbead5fdb641118aa4e4d90e013f90df1 (diff) |
[rubygems/rubygems] Prefer start_with? and end_with? over regex.
- In one of the cases, filenames were checked for ending with "gz" -
this is changed to check for ending with ".gz"
- The change was made to make it even easier to read the code, and to
match only from the start of the input (as opposed to start of the
line)
https://github.com/rubygems/rubygems/commit/aac4290271
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3184
Diffstat (limited to 'lib/rubygems/specification.rb')
-rw-r--r-- | lib/rubygems/specification.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |