percy-client 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 91dde3564fe8e518402afa26ee2f52d5690ae688
4
- data.tar.gz: 4653d42a6fe35bbf4f55e97a4b181ced166b63b8
3
+ metadata.gz: ff13681ebc6ba8462ab1bab83f05778d7a3ea23b
4
+ data.tar.gz: 9f7c57003c03986c9f8b71e3e465d97cd4204a87
5
5
  SHA512:
6
- metadata.gz: 503bad70215a73b1c78ca2aa617c29f1a84baff8b6d5adee4270ed34885a3ad31b333775062045479e7588d580a9d1db34b6856b0b39f0d59509740057a851de
7
- data.tar.gz: 30a2bbcc431217f32c1afd707440641fe166a9d81951680e507c2dcf778a3f27820f4cd82a2213dbd97401ed04c1cb186e0213255df67d1f1d2bf13b843cbbd0
6
+ metadata.gz: 9c4e58df2f2171d01cc43d95ea2d3890909f3eb8bd02f935def23741dc3bb959a53a51aa7439cc54b080780823d0a94a4aa0b7fe16bf597377da227e43635003
7
+ data.tar.gz: cf6dfba7f7ef13d152a86ebc09ae9d0fa9fa9ab2723ac3f47fb5f113dd991e102fb01e864a83db9a3e5c736e4fa8e9662d63672feac8462d6cb6bdb2f958c128
@@ -90,7 +90,11 @@ module Percy
90
90
  when :jenkins
91
91
  ENV['ghprbTargetBranch']
92
92
  when :travis
93
- ENV['TRAVIS_BRANCH']
93
+ if pull_request_number && ENV['TRAVIS_BRANCH'] == 'master'
94
+ "github-pr-#{pull_request_number}"
95
+ else
96
+ ENV['TRAVIS_BRANCH']
97
+ end
94
98
  when :circle
95
99
  ENV['CIRCLE_BRANCH']
96
100
  when :codeship
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  class Client
3
- VERSION = '1.4.0'
3
+ VERSION = '1.4.1'
4
4
  end
5
5
  end
@@ -230,6 +230,14 @@ RSpec.describe Percy::Client::Environment do
230
230
  it 'reads from the CI environment' do
231
231
  expect(Percy::Client::Environment.branch).to eq('travis-branch')
232
232
  end
233
+ it 'renames the Percy branch if this is a PR with an unknown head branch' do
234
+ # Note: this is very unfortunately necessary because Travis does not expose the head branch,
235
+ # only the targeted branch in TRAVIS_BRANCH and no way to get the actual head PR branch.
236
+ # We create a fake branch name so that Percy does not mistake this PR as a new master build.
237
+ # https://github.com/travis-ci/travis-ci/issues/1633#issuecomment-194749671
238
+ ENV['TRAVIS_BRANCH'] = 'master'
239
+ expect(Percy::Client::Environment.branch).to eq('github-pr-256')
240
+ end
233
241
  end
234
242
  describe '#_commit_sha' do
235
243
  it 'reads from the CI environment' 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.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perceptual Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-22 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project:
175
- rubygems_version: 2.2.2
175
+ rubygems_version: 2.4.5
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: Percy::Client
@@ -196,3 +196,4 @@ test_files:
196
196
  - spec/lib/percy_spec.rb
197
197
  - spec/spec_helper.rb
198
198
  - spec/support/vcr_setup.rb
199
+ has_rdoc: