lib/contrast/agent/assess/policy/propagator/select.rb in contrast-agent-3.12.2 vs lib/contrast/agent/assess/policy/propagator/select.rb in contrast-agent-3.13.0
- old
+ new
@@ -48,23 +48,23 @@
def handle_integer args, arg, source
length = args[1] || 1
# (void) negative range
arg += source.length if arg.negative?
- Contrast::Agent::Assess::AdjustedSpan.new(arg, arg + length)
+ arg...(arg + length)
end
def handle_string arg, source
idx = source.index(arg)
- Contrast::Agent::Assess::AdjustedSpan.new(idx, idx + arg.length)
+ idx...(idx + arg.length)
end
def handle_regexp args, arg, source
match_data = arg.match(source)
# nil has the same meaning as 0. use full match
group = args[1] || 0
- Contrast::Agent::Assess::AdjustedSpan.new(match_data.begin(group), match_data.end(group))
+ match_data.begin(group)...match_data.end(group)
end
def handle_range arg, source
start = arg.begin
finish = arg.end
@@ -72,10 +72,10 @@
# (void) negative range
start += source.length if start.negative?
finish += source.length if finish.negative?
finish += 1 unless arg.exclude_end?
- Contrast::Agent::Assess::AdjustedSpan.new(start, finish)
+ start...finish
end
def determine_select_range source, args
arg = args[0]
case arg