Module: Mutant::Repository::Diff::Ranges Private

Defined in:
lib/mutant/repository/diff/ranges.rb

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

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}))? @@/

Class Method Summary collapse

Class Method Details

.parse(diff) ⇒ Set<Range<Integer>>

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.

Parse a unified diff into ranges

Parameters:

  • (String)

Returns:



17
18
19
# File 'lib/mutant/repository/diff/ranges.rb', line 17

def self.parse(diff)
  diff.lines.flat_map(&method(:parse_ranges)).to_set
end