git_diff_parser 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/git_diff_parser/patch.rb +2 -2
- data/lib/git_diff_parser/patches.rb +4 -4
- 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: 2dbd2e853cc2f2a086d9d7ca049d8d08a2c4ea20
|
4
|
+
data.tar.gz: 49457d76b8459a35bb7e4cd2a1ebf75c7a26648d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e2321ec9eaa16a52fd5f6c554177ed8cd1b3a49033a058c47c48cf4d3744d29cd30b130dc35cea2be204a43ab5e810e2b938f573d614940dcb711c738055d41
|
7
|
+
data.tar.gz: 3c4d956af424439d973aaed32f0884374a51bc05378d0d7015fa52c1db9dcd9d674cb7f4220b6116401288f230e41b1aa519320d4bc8c8e92353759f58e0c9fe
|
@@ -4,12 +4,12 @@ module GitDiffParser
|
|
4
4
|
MODIFIED_LINE = /^\+(?!\+|\+)/
|
5
5
|
NOT_REMOVED_LINE = /^[^-]/
|
6
6
|
|
7
|
-
attr_accessor :file, :body, :
|
7
|
+
attr_accessor :file, :body, :secure_hash
|
8
8
|
|
9
9
|
def initialize(body, options = {})
|
10
10
|
@body = body || ''
|
11
11
|
@file = options[:file] || options['file'] if options[:file] || options['file']
|
12
|
-
@
|
12
|
+
@secure_hash = options[:secure_hash] || options['secure_hash'] if options[:secure_hash] || options['secure_hash']
|
13
13
|
end
|
14
14
|
|
15
15
|
def changed_lines
|
@@ -13,16 +13,16 @@ module GitDiffParser
|
|
13
13
|
map(&:file)
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
map(&:
|
16
|
+
def secure_hashes
|
17
|
+
map(&:secure_hash)
|
18
18
|
end
|
19
19
|
|
20
20
|
def find_patch_by_file(file)
|
21
21
|
find { |patch| patch.file == file }
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
25
|
-
find { |patch| patch.
|
24
|
+
def find_patch_by_secure_hash(secure_hash)
|
25
|
+
find { |patch| patch.secure_hash == secure_hash }
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|