Class: Mutant::Repository::Diff::Path Private

Inherits:
Object
  • Object
show all
Includes:
Unparser::Adamantium
Defined in:
lib/mutant/repository/diff.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Path touched by a diff

Constant Summary collapse

DECIMAL =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/(?:0|[1-9]\d*)/
REGEXP =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/\A@@ -(#{DECIMAL})(?:,(#{DECIMAL}))? \+(#{DECIMAL})(?:,(#{DECIMAL}))? @@/

Instance Method Summary collapse

Instance Method Details

#touches?(line_range) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Test if diff path touches a line range

Parameters:

Returns:

  • (Boolean)


97
98
99
100
101
# File 'lib/mutant/repository/diff.rb', line 97

def touches?(line_range)
  diff_ranges.any? do |range|
    Range.overlap?(range, line_range)
  end
end