git_diff_parser 2.3.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -4
- data/Gemfile +2 -2
- data/changelog.md +8 -0
- data/lib/git_diff_parser/patches.rb +10 -1
- data/lib/git_diff_parser/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66baab1ba43527942ed9004cd7cd96f7dcf9b623
|
4
|
+
data.tar.gz: b9fa9ae68e2127893ad841e36878e638ede4ec69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68999876ead0318ec17f62ed25fa360a3f515da7c89f754758cee546c9ccf5d2ee318a255ae1a9eafb391e33624078b64fc28eeb06d91c12c1c13b3b6db09a73
|
7
|
+
data.tar.gz: 65a699e04f34385ee211e11864a3f296d0d313a2c50e0242fdb117c93414b563f73048899b9468c0b2275bedd3791e6d8edc8bf92bb317fb6529515912c4f0fe
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/changelog.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
<a name="3.0.0"></a>
|
2
|
+
# [3.0.0](https://github.com/packsaddle/ruby-git_diff_parser/compare/v2.3.0...v3.0.0) (2017-06-22)
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* **patches:** convert non UTF-8 string to avoid invalid UTF-8 sequence errors ([a8f87bd](https://github.com/packsaddle/ruby-git_diff_parser/commit/a8f87bd))
|
7
|
+
|
8
|
+
|
1
9
|
<a name="2.3.0"></a>
|
2
10
|
# [2.3.0](https://github.com/packsaddle/ruby-git_diff_parser/compare/v2.2.0...v2.3.0) (2016-05-12)
|
3
11
|
|
@@ -18,7 +18,7 @@ module GitDiffParser
|
|
18
18
|
line_count = lines.count
|
19
19
|
parsed = new
|
20
20
|
lines.each_with_index do |line, count|
|
21
|
-
case line.chomp
|
21
|
+
case parsed.scrub_string(line.chomp)
|
22
22
|
when /^diff/
|
23
23
|
unless patch.empty?
|
24
24
|
parsed << Patch.new(patch.join("\n") + "\n", file: file_name)
|
@@ -42,6 +42,15 @@ module GitDiffParser
|
|
42
42
|
parsed
|
43
43
|
end
|
44
44
|
|
45
|
+
# @return [String]
|
46
|
+
def scrub_string(line)
|
47
|
+
if RUBY_VERSION >= '2.1'
|
48
|
+
line.scrub
|
49
|
+
else
|
50
|
+
line.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
45
54
|
# @return [Patches<Patch>]
|
46
55
|
def initialize(*args)
|
47
56
|
super Array.new(*args)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_diff_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sanemat
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.6.11
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: Parse `git diff` into patches and lines.
|