pact 1.65.0 → 1.65.2

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: 24b61e9c910570243bd6054ebc23bf968f5bd20a308ab887184d0860c2b2018d
4
- data.tar.gz: 62ba67e2a1ff00b591da39accfe05010d2836f5aa386df0129aa9df786b89156
3
+ metadata.gz: 57a260592020f08f9b82face34aaa4c8144998f6961a875bb35f47af45d20712
4
+ data.tar.gz: '03583661eab424c19a9bf429d53ae58cee5d325014f66ca54cbdc087d8e5d74d'
5
5
  SHA512:
6
- metadata.gz: b473ff4c78e3310449e8cae9a78bc379c36d20c6b646d3d587d83652598e32cae6f12ec50ad84623a1349655bbb841f7dc79aa8c0784dc79b53306f006ddc990
7
- data.tar.gz: 91464395e4565d96df5025b998caa1e42a9ba71d9a72bfa0220dad95745bf3cc7d911f22171a1957d01a40a06c7042b9d53d49f75206ef757457227db5931260
6
+ metadata.gz: 35e9d39793ff8c09933c659a7361727afd4255d143501d981909f10461bbf9042635ba9ca307e148949aee77bf8b92e09456eb1b094646fda309842cf3bf8c5b
7
+ data.tar.gz: '03952e5c2c95ec5e1958914b6c9f8c723257ff3f0a083d44270ef2ccc1b1248b0a24599ccbf4927cc16eb176241cd8f3597863ac46d9fc4d20e1e34c6c9134ee'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ <a name="v1.65.2"></a>
2
+ ### v1.65.2 (2024-09-26)
3
+
4
+ <a name="v1.65.1"></a>
5
+ ### v1.65.1 (2024-08-08)
6
+
7
+ #### Bug Fixes
8
+
9
+ * set color codes even on dumb terms (prev behaviour) ([4f01bc9](/../../commit/4f01bc9))
10
+ * use .empty? in handling_no_pacts_found ([43bce74](/../../commit/43bce74))
11
+
1
12
  <a name="v1.65.0"></a>
2
13
  ### v1.65.0 (2024-08-06)
3
14
 
@@ -101,8 +101,8 @@ module Pact
101
101
 
102
102
  def handling_no_pacts_found
103
103
  pacts_found = yield
104
- raise "No pacts found to verify" if pacts_found.blank? && options[:fail_if_no_pacts_found] != false
105
- if pacts_found.blank? && options[:fail_if_no_pacts_found] == false
104
+ raise "No pacts found to verify" if pacts_found.empty? && options[:fail_if_no_pacts_found] != false
105
+ if pacts_found.empty? && options[:fail_if_no_pacts_found] == false
106
106
  Pact.configuration.output_stream.puts "WARN: No pacts found to verify & fail_if_no_pacts_found is set to false."
107
107
  end
108
108
  pacts_found
@@ -2,15 +2,13 @@ require 'pact/provider/help/content'
2
2
  require 'fileutils'
3
3
  require 'pact/consumer/configuration'
4
4
  require 'pact/provider/help/write'
5
- require 'term/ansicolor'
5
+ require 'rainbow'
6
6
 
7
7
  module Pact
8
8
  module Provider
9
9
  module Help
10
10
  class ConsoleText
11
11
 
12
- C = ::Term::ANSIColor
13
-
14
12
  def self.call reports_dir = Pact.configuration.reports_dir, options = {color: true}
15
13
  new(reports_dir || Pact.configuration.reports_dir, options).call
16
14
  end
@@ -46,13 +44,11 @@ module Pact
46
44
  end
47
45
 
48
46
  def error_text_coloured
49
- C.red(error_text_plain)
47
+ Rainbow(error_text_plain).red
50
48
  end
51
49
 
52
50
  class ColorizeMarkdown
53
51
 
54
- C = ::Term::ANSIColor
55
-
56
52
  def self.call markdown
57
53
  markdown.split("\n").collect do | line |
58
54
  if line.start_with?("# ")
@@ -66,11 +62,11 @@ module Pact
66
62
  end
67
63
 
68
64
  def self.yellow_underling string
69
- C.underline(C.yellow(string))
65
+ Rainbow(string).yellow.underline
70
66
  end
71
67
 
72
68
  def self.green string
73
- C.green(string)
69
+ Rainbow(string).green
74
70
  end
75
71
 
76
72
  end
@@ -1,5 +1,5 @@
1
1
  require 'pact/consumer/configuration'
2
- require 'term/ansicolor'
2
+ require 'rainbow'
3
3
  require 'pathname'
4
4
 
