From f343f248e5f529fbf99fbaa709c5e6899c88d0c9 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Mon, 7 Jul 2025 12:22:09 +0200 Subject: [PATCH] Fix new `Lint/AmbiguousRange` Offenses No functional change is intended, as these adjustments are semantically equivalent in this context. - Manually replaced ambiguous inclusive ranges (`..`) with exclusive ranges (`...`) for improved code clarity - Applied RuboCop's automatic correction to refactor ranges with expressions like `[(start + 1)..end]` --- lib/sharepoint/client.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sharepoint/client.rb b/lib/sharepoint/client.rb index 312caa3..cd84eba 100644 --- a/lib/sharepoint/client.rb +++ b/lib/sharepoint/client.rb @@ -629,8 +629,8 @@ def odata_escape_single_quote(s) def split_path(file_path) last_slash_pos = file_path.rindex('/') { - path: file_path[0..last_slash_pos - 1], - name: file_path[last_slash_pos + 1..] + path: file_path[0...last_slash_pos], + name: file_path[(last_slash_pos + 1)..] } end @@ -740,7 +740,7 @@ def sanitize_filename(filename) else extension_length = sanitized_filename.length - dot_index upper_bound = 127 - extension_length - sanitized_filename = sanitized_filename[0..upper_bound] + sanitized_filename[dot_index..sanitized_filename.length - 1] + sanitized_filename = sanitized_filename[0..upper_bound] + sanitized_filename[dot_index...sanitized_filename.length] end end odata_escape_single_quote(sanitized_filename)