diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-05-09 14:43:47 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-05-09 14:43:47 -0700 |
commit | 164fb18d99461d20f07ab885d9317a9bdbd12a44 (patch) | |
tree | 6bc382c5249408914f6e0bc93ad443203aa42ed0 | |
parent | 1686ce2314f9b4be1587b648b960ef222375eb37 (diff) | |
parent | 125b44e7601b70774645064ad324d373a79e4dde (diff) | |
download | chef-164fb18d99461d20f07ab885d9317a9bdbd12a44.tar.gz |
Merge pull request #4912 from chef/lcg/fix-yum-provider
the =~ in ruby is awful
-rw-r--r-- | lib/chef/provider/package/yum.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/provider/package/yum.rb b/lib/chef/provider/package/yum.rb index dfd32fde55..64f1b2043c 100644 --- a/lib/chef/provider/package/yum.rb +++ b/lib/chef/provider/package/yum.rb @@ -46,7 +46,7 @@ class Chef lead = 0 tail = evr.size - if evr =~ %r{^([\d]+):} + if %r{^([\d]+):}.match(evr) # rubocop:disable Performance/RedundantMatch epoch = $1.to_i lead = $1.length + 1 elsif evr[0].ord == ":".ord @@ -54,7 +54,7 @@ class Chef lead = 1 end - if evr =~ %r{:?.*-(.*)$} + if %r{:?.*-(.*)$}.match(evr) # rubocop:disable Performance/RedundantMatch release = $1 tail = evr.length - release.length - lead - 1 @@ -443,7 +443,7 @@ class Chef # "mtr >= 2:0.71-3.0" # "mta" def self.parse(string) - if string =~ %r{^(\S+)\s+(>|>=|=|==|<=|<)\s+(\S+)$} + if %r{^(\S+)\s+(>|>=|=|==|<=|<)\s+(\S+)$}.match(string) # rubocop:disable Performance/RedundantMatch name = $1 if $2 == "=" flag = :== |