percy-common 3.1.6 → 3.1.8

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
  SHA256:
3
- metadata.gz: a7080fcc4fac57a2f39b2443e4ca8473a30baa536c7d90a62990e24d01d49a1c
4
- data.tar.gz: 8116d7e1e95c04d9dc9a6966050aad2e70b8e89a293df6e50940f4c2d75bf673
3
+ metadata.gz: daf5d5179a57be833d015e4d87092e2725622c8762f199d4cee9655fc1989508
4
+ data.tar.gz: aebf200ac7329d26c1e848dd5ba2967ab7ed7d87767c6e2f59e587fb3b448a00
5
5
  SHA512:
6
- metadata.gz: 497b402af66b77a76d2254b9f433e112d283318c75d0a9d08b545b75ba5d6f33a49a7756cf8dbc53902a02e282e07c597ad37a2eab680d23e9f4a4987aaca4e9
7
- data.tar.gz: d78b7f18fbbec3d1e8b72a6b4e3536a31995d6823d94848b99c75cdebe418ae773c11c2d8a371267ae0e2a2e841877150b9ab8f477ba9482bd29332760c8882b
6
+ metadata.gz: 583cba5530413ec3d418409a67cc78b881109f79aff5ed7d70191d6bb53f15b54835adf815de95f273c85cce1bfa4bf30d233adef4f340e1a9b3ef2670f7ecac
7
+ data.tar.gz: 1bbea03cfeb84ebde6fb7d9d3fdafa58b56a33e6f81420fcf794ee383c7d6abb44fa3147d3a879db720a1bc4434706a578603f8397c47a0e652bed9bf1cb5fd4
@@ -0,0 +1,29 @@
1
+ agents: &agents
2
+ os: 'linux_small'
3
+
4
+ command: &command
5
+ - make test
6
+
7
+ steps:
8
+ - label: ':rubocop: Lint'
9
+ agents: *agents
10
+ command:
11
+ - make lint
12
+
13
+ - label: ':rspec: Test Ruby 2.6'
14
+ env:
15
+ BASE_IMAGE: 'ruby:2.6-alpine'
16
+ agents: *agents
17
+ command: *command
18
+
19
+ - label: ':rspec: Test Ruby 2.7'
20
+ env:
21
+ BASE_IMAGE: 'ruby:2.7-alpine'
22
+ agents: *agents
23
+ command: *command
24
+
25
+ - label: ':rspec: Test Ruby 3.0'
26
+ env:
27
+ BASE_IMAGE: 'ruby:3.0-alpine'
28
+ agents: *agents
29
+ command: *command
data/.rubocop.yml CHANGED
@@ -12,6 +12,8 @@ RSpec/DescribeClass:
12
12
  Exclude:
13
13
  - spec/percy/logger_spec.rb
14
14
 
15
+ # TODO: disable new cops
15
16
  AllCops:
17
+ TargetRubyVersion: 2.6
16
18
  Exclude:
17
19
  - spec/support/redis_mock.rb
data/Dockerfile ADDED
@@ -0,0 +1,10 @@
1
+ ARG BASE_IMAGE
2
+ FROM $BASE_IMAGE
3
+
4
+ RUN apk update && apk add alpine-sdk
5
+ RUN gem install bundler
6
+
7
+ ADD . /app/src
8
+ WORKDIR /app/src
9
+
10
+ RUN bundle install
data/Makefile ADDED
@@ -0,0 +1,11 @@
1
+ # setup default base image
2
+ BASE_IMAGE ?= ruby:2.6-alpine
3
+
4
+ build:
5
+ docker-compose build --build-arg BASE_IMAGE="$(BASE_IMAGE)"
6
+
7
+ lint: build
8
+ docker-compose run app sh -c 'bundle exec rubocop'
9
+
10
+ test: build
11
+ docker-compose run app sh -c 'bundle exec rspec'
@@ -0,0 +1,6 @@
1
+ version: '3'
2
+
3
+ services:
4
+ app:
5
+ volumes:
6
+ - .:/app/src
@@ -0,0 +1,5 @@
1
+ version: '3'
2
+
3
+ services:
4
+ app:
5
+ build: .
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  module Common
3
- VERSION = '3.1.6'.freeze
3
+ VERSION = '3.1.8'.freeze
4
4
  end
5
5
  end
@@ -28,10 +28,11 @@ module Percy
28
28
  end
29
29
  end
30
30
 
31
- def self.verify_healthcheck(url:, expected_body: 'ok', retry_wait_seconds: 0.5, proxy: nil)
31
+ def self.verify_healthcheck(url:, expected_body: 'ok', retry_wait_seconds: 0.5, proxy: nil,
32
+ headers: {})
32
33
  10.times do
33
34
  begin
34
- response = Excon.get(url, proxy: proxy)
35
+ response = Excon.get(url, proxy: proxy, headers: headers)
35
36
  return true if response.body == expected_body
