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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dd84cf9ac38282cc0057f714197b65e0e75a8122
4
- data.tar.gz: 01f640d98197a7e4a34b0f09b33d31e8e05e7900
3
+ metadata.gz: 679ab5cb622bcd8363fbc9145dce6e533cc5d887
4
+ data.tar.gz: 2847774e6745adc368a9cd5c2519190057290f4f
5
5
  SHA512:
6
- metadata.gz: 015eec97ba845a645d0a9e3f309bc4542746bc101970ae5506a6c40df5444d7948393166361a4206e33683584cc0b57d97c9a50cb5e323dc408f5b3a781e14c3
7
- data.tar.gz: 5513c0a98c57e71cb980f33373d2f0aa447bd4bbdd680cebc6af1ead78c01b9af58415429d3a6f3658a006a187a7a0d4d2263a8eac1a56179671bda28a432da3
6
+ metadata.gz: 1aec137240ec78d0f293fde22542553c312a0d3a4955abd846d9c30d4d585ec77c794b63df2b8e96046187441d249adc879db920bc2937a7b4e71babafe6225b
7
+ data.tar.gz: ed66d35eb25c182def63139abe20929fcfe541aa5dda061519a09e7c3aec7397f14f5e5e2f1e7f0d8074cc7b137732742db3a0ce3c05c57d55498239659d3a2c
data/.rubocop.yml CHANGED
@@ -4,4 +4,7 @@ inherit_gem:
4
4
 
5
5
  RSpec/InstanceVariable:
6
6
  Exclude:
7
- - spec/lib/percy/client/environment_spec.rb
7
+ - spec/lib/percy/client/environment_spec.rb
8
+
9
+ AllCops:
10
+ TargetRubyVersion: 2.1
data/.travis.yml CHANGED
@@ -11,7 +11,9 @@ rvm:
11
11
  - ruby-2.2.6
12
12
  - ruby-2.3.3
13
13
  - ruby-2.4.0
14
- - ruby-head
14
+ - ruby-2.5.0
15
+ # ruby-head is now 2.6dev. Installation fails.
16
+ # - ruby-head
15
17
  before_install:
16
18
  - gem update --system
17
19
  - gem update bundler
data/appveyor.yml CHANGED
@@ -1,5 +1,8 @@
1
1
  environment:
2
2
  matrix:
3
+ - RUBY_VERSION: 25
4
+ - RUBY_VERSION: 24
5
+ - RUBY_VERSION: 23
3
6
  - RUBY_VERSION: 22
4
7
  - RUBY_VERSION: 21
5
8
 
@@ -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, setting PERCY_BRANCH to "master".'
133
- result = 'master'
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
- `git rev-parse --abbrev-ref HEAD 2> /dev/null`.strip
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
 
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  class Client
3
- VERSION = '1.13.6'.freeze
3
+ VERSION = '1.13.7'.freeze
4
4
  end
5
5
  end
@@ -111,9 +111,9 @@ RSpec.describe Percy::Client::Environment do
111
111
  end
112
112
 
113
113
  describe '#branch' do
114
- it 'returns master if not in a git repo' do
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 eq('master')
116
+ expect(Percy::Client::Environment.branch).to be_nil
117
117
  end
118
118
 
119
119
  it 'reads from the current local repo' do
@@ -105,3 +105,4 @@ RSpec.describe Percy::Client::Resource do
105
105
  end
106
106
  end
107
107
  end
108
+ # rubocop:enable RSpec/MultipleDescribes
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.6
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: 2017-11-11 00:00:00.000000000 Z
11
+ date: 2018-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday