Sha256: 94469cc01564cf0bc9ef2b174cd9aca64bd66e5a5d0bb8d54cb00f915d4f228f
Contents?: true
Size: 441 Bytes
Versions: 19
Compression:
Stored size: 441 Bytes
Contents
# frozen_string_literal: true require "rfix/git_file" class Rfix::TrackedFile < Rfix::GitFile def refresh! @ranges = git("--no-pager", "diff", *params, "#{ref}..HEAD", 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
19 entries across 19 versions & 1 rubygems