percy-common 1.2.0 → 1.3.0

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: a652130076a2b0813f00bb165c51b299824510bc
4
- data.tar.gz: 9fb9173c1160f0ce954d90fd28c58b00aa1e027f
3
+ metadata.gz: 843bb5ade878a82fa046f8024a37273a363310f0
4
+ data.tar.gz: 36f86e902963f0b3f209836b980428ef21e76334
5
5
  SHA512:
6
- metadata.gz: 508907f4ae23369340fd5f34a03dbf98c2b51eb12fcf0931575b1c8fa9d506525fa502939ba46bf48c8cbc2ffe51d9fab8f8a62a80b770b54a9d33fa2b1385f8
7
- data.tar.gz: f06831d5d30151b47fa2c60f98cd520e4a036845a7a52c2ad98e27e900a00bab568e8b70bbe0ba382eee97aa15d1f2e873c3b325d20e350e66ab18bff46bb06e
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
- ## Percy::KeywordStruct
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
- ## Percy.logger
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
- ## Percy::ProcessHelpers
67
+ ### Percy::ProcessHelpers
36
68
 
37
- ### `gracefully_kill(pid[, grace_period_seconds: 10])`
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
- ## Percy::Stats
81
+ ### Percy::Stats
50
82
 
51
83
  Client for recording Datadog metrics and automatically setting up Percy-specific environment tags.
52
84
 
@@ -0,0 +1,7 @@
1
+ module Percy
2
+ module Common
3
+ class Engine < ::Rails::Engine
4
+ config.autoload_paths += Dir["#{config.root}/lib/**/"]
5
+ end
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  module Percy
2
2
  module Common
3
- VERSION = '1.2.0'.freeze
3
+ VERSION = '1.3.0'.freeze
4
4
  end
5
5
  end
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.2.0
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.4.8
154
+ rubygems_version: 2.6.12
154
155
  signing_key:
155
156
  specification_version: 4
156
157
  summary: Server-side common library for Percy.