autobuild 1.5.13 → 1.5.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ == Version 1.5.14
2
+ * fix Ruby 1.9 rejecting some git logs if they have a weird encoding
3
+
1
4
  == Version 1.5.13
2
5
  * fix error messages in the oroGen packages, when the loaded oroGen file has an
3
6
  error
@@ -1,5 +1,5 @@
1
1
  module Autobuild
2
- VERSION = "1.5.13" unless defined? Autobuild::VERSION
2
+ VERSION = "1.5.14" unless defined? Autobuild::VERSION
3
3
  end
4
4
 
5
5
  require 'autobuild/config'
@@ -168,11 +168,22 @@ module Autobuild
168
168
  end
169
169
 
170
170
  def log(from, to)
171
- log = `git log --pretty=format:"%h %cr %cn %s" #{from}..#{to}`
172
- if log.respond_to?(:force_encoding)
173
- log.force_encoding('UTF-8')
171
+ log = `git log --encoding=UTF-8 --pretty=format:"%h %cr %cn %s" #{from}..#{to}`.chomp
172
+
173
+ if log.respond_to?(:encode)
174
+ log = log.encode
175
+ end
176
+
177
+ encodings = ['UTF-8', 'iso8859-1']
178
+ begin
179
+ log.split("\n")
180
+ rescue
181
+ if encodings.empty?
182
+ return "[some log messages have invalid characters, cannot display/parse them]"
183
+ end
184
+ log.force_encoding(encodings.pop)
185
+ retry
174
186
  end
175
- log.chomp.split("\n")
176
187
  end
177
188
  end
178
189
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 5
8
- - 13
9
- version: 1.5.13
8
+ - 14
9
+ version: 1.5.14
10
10
  platform: ruby
11
11
  authors:
12
12
  - Sylvain Joyeux
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-06-11 00:00:00 +02:00
17
+ date: 2010-06-23 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency