git_diff_parser 2.3.0 → 3.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2645c17bdb3a03e0e5e682b09bec26ec55e4c7f
4
- data.tar.gz: db74ad832ed897a054f903325b1371ca2855c651
3
+ metadata.gz: 66baab1ba43527942ed9004cd7cd96f7dcf9b623
4
+ data.tar.gz: b9fa9ae68e2127893ad841e36878e638ede4ec69
5
5
  SHA512:
6
- metadata.gz: 2da9a469671eff3420da2e260d4310d6be027e1404f0d2f823208b5eb182b2d0a129483533becaff71e88928d4f41b6849da77adea9d46e780f5cd069a0c38db
7
- data.tar.gz: e21000998d0d4a425c3da28ddeaa166c8ec57752578e5eed797182068250d0563841fba289061735a01dddb6b79da1e8a2ef5e1bfe020bc2746b634bbf8317e5
6
+ metadata.gz: 68999876ead0318ec17f62ed25fa360a3f515da7c89f754758cee546c9ccf5d2ee318a255ae1a9eafb391e33624078b64fc28eeb06d91c12c1c13b3b6db09a73
7
+ data.tar.gz: 65a699e04f34385ee211e11864a3f296d0d313a2c50e0242fdb117c93414b563f73048899b9468c0b2275bedd3791e6d8edc8bf92bb317fb6529515912c4f0fe
@@ -1,11 +1,12 @@
1
1
  language: "ruby"
2
2
  sudo: false
3
3
  rvm:
4
- - "1.9"
5
- - "2.0"
4
+ - "1.9.3"
5
+ - "2.0.0"
6
6
  - "2.1.10"
7
- - "2.2.5"
8
- - "2.3.1"
7
+ - "2.2.6"
8
+ - "2.3.3"
9
+ - "2.4.0"
9
10
  - "ruby-head"
10
11
  matrix:
11
12
  allow_failures:
data/Gemfile CHANGED
@@ -4,6 +4,6 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
  gem 'byebug' if RUBY_VERSION >= '2.0.0'
6
6
  gem 'pry'
7
- gem 'rubocop'
7
+ gem 'rubocop' if RUBY_VERSION >= '2.0.0'
8
8
  gem 'yard'
9
- gem 'parse_gemspec-cli'
9
+ gem 'parse_gemspec-cli' if RUBY_VERSION >= '2.0.0'
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module GitDiffParser
2
- VERSION = '2.3.0'.freeze
2
+ VERSION = '3.0.0'.freeze
3
3
  end
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: 2.3.0
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: 2016-05-12 00:00:00.000000000 Z
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.5.1
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.