lib/contrast/agent/assess/policy/propagator/match_data.rb in contrast-agent-5.0.0 vs lib/contrast/agent/assess/policy/propagator/match_data.rb in contrast-agent-5.1.0
- old
+ new
@@ -9,9 +9,13 @@
# Propagation that results in all the tags of the source being
# applied to the target exactly as is. The target's preexisting tags
# are unaffected beyond any merging of overlapping tags.
class MatchData < Contrast::Agent::Assess::Policy::Propagator::Base
class << self
+ # This patch method is used to track through the MatchData#[] and
+ # MatchData#match methods, since the last was introduced after
+ # Ruby 3.1.0, but shares similar functionality, except it does not
+ # support ranges.
def square_bracket_tagger propagation_node, preshift, ret, _block
case ret
when Array
idx = 0
while idx < ret.length