lib/sub_diff/gsub.rb in sub_diff-1.0.6 vs lib/sub_diff/gsub.rb in sub_diff-1.0.7
- old
+ new
@@ -14,11 +14,13 @@
def prefix(_diff)
super.sub(last_prefix, '')
end
def suffix(_diff, search)
+ suffix = super
matcher = suffix_matcher(search)
- super unless super.send(matcher, search)
+ skip_suffix = suffix.send(matcher, search)
+ suffix unless skip_suffix
end
def suffix_matcher(search)
search.is_a?(Regexp) ? :match : :include?
end