5
5
  module Pact
@@ -7,8 +7,6 @@ module Pact
7
7
  module Help
8
8
  class PromptText
9
9
 
10
- C = ::Term::ANSIColor
11
-
12
10
  def self.call reports_dir = Pact.configuration.reports_dir, options = {color: Pact.configuration.color_enabled}
13
11
  new(reports_dir, options).call
14
12
  end
@@ -31,7 +29,7 @@ module Pact
31
29
  end
32
30
 
33
31
  def prompt_text_colored
34
- C.yellow(prompt_text_plain)
32
+ Rainbow(prompt_text_plain).yellow
35
33
  end
36
34
 
37
35
  def rake_args
@@ -1,15 +1,13 @@
1
- require 'term/ansicolor'
1
+ require 'rainbow'
2
2
  require 'pact/term'
3
3
 
4
4
  module Pact
5
5
  module Matchers
6
6
  module Messages
7
7
 
8
- C = ::Term::ANSIColor
9
-
10
8
  def match_term_failure_message diff, actual, diff_formatter, color_enabled
11
9
  actual_string = String === actual ? actual : actual.to_json
12
- maybe_coloured_string = color_enabled ? C.white(actual_string) : actual_string
10
+ maybe_coloured_string = color_enabled ? Rainbow(actual_string).white : actual_string
13
11
  message = "Actual: #{maybe_coloured_string}\n\n"
14
12
  formatted_diff = diff_formatter.call(diff)
15
13
  message + colorize_if_enabled(formatted_diff, color_enabled)
@@ -40,7 +38,7 @@ module Pact
40
38
  # RSpec wraps each line in the failure message with failure_color, turning it red.
41
39
  # To ensure the lines in the diff that should be white, stay white, put an
42
40
  # ANSI reset at the start of each line.
43
- formatted_diff.split("\n").collect{ |line| ::Term::ANSIColor.reset + line }.join("\n")
41
+ formatted_diff.split("\n").collect{ |line|"\e[0m#{line}" }.join("\n")
44
42
  else
45
43
  formatted_diff
46
44
  end
@@ -1,11 +1,9 @@
1
- require 'term/ansicolor'
1
+ require 'rainbow'
2
2
 
3
3
  module Pact
4
4
  module Provider
5
5
  class PrintMissingProviderStates
6
6
 
7
- C = ::Term::ANSIColor
8
-
9
7
  # Hash of consumer names to array of names of missing provider states
10
8
  def self.call missing_provider_states, output
11
9
  if missing_provider_states.any?
@@ -15,8 +13,8 @@ module Pact
15
13
 
16
14
  def self.colorize string
17
15
  lines = string.split("\n")
18
- first_line = C.cyan(C.underline(lines[0]))
19
- other_lines = C.cyan(lines[1..-1].join("\n"))
16
+ first_line = Rainbow(lines[0]).cyan.underline
17
+ other_lines = Rainbow(lines[1..-1].join("\n")).cyan
20
18
  first_line + "\n" + other_lines
21
19
  end
22
20
 
@@ -1,6 +1,6 @@
1
1
  require 'pact/provider/print_missing_provider_states'
2
2
  require 'rspec/core/formatters/documentation_formatter'
3
- require 'term/ansicolor'
3
+ require 'rainbow'
4
4
  require 'pact/provider/help/prompt_text'
5
5
 
6
6
  module Pact
@@ -13,8 +13,6 @@ module Pact
13
13
  end
14
14
  end
15
15
 
16
- C = ::Term::ANSIColor
17
-
18
16
  def dump_commands_to_rerun_failed_examples
19
17
  return if failed_examples.empty?
20
18
 
@@ -1,6 +1,6 @@
1
1
  require 'pact/provider/print_missing_provider_states'
2
2
  require 'rspec/core/formatters'
3
- require 'term/ansicolor'
3
+ require 'rainbow'
4
4
  require 'pact/provider/help/prompt_text'
5
5
 
6
6
  module Pact
@@ -22,8 +22,6 @@ module Pact
22
22
  :example_passed, :example_pending, :example_failed
23
23
  end
24
24
 
25
- C = ::Term::ANSIColor
26
-
27
25
  def example_group_started(notification)
28
26
  # This is the metadata on the top level "Verifying a pact between X and Y" describe block
29
27
  if @group_level == 0
@@ -1,6 +1,6 @@
1
1
  require 'rspec/core/formatters'
2
2
  require 'pact/provider/verification_results/publish_all'
3
- require 'term/ansicolor'
3
+ require 'rainbow'
4
4
  require 'pact/matchers/extract_diff_messages'
5
5
 
