git_diff_parser 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/git_diff_parser/patch.rb +6 -0
- data/lib/git_diff_parser/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3664102e3ee20668e7ca33c4de9afea827567a4d
|
4
|
+
data.tar.gz: 9c9c3cddd1213d2ca06d170ac80fd33fcc764a03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12336509fd73f6d3b90153f5a24b529fa3d7227ad3649c7edda01cdf525f1d15290fda51ce52e5d63e55d7f19a1287074fa92266d4ced0bd7053e6c0cc2e4f1b
|
7
|
+
data.tar.gz: 1ee942cf61121e54bc7a678d51e22bb317bad483e95f57c6a7d6766d6a9726baf29db023b37ea259343962f3e80424eb90b1678f24a37d18e43458de9d1854d5
|
@@ -39,6 +39,12 @@ module GitDiffParser
|
|
39
39
|
changed_lines.map(&:number)
|
40
40
|
end
|
41
41
|
|
42
|
+
def find_patch_position_by_line_number(line_number)
|
43
|
+
target = changed_lines.find { |line| line.number == line_number }
|
44
|
+
return nil unless target
|
45
|
+
target.patch_position
|
46
|
+
end
|
47
|
+
|
42
48
|
private
|
43
49
|
|
44
50
|
def lines
|