pact-support 1.6.1 → 1.6.2
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 +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/pact/consumer_contract/pact_file.rb +21 -25
- data/lib/pact/support/version.rb +1 -1
- data/spec/lib/pact/matching_rules_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7052ae315f37af6ae3f7ea9d1996f8cbb12ea7d0
|
4
|
+
data.tar.gz: 648fff2d0659c82cca19046f1c5440f86e9cf2ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c2f5d2b7f6c792582eeaf03a70446aff2c3d67395a4b6448c11fbd6a38e9fbb6538f0b206b1cf297b923cbc7c0d977854160d412f6e0b540f36bae250f8e420
|
7
|
+
data.tar.gz: 516d17b3b6c5b8590b264d934334dcdd6c8360e19a9581390f8e6353f17407ca098d63bedf35f213615e1076214d743eb03196063e7166fe56bb781698af1a77
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
<a name="v1.6.2"></a>
|
2
|
+
### v1.6.2 (2018-05-31)
|
3
|
+
|
4
|
+
|
5
|
+
#### Bug Fixes
|
6
|
+
|
7
|
+
* **windows-path**
|
8
|
+
* prevent locale file paths to be parsed by URI to stop errors in windows paths like spaces in paths ([ecf64d6](/../../commit/ecf64d6))
|
9
|
+
|
10
|
+
|
1
11
|
<a name="v1.6.1"></a>
|
2
12
|
### v1.6.1 (2018-05-21)
|
3
13
|
|
@@ -36,39 +36,25 @@ module Pact
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def render_pact(uri_string, options)
|
39
|
-
|
40
|
-
if uri_obj.userinfo
|
41
|
-
options[:username] = uri_obj.user unless options[:username]
|
42
|
-
options[:password] = uri_obj.password unless options[:password]
|
43
|
-
end
|
44
|
-
get(uri_obj, options)
|
39
|
+
local?(uri_string) ? get_local(uri_string, options) : get_remote_with_retry(uri_string, options)
|
45
40
|
end
|
46
41
|
|
47
42
|
private
|
48
|
-
|
49
|
-
def get(uri, options)
|
50
|
-
local?(uri) ? get_local(uri, options) : get_remote_with_retry(uri, options)
|
51
|
-
end
|
52
|
-
|
43
|
+
|
53
44
|
def local? uri
|
54
|
-
!uri.
|
45
|
+
!uri.start_with?("http://", "https://")
|
55
46
|
end
|
56
47
|
|
57
|
-
def get_local(
|
58
|
-
File.read
|
48
|
+
def get_local(filepath, _)
|
49
|
+
File.read windows_safe(filepath)
|
59
50
|
end
|
60
51
|
|
61
|
-
def
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
http.request(request)
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
def get_remote_with_retry(uri, options)
|
52
|
+
def get_remote_with_retry(uri_string, options)
|
53
|
+
uri = URI(uri_string)
|
54
|
+
if uri.userinfo
|
55
|
+
options[:username] = uri.user unless options[:username]
|
56
|
+
options[:password] = uri.password unless options[:password]
|
57
|
+
end
|
72
58
|
((options[:retry_limit] || RETRY_LIMIT) + 1).times do |i|
|
73
59
|
begin
|
74
60
|
response = get_remote(uri, options)
|
@@ -88,6 +74,16 @@ module Pact
|
|
88
74
|
end
|
89
75
|
end
|
90
76
|
end
|
77
|
+
|
78
|
+
def get_remote(uri, options)
|
79
|
+
request = Net::HTTP::Get.new(uri)
|
80
|
+
request.basic_auth(options[:username], options[:password]) if options[:username]
|
81
|
+
Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == 'https') do |http|
|
82
|
+
http.open_timeout = options[:open_timeout] || OPEN_TIMEOUT
|
83
|
+
http.read_timeout = options[:read_timeout] || READ_TIMEOUT
|
84
|
+
http.request(request)
|
85
|
+
end
|
86
|
+
end
|
91
87
|
|
92
88
|
def success?(response)
|
93
89
|
response.code.to_i == 200
|
data/lib/pact/support/version.rb
CHANGED
@@ -16,7 +16,7 @@ module Pact
|
|
16
16
|
subject { MatchingRules.merge(object, rules, options)}
|
17
17
|
|
18
18
|
context "when the pact_specification_version is nil" do
|
19
|
-
let(:
|
19
|
+
let(:options) { { pact_specification_version: nil } }
|
20
20
|
|
21
21
|
it "calls Merge" do
|
22
22
|
expect(Merge).to receive(:call)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.2
|
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: 2018-05-
|
15
|
+
date: 2018-05-31 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: randexp
|