percy-client 1.13.6 → 1.13.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/.travis.yml +3 -1
- data/appveyor.yml +3 -0
- data/lib/percy/client/environment.rb +9 -4
- data/lib/percy/client/version.rb +1 -1
- data/spec/lib/percy/client/environment_spec.rb +2 -2
- data/spec/lib/percy/client/resources_spec.rb +1 -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: 679ab5cb622bcd8363fbc9145dce6e533cc5d887
|
4
|
+
data.tar.gz: 2847774e6745adc368a9cd5c2519190057290f4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1aec137240ec78d0f293fde22542553c312a0d3a4955abd846d9c30d4d585ec77c794b63df2b8e96046187441d249adc879db920bc2937a7b4e71babafe6225b
|
7
|
+
data.tar.gz: ed66d35eb25c182def63139abe20929fcfe541aa5dda061519a09e7c3aec7397f14f5e5e2f1e7f0d8074cc7b137732742db3a0ce3c05c57d55498239659d3a2c
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/appveyor.yml
CHANGED
@@ -31,10 +31,11 @@ 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')
|
34
|
+
return {branch: branch} unless output && output != ''
|
34
35
|
output = output.force_encoding('UTF-8') if output && output.encoding.to_s == 'US-ASCII'
|
35
36
|
|
36
37
|
# Use the specified SHA or, if not given, the parsed SHA at HEAD.
|
37
|
-
commit_sha = _commit_sha || output && output.match(/COMMIT_SHA:(.*)/)[1]
|
38
|
+
commit_sha = _commit_sha || (output && output.match(/COMMIT_SHA:(.*)/) || [])[1]
|
38
39
|
|
39
40
|
# If not running in a git repo, allow nils for certain commit attributes.
|
40
41
|
parse = ->(regex) { (output && output.match(regex) || [])[1] }
|
@@ -129,8 +130,8 @@ module Percy
|
|
129
130
|
end
|
130
131
|
|
131
132
|
if result == ''
|
132
|
-
STDERR.puts '[percy] Warning: not in a git repo,
|
133
|
-
result =
|
133
|
+
STDERR.puts '[percy] Warning: not in a git repo, no branch detected.'
|
134
|
+
result = nil
|
134
135
|
end
|
135
136
|
result
|
136
137
|
end
|
@@ -143,7 +144,11 @@ module Percy
|
|
143
144
|
# @private
|
144
145
|
def self._raw_branch_output
|
145
146
|
# Discover from local git repo branch name.
|
146
|
-
|
147
|
+
if Gem.win_platform?
|
148
|
+
`git rev-parse --abbrev-ref HEAD 2> NUL`.strip
|
149
|
+
else
|
150
|
+
`git rev-parse --abbrev-ref HEAD 2> /dev/null`.strip
|
151
|
+
end
|
147
152
|
end
|
148
153
|
class << self; private :_raw_branch_output; end
|
149
154
|
|
data/lib/percy/client/version.rb
CHANGED
@@ -111,9 +111,9 @@ RSpec.describe Percy::Client::Environment do
|
|
111
111
|
end
|
112
112
|
|
113
113
|
describe '#branch' do
|
114
|
-
it 'returns
|
114
|
+
it 'returns nil if not in a git repo' do
|
115
115
|
expect(Percy::Client::Environment).to receive(:_raw_branch_output).and_return('')
|
116
|
-
expect(Percy::Client::Environment.branch).to
|
116
|
+
expect(Percy::Client::Environment.branch).to be_nil
|
117
117
|
end
|
118
118
|
|
119
119
|
it 'reads from the current local repo' do
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perceptual Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|