pact-support 1.16.9 → 1.19.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
  SHA256:
3
- metadata.gz: 46ec9f6e6642bfc067b5327994f844ecd15afaa81ab23b9c4fc4fa55ceae83fe
4
- data.tar.gz: ef772e9256e18df3164c834aa55e21fb7742484a19fbc9dccdc17b11fc391d7d
3
+ metadata.gz: b14c4782f4f8ac5c6a2695b3328b8605a51af770e463ac55a3df41843b976677
4
+ data.tar.gz: 683323b4a276240ecfe2dc7cb650b0b232008f5904f9f59df071b5fe5e2ee291
5
5
  SHA512:
6
- metadata.gz: 0a6f386eb4fcb8f3b49832e58564ed56e4a1e56a8da6ecea776f211ee0850a78ba9adb6677571053d943ef717204f17b513a2347bfcd43757a03ce2018a35d94
7
- data.tar.gz: 60d0cbcc25b2b10937c2bea9501ae540b0a5aaf7946676414ea01da95829ef36a2c0f19a558883367631cb894bf9ccbcce32200d09f8a907050b763b731bf68b
6
+ metadata.gz: 80825eb6afa2d2684c54e1805aaa2b19c14200ff516d72654a48ab5ee5b0df11ede5fb6a4cdd0761687e52489936c6b61bcaa8ecfbbc0b271957f5b9f46ae3f0
7
+ data.tar.gz: cebfe89b260425ca88e91a3594a4d84037444a0f3f490b0042d9991543a0afbdce7ea19c1ef94f241e64dd7648f07877ec61e8984a493673b080aef4752b957f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,43 @@
1
+ <a name="v1.19.0"></a>
2
+ ### v1.19.0 (2022-11-15)
3
+
4
+ #### Features
5
+
6
+ * **generators**
7
+ * add generators to a consumer contract request (#97) ([fbce4cb](/../../commit/fbce4cb))
8
+
9
+ <a name="v1.18.1"></a>
10
+ ### v1.18.1 (2022-08-17)
11
+
12
+ #### Bug Fixes
13
+
14
+ * use send to invoke remove_method when removing as_json from Regexp ([cb29cdd](/../../commit/cb29cdd))
15
+
16
+ <a name="v1.18.0"></a>
17
+ ### v1.18.0 (2022-03-28)
18
+
19
+ #### Features
20
+
21
+ * replace term-ansicolor with rainbow ([e8b6ada](/../../commit/e8b6ada))
22
+
23
+ #### Bug Fixes
24
+
25
+ * Fixup ruby warnings (#96) ([cee7113](/../../commit/cee7113))
26
+
27
+ <a name="v1.17.0"></a>
28
+ ### v1.17.0 (2021-10-01)
29
+
30
+ #### Features
31
+
32
+ * allow SSL verification to be disabled by setting environment variable PACT_DISABLE_SSL_VERIFICATION=true ([dd39c04](/../../commit/dd39c04))
33
+
34
+ <a name="v1.16.10"></a>
35
+ ### v1.16.10 (2021-10-01)
36
+
37
+ #### Bug Fixes
38
+
39
+ * change expgen to a runtime dependency ([da81634](/../../commit/da81634))
40
+
1
41
  <a name="v1.16.9"></a>
2
42
  ### v1.16.9 (2021-09-30)
3
43
 
@@ -38,7 +38,7 @@ module Pact
38
38
  if query_is_string
39
39
  request_hash['query'] = Pact::QueryHash.new(request_hash['query'], original_query_string, Pact::Query.parsed_as_nested?(request_hash['query']))
40
40
  end
41
- request = Pact::Request::Expected.from_hash(request_hash)
41
+ Pact::Request::Expected.from_hash(request_hash)
42
42
  end
43
43
 
44
44
  def self.parse_response response_hash, options
@@ -35,7 +35,7 @@ module Pact
35
35
  def save_pactfile_to_tmp pact, name
36
36
  ::FileUtils.mkdir_p Pact.configuration.tmp_dir
37
37
  ::File.open(Pact.configuration.tmp_dir + "/#{name}", "w") { |file| file << pact}
38
- rescue Errno::EROFS => e
38
+ rescue Errno::EROFS
39
39
  # do nothing, probably on RunKit
40
40
  end
41
41
 
@@ -56,9 +56,9 @@ module Pact
56
56
  def get_remote_with_retry(uri_string, options)
57
57
  uri = URI(uri_string)
58
58
  if uri.userinfo
59
- options[:username] = uri.user unless options[:username]
60
- options[:password] = uri.password unless options[:password]
61
- end
59
+ options[:username] = uri.user unless options[:username]
60
+ options[:password] = uri.password unless options[:password]
61
+ end
62
62
  ((options[:retry_limit] || RETRY_LIMIT) + 1).times do |i|
63
63
  begin
64
64
  response = get_remote(uri, options)
@@ -108,7 +108,13 @@ module Pact
108
108
  http.use_ssl = (uri.scheme == 'https')
109
109
  http.ca_file = ENV['SSL_CERT_FILE'] if ENV['SSL_CERT_FILE'] && ENV['SSL_CERT_FILE'] != ''
110
110
  http.ca_path = ENV['SSL_CERT_DIR'] if ENV['SSL_CERT_DIR'] && ENV['SSL_CERT_DIR'] != ''
111
- http.set_debug_output(Pact::Http::AuthorizationHeaderRedactor.new(Pact.configuration.output_stream)) if options[:verbose]
111
+ http.set_debug_output(Pact::Http::AuthorizationHeaderRedactor.new(Pact.configuration.output_stream)) if verbose?(options)
112
+ if disable_ssl_verification?
113
+ if verbose?(options)
114
+ Pact.configuration.output_stream.puts("SSL verification is disabled")
115
+ end
116
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
117
+ end
112
118
  http
113
119
  end
114
120
 
@@ -139,5 +145,13 @@ module Pact
139
145
  def windows_safe(uri)
140
146
  uri.start_with?("http") ? uri : uri.gsub("\\", File::SEPARATOR)
141
147
  end
148
+
149
+ def verbose?(options)
150
+ options[:verbose] || ENV['VERBOSE'] == 'true'
151
+ end
152
+
153
+ def disable_ssl_verification?
154
+ ENV['PACT_DISABLE_SSL_VERIFICATION'] == 'true' || ENV['PACT_BROKER_DISABLE_SSL_VERIFICATION'] == 'true'
155
+ end
142
156
  end
143
157
  end
@@ -6,7 +6,7 @@ module Pact
6
6
  class Expected < Pact::Request::Base
7
7
 
8
8
  DEFAULT_OPTIONS = {:allow_unexpected_keys => false}.freeze
9
- attr_accessor :options #Temporary hack
9
+ attr_accessor :options, :generators
10
10
 
11
11
  def self.from_hash(hash)
12
12
  sym_hash = symbolize_keys hash
@@ -16,11 +16,13 @@ module Pact
16
16
  headers = sym_hash.fetch(:headers, key_not_found)
17
17
  body = sym_hash.fetch(:body, key_not_found)
18
18
  options = sym_hash.fetch(:options, {})
19
- new(method, path, headers, body, query, options)
19
+ generators = sym_hash.fetch(:generators, {})
20
+ new(method, path, headers, body, query, options, generators)
20
21
  end
21
22
 
22
- def initialize(method, path, headers, body, query, options = {})
23
+ def initialize(method, path, headers, body, query, options = {}, generators = {})
23
24
  super(method, path, headers, body, query)
25
+ @generators = generators
24
26
  @options = options
25
27
  end
26
28
 
@@ -1,13 +1,11 @@
1
1
  require 'pact/shared/active_support_support'
2
- require 'term/ansicolor'
2
+ require 'rainbow'
3
3
 
4
4
  module Pact
5
5
  module Matchers
6
6
  class EmbeddedDiffFormatter
7
7
 
8
8
  include Pact::ActiveSupportSupport
9
- C = ::Term::ANSIColor
10
-
11
9
 
12
10
  EXPECTED = /"EXPECTED([A-Z_]*)":/
13
11
 
@@ -53,7 +51,7 @@ module Pact
53
51
  end
54
52
 
55
53
  def coloured_key match, colour
56
- '"' + C.color(colour, match.downcase.gsub(/^"|":$/,'')) + '":'
54
+ '"' + Rainbow(match.downcase.gsub(/^"|":$/,'')).send(colour) + '":'
57
55
  end
58
56
 
59
57
  end
@@ -42,7 +42,7 @@ module Pact
42
42
  end
43
43
 
44
44
  def recurse_hash hash, path
45
- recursed = hash.each_with_object({}) do | (k, v), new_hash |
45
+ hash.each_with_object({}) do | (k, v), new_hash |
46
46
  new_path = path + "['#{k}']"
47
47
  new_hash[k] = recurse(v, new_path)
48
48
  end
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Support
3
- VERSION = "1.16.9"
3
+ VERSION = "1.19.0"
4
4
  end
5
5
  end
data/lib/pact/term.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'pact/shared/active_support_support'
2
+ Regexp.send(:remove_method, :as_json) if Regexp.method_defined?(:as_json)
2
3
  require 'json/add/regexp'
3
4
  require 'pact/errors'
4
5
 
data/lib/tasks/pact.rake CHANGED
@@ -15,12 +15,12 @@ namespace :pact do
15
15
 
16
16
  desc "Verifies the pact at the given URI against this service provider."
17
17
  task 'verify:at', :pact_uri do | t, args |
18
- require 'term/ansicolor'
18
+ require 'rainbow'
19
19
  require 'pact/tasks/task_helper'
20
20
 
21
21
  include Pact::TaskHelper
22
22
 
23
- abort(::Term::ANSIColor.red("Please provide a pact URI. eg. rake pact:verify:at[../my-consumer/spec/pacts/my_consumer-my_provider.json]")) unless args[:pact_uri]
23
+ abort(Rainbow("Please provide a pact URI. eg. rake pact:verify:at[../my-consumer/spec/pacts/my_consumer-my_provider.json]").red) unless args[:pact_uri]
24
24
  handle_verification_failure do
25
25
  execute_pact_verify args[:pact_uri]
26
26
  end
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.16.9
4
+ version: 1.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Fraser
@@ -9,25 +9,25 @@ authors:
9
9
  - Brent Snook
10
10
  - Ronald Holshausen
11
11
  - Beth Skurrie
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2021-09-30 00:00:00.000000000 Z
15
+ date: 2022-11-14 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
- name: term-ansicolor
18
+ name: rainbow
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
21
  - - "~>"
22
22
  - !ruby/object:Gem::Version
23
- version: '1.0'
23
+ version: 3.1.1
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - "~>"
29
29
  - !ruby/object:Gem::Version
30
- version: '1.0'
30
+ version: 3.1.1
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: awesome_print
33
33
  requirement: !ruby/object:Gem::Requirement
@@ -62,14 +62,14 @@ dependencies:
62
62
  requirements:
63
63
  - - "~>"
64
64
  - !ruby/object:Gem::Version
65
- version: 0.1.1
66
- type: :development
65
+ version: '0.1'
66
+ type: :runtime
67
67
  prerelease: false
68
68
  version_requirements: !ruby/object:Gem::Requirement
69
69
  requirements:
70
70
  - - "~>"
71
71
  - !ruby/object:Gem::Version
72
- version: 0.1.1
72
+ version: '0.1'
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: rspec
75
75
  requirement: !ruby/object:Gem::Requirement
@@ -216,7 +216,7 @@ dependencies:
216
216
  - - "~>"
217
217
  - !ruby/object:Gem::Version
218
218
  version: '0.5'
219
- description:
219
+ description:
220
220
  email:
221
221
  - james.fraser@alumni.swinburne.edu
222
222
  - sergei.matheson@gmail.com
@@ -304,7 +304,7 @@ homepage: https://github.com/pact-foundation/pact-support
304
304
  licenses:
305
305
  - MIT
306
306
  metadata: {}
307
- post_install_message:
307
+ post_install_message:
308
308
  rdoc_options: []
309
309
  require_paths:
310
310
  - lib
@@ -319,8 +319,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
319
319
  - !ruby/object:Gem::Version
320
320
  version: '0'
321
321
  requirements: []
322
- rubygems_version: 3.2.28
323
- signing_key:
322
+ rubygems_version: 3.3.25
323
+ signing_key:
324
324
  specification_version: 4
325
325
  summary: Shared code for Pact gems
326
326
  test_files: []