Sha256: 3f3c65e559b026e948dfb286dfa9c03bd7dee724d3b402d3a033724d0d70f374
Contents?: true
Size: 483 Bytes
Versions: 36
Compression:
Stored size: 483 Bytes
Contents
module Merit class RulesMatcher def initialize(path, action_name) @path = path @action_name = action_name end def select_from(rules) rules.select do |glob, _| entire_path =~ /^#{Regexp.new(glob)}$/ end.values.flatten end def any_matching? select_from(AppBadgeRules).any? || select_from(AppPointRules).any? end private def entire_path @entire_path ||= [@path, @action_name].join('#') end end end
Version data entries
36 entries across 36 versions & 2 rubygems