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

Inherits:
Object
  • Object
show all
Includes:
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*)/.freeze
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}))? @@/.freeze

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)


74
75
76
77
78
# File 'lib/mutant/repository/diff.rb', line 74

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