Sha256: 78f248f7efa8dd18d650816e18660d5b829d4a59ac9a0e0049cb40920154b229
Contents?: true
Size: 430 Bytes
Versions: 18
Compression:
Stored size: 430 Bytes
Contents
# frozen_string_literal: true require "rfix/git_file" class Rfix::TrackedFile < Rfix::GitFile def refresh! @ranges = git("--no-pager", "diff", *params, ref, path) .grep(/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/) do Regexp.last_match(1).to_i...(Regexp.last_match(1).to_i + (Regexp.last_match(2) || 1).to_i) end end def include?(line) @ranges.any? { |range| range.include?(line) } end end
Version data entries
18 entries across 18 versions & 1 rubygems