pact-mock_service 3.10.0 → 3.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +1 -1
- data/lib/pact/mock_service/interactions/interaction_mismatch.rb +1 -1
- data/lib/pact/mock_service/version.rb +1 -1
- data/lib/pact/support/metrics.rb +21 -8
- metadata +5 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 849091e40f13174ea1be3cb01825b87de403bb9dcf8853352368383b35cf3ccd
|
4
|
+
data.tar.gz: 0265d10371215e180e768684c3be869f2be42da4755191ab13f560d0ad0780fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a379d74298ca5368f11f678a45bcfe023da06fd3ff8d873c8b3fba9e39d13426eaf08384ec5763e9a5a9767721f6fffe1fa0124af540fbc758649d516d51aff
|
7
|
+
data.tar.gz: 50138c0f2f5241c6f86e87b20294f8347fbf31e7d268b9746aa5941d7598bf97677996fce118c137a515914845165bc48fcdf4d567abea7685fb9558ca49b49b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
<a name="v3.11.1"></a>
|
2
|
+
### v3.11.1 (2023-05-05)
|
3
|
+
|
4
|
+
#### Bug Fixes
|
5
|
+
|
6
|
+
* set args via ** for diff_formatter.call ([96a00a9](/../../commit/96a00a9))
|
7
|
+
|
8
|
+
<a name="v3.11.0"></a>
|
9
|
+
### v3.11.0 (2022-08-17)
|
10
|
+
|
11
|
+
#### Features
|
12
|
+
|
13
|
+
* only print metrics warning once per thread ([1ae43da](/../../commit/1ae43da))
|
14
|
+
|
15
|
+
#### Bug Fixes
|
16
|
+
|
17
|
+
* fix ruby `circular require` warning (#136) ([615e59c](/../../commit/615e59c))
|
18
|
+
|
1
19
|
<a name="v3.10.0"></a>
|
2
20
|
### v3.10.0 (2022-02-21)
|
3
21
|
|
data/README.md
CHANGED
@@ -130,7 +130,7 @@ Description:
|
|
130
130
|
|
131
131
|
See [CONTRIBUTING.md](/CONTRIBUTING.md)
|
132
132
|
|
133
|
-
[pact]: https://github.com/
|
133
|
+
[pact]: https://github.com/pact-foundation/pact-ruby
|
134
134
|
[executables]: https://github.com/pact-foundation/pact-ruby-standalone/releases
|
135
135
|
[pact-dev]: https://groups.google.com/forum/#!forum/pact-dev
|
136
136
|
[wiki]: https://github.com/pact-foundation/pact-mock_service/wiki
|
data/lib/pact/support/metrics.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'securerandom'
|
2
2
|
require 'digest'
|
3
3
|
require 'socket'
|
4
|
-
require 'pact/support/metrics'
|
5
4
|
require 'pact/mock_service/version'
|
6
5
|
require 'net/http'
|
7
6
|
|
@@ -10,17 +9,21 @@ module Pact
|
|
10
9
|
class Metrics
|
11
10
|
|
12
11
|
def self.report_metric(event, category, action, value = 1)
|
12
|
+
do_once_per_thread(:pact_metrics_message_shown) do
|
13
|
+
if track_events?
|
14
|
+
Pact.configuration.output_stream.puts "mock WARN: Please note: we are tracking events anonymously to gather important usage statistics like Pact-Ruby version and operating system. To disable tracking, set the 'PACT_DO_NOT_TRACK' environment variable to 'true'."
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
13
18
|
in_thread do
|
14
19
|
begin
|
15
20
|
if track_events?
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
req = Net::HTTP::Post.new(uri)
|
20
|
-
req.set_form_data(create_tracking_event(event, category, action, value))
|
21
|
+
uri = URI('https://www.google-analytics.com/collect')
|
22
|
+
req = Net::HTTP::Post.new(uri)
|
23
|
+
req.set_form_data(create_tracking_event(event, category, action, value))
|
21
24
|
|
22
|
-
|
23
|
-
|
25
|
+
Net::HTTP.start(uri.hostname, uri.port, read_timeout:2, open_timeout:2, :use_ssl => true ) do |http|
|
26
|
+
http.request(req)
|
24
27
|
end
|
25
28
|
end
|
26
29
|
rescue StandardError => e
|
@@ -43,6 +46,16 @@ module Pact
|
|
43
46
|
end
|
44
47
|
end
|
45
48
|
|
49
|
+
# Not super safe to use the thread, but it's good enough for this usecase
|
50
|
+
def self.do_once_per_thread(key)
|
51
|
+
result = nil
|
52
|
+
if !Thread.current[key]
|
53
|
+
result = yield
|
54
|
+
end
|
55
|
+
Thread.current[key] = true
|
56
|
+
result
|
57
|
+
end
|
58
|
+
|
46
59
|
def self.create_tracking_event(event, category, action, value)
|
47
60
|
{
|
48
61
|
"v" => 1,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact-mock_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Fraser
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2023-05-17 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rack
|
@@ -104,20 +104,6 @@ dependencies:
|
|
104
104
|
- - "~>"
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '1.3'
|
107
|
-
- !ruby/object:Gem::Dependency
|
108
|
-
name: term-ansicolor
|
109
|
-
requirement: !ruby/object:Gem::Requirement
|
110
|
-
requirements:
|
111
|
-
- - "~>"
|
112
|
-
- !ruby/object:Gem::Version
|
113
|
-
version: '1.0'
|
114
|
-
type: :runtime
|
115
|
-
prerelease: false
|
116
|
-
version_requirements: !ruby/object:Gem::Requirement
|
117
|
-
requirements:
|
118
|
-
- - "~>"
|
119
|
-
- !ruby/object:Gem::Version
|
120
|
-
version: '1.0'
|
121
107
|
- !ruby/object:Gem::Dependency
|
122
108
|
name: pact-support
|
123
109
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,14 +206,14 @@ dependencies:
|
|
220
206
|
requirements:
|
221
207
|
- - "~>"
|
222
208
|
- !ruby/object:Gem::Version
|
223
|
-
version: '
|
209
|
+
version: '2.4'
|
224
210
|
type: :development
|
225
211
|
prerelease: false
|
226
212
|
version_requirements: !ruby/object:Gem::Requirement
|
227
213
|
requirements:
|
228
214
|
- - "~>"
|
229
215
|
- !ruby/object:Gem::Version
|
230
|
-
version: '
|
216
|
+
version: '2.4'
|
231
217
|
- !ruby/object:Gem::Dependency
|
232
218
|
name: hashie
|
233
219
|
requirement: !ruby/object:Gem::Requirement
|
@@ -412,7 +398,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
412
398
|
- !ruby/object:Gem::Version
|
413
399
|
version: '0'
|
414
400
|
requirements: []
|
415
|
-
rubygems_version: 3.
|
401
|
+
rubygems_version: 3.4.13
|
416
402
|
signing_key:
|
417
403
|
specification_version: 4
|
418
404
|
summary: Provides a mock service for use with Pact
|