lib/proxes/helpers/indices.rb in proxes-0.4.0 vs lib/proxes/helpers/indices.rb in proxes-0.4.1

- old
+ new

@@ -1,14 +1,15 @@ # frozen_string_literal: true + module ProxES module Helpers module Indices def filter(asked, against) - return against.map { |a| a.gsub(%r{\.\*}, '*') } if asked == ['*'] || asked == [] + return against.map { |a| a.gsub(/\.\*/, '*') } if asked == ['*'] || asked == [] answer = [] against.each do |pattern| - answer.concat asked.select { |idx| idx =~ %r{#{pattern}} } + answer.concat(asked.select { |idx| idx =~ /#{pattern}/ }) end answer end end end