6
6
  module Pact
@@ -43,7 +43,7 @@ module Pact
43
43
  if example.exception
44
44
  hash[:exception] = {
45
45
  class: example.exception.class.name,
46
- message: ::Term::ANSIColor.uncolor(example.exception.message)
46
+ message: "\e[0m#{example.exception.message}"
47
47
  }
48
48
  end
49
49
 
data/lib/pact/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  # Remember to bump pact-provider-proxy when this changes major version
2
2
  module Pact
3
- VERSION = "1.65.0"
3
+ VERSION = "1.65.2"
4
4
  end
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
data/pact.gemspec CHANGED
@@ -29,8 +29,7 @@ Gem::Specification.new do |gem|
29
29
  gem.add_runtime_dependency 'rspec', '~> 3.0'
30
30
  gem.add_runtime_dependency 'rack-test', '>= 0.6.3', '< 3.0.0'
31
31
  gem.add_runtime_dependency 'thor', '>= 0.20', '< 2.0'
32
- gem.add_runtime_dependency 'webrick', '~> 1.8'
33
- gem.add_runtime_dependency 'term-ansicolor', '~> 1.7'
32
+ gem.add_runtime_dependency "rainbow", '~> 3.1'
34
33
 
35
34
  gem.add_runtime_dependency 'pact-support', '~> 1.16', '>= 1.16.9'
36
35
  gem.add_runtime_dependency 'pact-mock_service', '~> 3.0', '>= 3.3.1'
@@ -45,4 +44,5 @@ Gem::Specification.new do |gem|
45
44
  gem.add_development_dependency 'bump', '~> 0.5'
46
45
  gem.add_development_dependency 'pact-message', '~> 0.8'
47
46
  gem.add_development_dependency 'rspec-its', '~> 1.3'
47
+ gem.add_development_dependency 'webrick', '~> 1.8'
48
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.65.0
4
+ version: 1.65.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: 2024-08-07 00:00:00.000000000 Z
15
+ date: 2024-09-26 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec
@@ -69,33 +69,19 @@ dependencies:
69
69
  - !ruby/object:Gem::Version
70
70
  version: '2.0'
71
71
  - !ruby/object:Gem::Dependency
72
- name: webrick
73
- requirement: !ruby/object:Gem::Requirement
74
- requirements:
75
- - - "~>"
76
- - !ruby/object:Gem::Version
77
- version: '1.8'
78
- type: :runtime
79
- prerelease: false
80
- version_requirements: !ruby/object:Gem::Requirement
81
- requirements:
82
- - - "~>"
83
- - !ruby/object:Gem::Version
84
- version: '1.8'
85
- - !ruby/object:Gem::Dependency
86
- name: term-ansicolor
72
+ name: rainbow
87
73
  requirement: !ruby/object:Gem::Requirement
88
74
  requirements:
89
75
  - - "~>"
90
76
  - !ruby/object:Gem::Version
91
- version: '1.7'
77
+ version: '3.1'
92
78
  type: :runtime
93
79
  prerelease: false
94
80
  version_requirements: !ruby/object:Gem::Requirement
95
81
  requirements:
96
82
  - - "~>"
97
83
  - !ruby/object:Gem::Version
98
- version: '1.7'
84
+ version: '3.1'
99
85
  - !ruby/object:Gem::Dependency
100
86
  name: pact-support
101
87
  requirement: !ruby/object:Gem::Requirement
@@ -282,6 +268,20 @@ dependencies:
282
268
  - - "~>"
283
269
  - !ruby/object:Gem::Version
284
270
  version: '1.3'
271
+ - !ruby/object:Gem::Dependency
272
+ name: webrick
273
+ requirement: !ruby/object:Gem::Requirement
274
+ requirements:
275
+ - - "~>"
276
+ - !ruby/object:Gem::Version
277
+ version: '1.8'
278
+ type: :development
279
+ prerelease: false
280
+ version_requirements: !ruby/object:Gem::Requirement
281
+ requirements:
282
+ - - "~>"
283
+ - !ruby/object:Gem::Version
284
+ version: '1.8'
285
285
  description: Enables consumer driven contract testing, providing a mock service and
286
286
  DSL for the consumer project, and interaction playback and verification for the
287
287
  service provider project.
@@ -419,7 +419,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
419
419
  - !ruby/object:Gem::Version
420
420
  version: '0'
421
421
  requirements: []
422
- rubygems_version: 3.5.17
422
+ rubygems_version: 3.5.20
423
423
  signing_key:
424
424
  specification_version: 4
425
425
  summary: Enables consumer driven contract testing, providing a mock service and DSL