percy-common 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +37 -5
- data/lib/percy/common/engine.rb +7 -0
- data/lib/percy/common/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 843bb5ade878a82fa046f8024a37273a363310f0
|
4
|
+
data.tar.gz: 36f86e902963f0b3f209836b980428ef21e76334
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bef3758204d4b3ca170ca2b7c49636f54d623f8c26c2f8d5bb53d41feda0fb62068f92f52a26439f2ddb179839d3256644c34e68fbc39ac3b34b88df92218514
|
7
|
+
data.tar.gz: 2104a221fc389ddccd5a9c2e0efaed5e74c97733725e714f5b6e2527c92838bdc5820b6cffe89018f1fbc3b10ea79d4dec01520bdf5392eb2fbfbd090a678834
|
data/README.md
CHANGED
@@ -2,7 +2,39 @@
|
|
2
2
|
|
3
3
|
Server-side common library for Percy.
|
4
4
|
|
5
|
-
##
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```
|
10
|
+
gem 'percy-common'
|
11
|
+
```
|
12
|
+
|
13
|
+
Or, for a Ruby library, add this to your gemspec:
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
spec.add_development_dependency 'percy-common'
|
17
|
+
```
|
18
|
+
|
19
|
+
And then run:
|
20
|
+
|
21
|
+
```bash
|
22
|
+
$ bundle install
|
23
|
+
```
|
24
|
+
|
25
|
+
### Setup in a Rails app
|
26
|
+
|
27
|
+
If including in a Rails app, add the following to your `application.rb`:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'percy/common/engine'
|
31
|
+
```
|
32
|
+
|
33
|
+
This enables Rails to autoload the constants from this library without more `require` lines.
|
34
|
+
|
35
|
+
## Usage
|
36
|
+
|
37
|
+
### Percy::KeywordStruct
|
6
38
|
|
7
39
|
A simple struct that can be used when you need to return a simple value object.
|
8
40
|
|
@@ -19,7 +51,7 @@ foo.qux # --> nil
|
|
19
51
|
foo.fake # --> raises NoMethodError
|
20
52
|
```
|
21
53
|
|
22
|
-
|
54
|
+
### Percy.logger
|
23
55
|
|
24
56
|
```ruby
|
25
57
|
require 'percy/logger'
|
@@ -32,9 +64,9 @@ Percy.logger.error { 'error message' }
|
|
32
64
|
|
33
65
|
Prefer the block form usage `Percy.logger.debug { 'message' }` over `Percy.logger.debug('message')` because it is slightly more efficient when the log will be excluded by the current logging level. For example, if the log level is currently `info`, then a `debug` log in block form will never evaluate or allocate the message string itself.
|
34
66
|
|
35
|
-
|
67
|
+
### Percy::ProcessHelpers
|
36
68
|
|
37
|
-
|
69
|
+
#### `gracefully_kill(pid[, grace_period_seconds: 10])`
|
38
70
|
|
39
71
|
Returns `true` if the process was successfully killed, or `false` if the process did not exist or its exit status was already collected.
|
40
72
|
|
@@ -46,7 +78,7 @@ Percy::ProcessHelpers.gracefully_kill(pid)
|
|
46
78
|
|
47
79
|
This will send `SIGTERM` to the process, wait up to 10 seconds, then send `SIGKILL` if it has not already shut down.
|
48
80
|
|
49
|
-
|
81
|
+
### Percy::Stats
|
50
82
|
|
51
83
|
Client for recording Datadog metrics and automatically setting up Percy-specific environment tags.
|
52
84
|
|
data/lib/percy/common/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: percy-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Perceptual Inc.
|
@@ -125,6 +125,7 @@ files:
|
|
125
125
|
- README.md
|
126
126
|
- Rakefile
|
127
127
|
- lib/percy/common.rb
|
128
|
+
- lib/percy/common/engine.rb
|
128
129
|
- lib/percy/common/version.rb
|
129
130
|
- lib/percy/keyword_struct.rb
|
130
131
|
- lib/percy/logger.rb
|
@@ -150,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
151
|
version: '0'
|
151
152
|
requirements: []
|
152
153
|
rubyforge_project:
|
153
|
-
rubygems_version: 2.
|
154
|
+
rubygems_version: 2.6.12
|
154
155
|
signing_key:
|
155
156
|
specification_version: 4
|
156
157
|
summary: Server-side common library for Percy.
|