percy-client 1.13.2 → 1.13.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/percy/client/environment.rb +1 -0
- data/lib/percy/client/version.rb +1 -1
- data/spec/lib/percy/client/environment_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b61b498283e49d9a07af018cd13f91882247837
|
4
|
+
data.tar.gz: d7012eb2dc17c9a62d533a475b7ba54c1d6396e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d65e28daf94000046cb06ebfb5fa2e4df0e03c334f8fe4af11593dda5aac605783be3afb5d7f4c46abf08edc3f9e6157d6b27ec5203f57927105a706a1740914
|
7
|
+
data.tar.gz: 55b0ecf32b992861a7334f7ad844ab9c614f645698fa907f596672dfa105ddbf979ca0becc8dbb3f17ff5bf711412380c5a7404ffa28da792d14cd448b15f387
|
@@ -31,6 +31,7 @@ module Percy
|
|
31
31
|
def self.commit
|
32
32
|
output = _raw_commit_output(_commit_sha) if _commit_sha
|
33
33
|
output = _raw_commit_output('HEAD') unless output
|
34
|
+
output = output.force_encoding('UTF-8') if output && output.encoding.to_s == 'US-ASCII'
|
34
35
|
|
35
36
|
# Use the specified SHA or, if not given, the parsed SHA at HEAD.
|
36
37
|
commit_sha = _commit_sha || output && output.match(/COMMIT_SHA:(.*)/)[1]
|
data/lib/percy/client/version.rb
CHANGED
@@ -524,6 +524,15 @@ RSpec.describe Percy::Client::Environment do
|
|
524
524
|
expect(commit[:committer_name]).to be_nil
|
525
525
|
expect(commit[:message]).to be_nil
|
526
526
|
end
|
527
|
+
it 'handles unicode characters in environment where LANG is not set' do
|
528
|
+
output = "COMMIT_SHA:\nAUTHOR_NAME:Spêcìal Ñàme\nAUTHOR_EMAIL:\nCOMMITTER_NAME:\n" \
|
529
|
+
"COMMITTER_EMAIL:\nCOMMITTED_DATE:\nCOMMIT_MESSAGE:".force_encoding('US-ASCII')
|
530
|
+
expect(output.encoding.to_s).to eq('US-ASCII')
|
531
|
+
expect(Percy::Client::Environment).to receive(:_raw_commit_output).once.and_return(output)
|
532
|
+
|
533
|
+
commit = Percy::Client::Environment.commit
|
534
|
+
expect(commit[:author_name]).to eq('Spêcìal Ñàme')
|
535
|
+
end
|
527
536
|
end
|
528
537
|
end
|
529
538
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: percy-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.13.
|
4
|
+
version: 1.13.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perceptual Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|