class PathList::Matchers::AllowPathRegexp
Attributes
dir_only[R]
dir_only?[R]
rule[R]
squash_id[R]
Public Class Methods
new(rule, anchored, dir_only)
click to toggle source
# File lib/path_list/matchers/allow_path_regexp.rb, line 13 def initialize(rule, anchored, dir_only) @rule = rule @dir_only = dir_only @anchored = anchored @squash_id = anchored ? :allow : object_id freeze end
Public Instance Methods
file_only?()
click to toggle source
# File lib/path_list/matchers/allow_path_regexp.rb, line 26 def file_only? false end
inspect()
click to toggle source
:nocov:
# File lib/path_list/matchers/allow_path_regexp.rb, line 35 def inspect "#<AllowPathRegexp #{'dir_only ' if @dir_only}#{@rule.inspect}>" end
match?(candidate)
click to toggle source
:nocov:
# File lib/path_list/matchers/allow_path_regexp.rb, line 40 def match?(candidate) :allow if @rule.match?(candidate.relative_path) end
shebang?()
click to toggle source
# File lib/path_list/matchers/allow_path_regexp.rb, line 30 def shebang? false end
squash(list)
click to toggle source
# File lib/path_list/matchers/allow_path_regexp.rb, line 22 def squash(list) self.class.new(::Regexp.union(list.map(&:rule)), @anchored, @dir_only) end