git-commit-notifier 0.12.5 → 0.12.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f83e882803b817c7a4f11b44a75a2fd61a98212
4
- data.tar.gz: 73ea6dd2b99d5da0e40ff60457496ea1dc1c2417
3
+ metadata.gz: 5264a69f6678981a62e65cbcac4455a8ed6efcc3
4
+ data.tar.gz: 12fe72aa75b6317dc3c2c74f33b21bae00751c61
5
5
  SHA512:
6
- metadata.gz: 839f27f8d5f2b5062121681b83f71d4f2c973b341c62ea81e353a234882c1f01731bafed52d73e18fe0abcb2296d80195048703b01ccfcaea65e036cce7a5604
7
- data.tar.gz: 2932fc34f195548e3b96339206529880f3e960c461b497f8f9f8641c6cfa4d1050c8263144a277d01ac3289d471d076b37f9294f1bbe33a66c2fc8f0f7004d65
6
+ metadata.gz: 5ceaed33443036a025fdb6fad63c244d9bbe9114e65f4e5850f1fbeba3cbc0ca4ae29e3eb08b4611335be1166b8bca8ce2b6f98e02f1fde731e36f9692b245c0
7
+ data.tar.gz: 839f75af16900756c0510af9691f43579598868fde4263e08a05edcaad74a58623f633951b757328fe9b9dd772eb836eaf7c5fef3ae458803fc72288e3bb6123
data/CHANGES.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Not yet released
4
4
 
5
- ## Version 0.12.5
5
+ ## Version 0.12.5-0.12.6
6
6
 
7
7
  * Fix behaviour when git output is not utf-8.
8
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.5
1
+ 0.12.6
@@ -58,6 +58,14 @@ module GitCommitNotifier
58
58
  end
59
59
  end
60
60
 
61
+ def to_utf8_strict(str)
62
+ return str unless str.respond_to?(:force_encoding)
63
+ str = str.force_encoding(Encoding::UTF_8)
64
+ return str if str.valid_encoding?
65
+ str = str.force_encoding(Encoding::BINARY)
66
+ str.encode("UTF-8", :invalid => :replace, :undef => :replace)
67
+ end
68
+
61
69
  def range_info(range)
62
70
  matches = range.match(/^@@ \-(\S+) \+(\S+)/)
63
71
  matches[1..2].map { |m| m.split(',')[0].to_i }
@@ -453,6 +461,10 @@ module GitCommitNotifier
453
461
  end
454
462
  result[:message] = message
455
463
 
464
+ result.each_key do |key|
465
+ result[key] = to_utf8_strict result[key]
466
+ end
467
+
456
468
  result
457
469
  end
458
470
 
@@ -5,10 +5,8 @@ class GitCommitNotifier::Git
5
5
  class << self
6
6
  def to_utf8(str)
7
7
  return str unless str.respond_to?(:force_encoding)
8
- str = str.force_encoding(Encoding::UTF_8)
9
- return str if str.valid_encoding?
10
- str = str.force_encoding(Encoding::BINARY)
11
- str.encode("UTF-8", :invalid => :replace, :undef => :replace)
8
+ str.force_encoding(Encoding::UTF_8)
9
+ str
12
10
  end
13
11
 
14
12
  # Runs specified command and gets its output.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-commit-notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.5
4
+ version: 0.12.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bodo Tasche
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-01-20 00:00:00.000000000 Z
12
+ date: 2014-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs