pact 1.65.0 → 1.65.1

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: 24b61e9c910570243bd6054ebc23bf968f5bd20a308ab887184d0860c2b2018d
4
- data.tar.gz: 62ba67e2a1ff00b591da39accfe05010d2836f5aa386df0129aa9df786b89156
3
+ metadata.gz: 8f2c248601b130dc0b629786adcdc2f760290d45c1921f2a0a23e913b70769f1
4
+ data.tar.gz: fb1a821dc9b7c682bc1df84ff3f4d9ce3fff1a4effd2ae23841fb025be3e8175
5
5
  SHA512:
6
- metadata.gz: b473ff4c78e3310449e8cae9a78bc379c36d20c6b646d3d587d83652598e32cae6f12ec50ad84623a1349655bbb841f7dc79aa8c0784dc79b53306f006ddc990
7
- data.tar.gz: 91464395e4565d96df5025b998caa1e42a9ba71d9a72bfa0220dad95745bf3cc7d911f22171a1957d01a40a06c7042b9d53d49f75206ef757457227db5931260
6
+ metadata.gz: bcb308639de856981627d02155df3462b062efb2c53c2774cab15cf77ea6a8f5c6992c3c73d870cc5fcba8ef8cfaa8329db80d6e5d03bda45ad79e41e1dd24ce
7
+ data.tar.gz: 6314c6af1ea82ed0bf6d5cbf1bfa056b9b21ab2684274d38251a5bd266bd4a3eace8916c9899132ffde51166a1cf59cbbbfe5631a29df71c0109b5a63799d69e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ <a name="v1.65.1"></a>
2
+ ### v1.65.1 (2024-08-08)
3
+
4
+ #### Bug Fixes
5
+
6
+ * set color codes even on dumb terms (prev behaviour) ([4f01bc9](/../../commit/4f01bc9))
7
+ * use .empty? in handling_no_pacts_found ([43bce74](/../../commit/43bce74))
8
+
1
9
  <a name="v1.65.0"></a>
2
10
  ### v1.65.0 (2024-08-06)
3
11
 
@@ -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.1"
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
@@ -30,7 +30,7 @@ Gem::Specification.new do |gem|
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
32
  gem.add_runtime_dependency 'webrick', '~> 1.8'
33
- gem.add_runtime_dependency 'term-ansicolor', '~> 1.7'
33
+ gem.add_runtime_dependency "rainbow", '~> 3.1'
34
34
 
35
35
  gem.add_runtime_dependency 'pact-support', '~> 1.16', '>= 1.16.9'
36
36
  gem.add_runtime_dependency 'pact-mock_service', '~> 3.0', '>= 3.3.1'
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.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: 2024-08-07 00:00:00.000000000 Z
15
+ date: 2024-08-08 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rspec
@@ -83,19 +83,19 @@ dependencies:
83
83
  - !ruby/object:Gem::Version
84
84
  version: '1.8'
85
85
  - !ruby/object:Gem::Dependency
86
- name: term-ansicolor
86
+ name: rainbow
87
87
  requirement: !ruby/object:Gem::Requirement
88
88
  requirements:
89
89
  - - "~>"
90
90
  - !ruby/object:Gem::Version
91
- version: '1.7'
91
+ version: '3.1'
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - "~>"
97
97
  - !ruby/object:Gem::Version
98
- version: '1.7'
98
+ version: '3.1'
99
99
  - !ruby/object:Gem::Dependency
100
100
  name: pact-support
101
101
  requirement: !ruby/object:Gem::Requirement