pact-mock_service 3.0.0 → 3.0.1

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: 9c70b1c91a2cb0c5669764a493b1a40e54ef899de89d31f2cabf67479b440fde
4
- data.tar.gz: 1b3a5b28fd448a55d59ca38c4d21a85fb5eb9de2bfbe313a0746376dd179502d
3
+ metadata.gz: 13fa333461a52e6602ce822aa3cf462b2e0539bcfed0df82217bd92f4f125455
4
+ data.tar.gz: '08289828ec7f2319034c1d23ca72fe51ca77c3951b28380d73252f4d9eadd54a'
5
5
  SHA512:
6
- metadata.gz: 6beed9671e9c090c7b9d755566f1c7f78b3b4f5972e91f9de4cc8a5f9b42dfbd22d43d6cd13f201d58abf570e2e9abfc5646ea73508dd31d38b5069132432a0a
7
- data.tar.gz: ecc5d8264e776a7ee712acdfa2d5eee037380c0380fd40ca51c8e1eff01166bc8a181e603b7e7b718b6ec07fc63ea583286523664f3845c599c2043ac6aa3bfc
6
+ metadata.gz: 70a04aaf9cc73ab6542718c6d9bff087403fc2377174a4330ef70a7eb87f2651a4ffdd4c5e32d77f17227a951d87d532475381dc7bd86cd28667e532c3746935
7
+ data.tar.gz: 8353d0c83b591f060029e6d4d052f5042a9f8414ee9d484a363c4f469ef13c1190742d9599dc5d4974527216233aea090c7832fcfcc5824cc3a1f5dafadd5cab
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ <a name="v3.0.1"></a>
2
+ ### v3.0.1 (2019-03-08)
3
+
4
+
5
+ #### Bug Fixes
6
+
7
+ * add missing host argument to server spawn ([ee5cf90](/../../commit/ee5cf90))
8
+
9
+
1
10
  <a name="v3.0.0"></a>
2
11
  ### v3.0.0 (2019-02-21)
3
12
 
@@ -7,15 +7,15 @@ module Pact
7
7
 
8
8
  class PortUnavailableError < StandardError; end
9
9
 
10
- def self.call pidfile, port, ssl = false
10
+ def self.call pidfile, host, port, ssl = false
11
11
  if pidfile.can_start?
12
- if port_available? port
12
+ if port_available? host, port
13
13
  pid = fork do
14
14
  yield
15
15
  end
16
16
  pidfile.pid = pid
17
17
  Process.detach(pid)
18
- Server::WaitForServerUp.(port, {ssl: ssl})
18
+ Server::WaitForServerUp.(host, port, {ssl: ssl})
19
19
  pidfile.write
20
20
  else
21
21
  raise PortUnavailableError.new("ERROR: Port #{port} already in use.")
@@ -23,8 +23,8 @@ module Pact
23
23
  end
24
24
  end
25
25
 
26
- def self.port_available? port
27
- server = TCPServer.new('127.0.0.1', port)
26
+ def self.port_available? host, port
27
+ server = TCPServer.new(host, port)
28
28
  true
29
29
  rescue
30
30
  false
@@ -7,18 +7,18 @@ module Pact
7
7
  module Server
8
8
  class WaitForServerUp
9
9
 
10
- def self.call(port, options = {ssl: false})
10
+ def self.call(host, port, options = {ssl: false})
11
11
  tries = 0
12
12
  responsive = false
13
- while !(responsive = responsive?(port, options)) && tries < 100
13
+ while !(responsive = responsive?(host, port, options)) && tries < 100
14
14
  tries += 1
15
15
  sleep 1
16
16
  end
17
17
  raise "Timed out waiting for server to start up on port #{port}" if !responsive
18
18
  end
19
19
 
20
- def self.responsive? port, options
21
- http = Net::HTTP.new('localhost', port)
20
+ def self.responsive? host, port, options
21
+ http = Net::HTTP.new(host, port)
22
22
  if options[:ssl]
23
23
  http.use_ssl = true
24
24
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
@@ -27,7 +27,7 @@ module Pact
27
27
  scheme = 'http'
28
28
  end
29
29
  http.start {
30
- request = Net::HTTP::Get.new "#{scheme}://localhost:#{port}/"
30
+ request = Net::HTTP::Get.new "#{scheme}://#{host}:#{port}/"
31
31
  request['X-Pact-Mock-Service'] = true
32
32
  response = http.request request
33
33
  response.code == '200'
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module MockService
3
- VERSION = "3.0.0"
3
+ VERSION = "3.0.1"
4
4
  end
5
5
  end
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.0.0
4
+ version: 3.0.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: 2019-02-21 00:00:00.000000000 Z
15
+ date: 2019-03-07 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rack
@@ -399,7 +399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
399
399
  - !ruby/object:Gem::Version
400
400
  version: '0'
401
401
  requirements: []
402
- rubygems_version: 3.0.2
402
+ rubygems_version: 3.0.3
403
403
  signing_key:
404
404
  specification_version: 4
405
405
  summary: Provides a mock service for use with Pact