Fix unmatches_path
This commit is contained in:
parent
1736a2dab6
commit
431d7972b6
1 changed files with 9 additions and 6 deletions
|
@ -208,15 +208,15 @@ module Ci
|
||||||
def matching?(patterns, ref, tag, source)
|
def matching?(patterns, ref, tag, source)
|
||||||
patterns.any? do |pattern|
|
patterns.any? do |pattern|
|
||||||
pattern, path = pattern.split('@', 2)
|
pattern, path = pattern.split('@', 2)
|
||||||
match_path?(path) && match_pattern?(pattern, ref, tag, source)
|
unmatches_path?(path) && matches_pattern?(pattern, ref, tag, source)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def match_path?(path)
|
def unmatches_path?(path)
|
||||||
return !(path && path != self.path)
|
path && path != self.path
|
||||||
end
|
end
|
||||||
|
|
||||||
def match_pattern?(pattern, ref, tag, source)
|
def matches_pattern?(pattern, ref, tag, source)
|
||||||
return true if tag && pattern == 'tags'
|
return true if tag && pattern == 'tags'
|
||||||
return true if !tag && pattern == 'branches'
|
return true if !tag && pattern == 'branches'
|
||||||
return true if source_to_pattern(source) == pattern
|
return true if source_to_pattern(source) == pattern
|
||||||
|
@ -229,8 +229,11 @@ module Ci
|
||||||
end
|
end
|
||||||
|
|
||||||
def source_to_pattern(source)
|
def source_to_pattern(source)
|
||||||
return source if %w(api external web).include?(source) || source.nil?
|
if %w(api external web).include?(source) || source.nil?
|
||||||
return source.pluralize
|
source
|
||||||
|
else
|
||||||
|
source.pluralize
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue