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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 742716e7882cdaa89f9845db4162b320c5eb5911
4
- data.tar.gz: e6537800786471c8d809a3b60f0ecdf9d6c027fe
3
+ metadata.gz: 1b61b498283e49d9a07af018cd13f91882247837
4
+ data.tar.gz: d7012eb2dc17c9a62d533a475b7ba54c1d6396e9
5
5
  SHA512:
6
- metadata.gz: b7a448c0b9524d4c7990cff5ea167280d2e8415dd51690ef1d03aaf05cdb3c2aab5500869404b43298791349c2f33856fb726f982e0319901bc386c655a2d241
7
- data.tar.gz: 38420777b161c8ef724011842a5a98e8c712641c98bfa9191cdd7daa67f09165aaf3f4d5c6fe36c1f13511ece9488240783a0f16d3006649f63f019c6e620388
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]
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  class Client
3
- VERSION = '1.13.2'.freeze
3
+ VERSION = '1.13.3'.freeze
4
4
  end
5
5
  end
@@ -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.2
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-07 00:00:00.000000000 Z
11
+ date: 2017-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday