Class: AwsRotate::Keys
Instance Method Summary collapse
Methods inherited from Base
Methods included from AwsServices
Constructor Details
This class inherits a constructor from AwsRotate::Base
Instance Method Details
#filter_match?(profile) ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/aws_rotate/keys.rb', line 13 def filter_match?(profile) return true if @options[:select].nil? && @options[:reject].nil? unless @options[:reject].nil? reject_list = @options[:reject] reject_list.map! { |f| Regexp.new(f) } rejected = !!reject_list.detect do |regexp| profile =~ regexp end return false if rejected end return true if @options[:select].nil? select_list = @options[:select] select_list.map! { |f| Regexp.new(f) } selected = !!select_list.detect do |regexp| profile =~ regexp end selected end |