36
37
  rescue Excon::Error::Socket, Excon::Error::Timeout
37
38
  sleep retry_wait_seconds
@@ -41,11 +42,11 @@ module Percy
41
42
  end
42
43
 
43
44
  def self.verify_http_server_up(hostname, port: nil,
44
- path: nil, retry_wait_seconds: 0.25, proxy: nil)
45
+ path: nil, retry_wait_seconds: 0.25, proxy: nil, headers: {})
45
46
  10.times do
46
47
  begin
47
48
  url = "http://#{hostname}#{port.nil? ? '' : ':' + port.to_s}#{path || ''}"
48
- Excon.get(url, proxy: proxy)
49
+ Excon.get(url, proxy: proxy, headers: headers)
49
50
  return true
50
51
  rescue Excon::Error::Socket, Excon::Error::Timeout
51
52
  sleep retry_wait_seconds
data/percy-common.gemspec CHANGED
@@ -15,15 +15,18 @@ Gem::Specification.new do |spec|
15
15
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
16
16
  f.match(/^(test|spec|features)\//)
17
17
  end
18
+
19
+ spec.required_ruby_version = '>= 2.6'
18
20
  spec.require_paths = ['lib']
19
21
 
20
22
  spec.add_dependency 'dogstatsd-ruby', '>= 4.4', '< 4.9'
21
23
  spec.add_dependency 'excon', '~> 0.57'
22
24
  spec.add_dependency 'redis', '>= 4.1.3', '< 5.0.0'
23
25
 
24
- spec.add_development_dependency 'bundler', '~> 2.1.4'
26
+ spec.add_development_dependency 'bundler', '~> 2.0'
25
27
  spec.add_development_dependency 'guard-rspec', '~> 4.7'
26
28
  spec.add_development_dependency 'percy-style', '~> 0.7.0'
27
29
  spec.add_development_dependency 'rake', '~> 13.0'
28
30
  spec.add_development_dependency 'rspec', '~> 3.2'
31
+ spec.add_development_dependency 'webrick', '~> 1.0'
29
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percy-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.6
4
+ version: 3.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perceptual Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-24 00:00:00.000000000 Z
11
+ date: 2022-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dogstatsd-ruby
@@ -70,14 +70,14 @@ dependencies:
70
70
  requirements:
71
71
  - - "~>"
72
72
  - !ruby/object:Gem::Version
73
- version: 2.1.4
73
+ version: '2.0'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - "~>"
79
79
  - !ruby/object:Gem::Version
80
- version: 2.1.4
80
+ version: '2.0'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: guard-rspec
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -134,6 +134,20 @@ dependencies:
134
134
  - - "~>"
135
135
  - !ruby/object:Gem::Version
136
136
  version: '3.2'
137
+ - !ruby/object:Gem::Dependency
138
+ name: webrick
139
+ requirement: !ruby/object:Gem::Requirement
140
+ requirements:
141
+ - - "~>"
142
+ - !ruby/object:Gem::Version
143
+ version: '1.0'
144
+ type: :development
145
+ prerelease: false
146
+ version_requirements: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - "~>"
149
+ - !ruby/object:Gem::Version
150
+ version: '1.0'
137
151
  description: ''
138
152
  email:
139
153
  - team@percy.io
@@ -141,17 +155,21 @@ executables: []
141
155
  extensions: []
142
156
  extra_rdoc_files: []
143
157
  files:
144
- - ".circleci/config.yml"
158
+ - ".buildkite/pipeline.yml"
145
159
  - ".gitignore"
146
160
  - ".rspec"
147
161
  - ".rubocop.yml"
148
162
  - ".rubocop_todo.yml"
163
+ - Dockerfile
149
164
  - Gemfile
150
165
  - Guardfile
151
166
  - LICENSE
167
+ - Makefile
152
168
  - README.md
153
169
  - RELEASING.md
154
170
  - Rakefile
171
+ - docker-compose.override.yml
172
+ - docker-compose.yml
155
173
  - lib/percy/common.rb
156
174
  - lib/percy/common/engine.rb
157
175
  - lib/percy/common/version.rb
@@ -174,7 +192,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
192
  requirements:
175
193
  - - ">="
176
194
  - !ruby/object:Gem::Version
177
- version: '0'
195
+ version: '2.6'
178
196
  required_rubygems_version: !ruby/object:Gem::Requirement
179
197
  requirements:
180
198
  - - ">="
data/.circleci/config.yml DELETED
@@ -1,18 +0,0 @@
1
- version: 2.1
2
-
3
- jobs:
4
- ruby_25:
5
- docker:
6
- - image: circleci/ruby:2.5-node-browsers
7
- steps:
8
- - checkout
9
- - run: gem update --system
10
- - run: gem install bundler
11
- - run: bundle install
12
- - run: bundle exec rubocop -D
13
-
14
- workflows:
15
- version: 2
16
- test:
17
- jobs:
18
- - ruby_25