Skip to content

Commit e3cd0d6

Browse files
committed
fix(deps): make pact-ffi optional in v1 releases for pact-ruby-standalone consumption
1 parent 0c525d2 commit e3cd0d6

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

Gemfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ if ENV['X_PACT_DEVELOPMENT']
1111
gem "pry-byebug"
1212
end
1313

14+
group :v2, optional: true do
15+
gem "pact-ffi", "~> 0.4.28"
16+
gem "ffi"
17+
end
18+
1419
group :local_development do
1520
gem "pry-byebug"
1621
end

documentation/README_V2.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,32 @@ The `pact-ruby-v1` is in maintenance mode, as there has been a transition to rus
2020
- Matchers - implementation of Pact matchers, which are convenient helpers used in consumer-DSL, encapsulating all the logic for serialization into Pact format
2121
- Mock servers - mock servers that allow for correct execution of provider tests
2222

23+
## Installation
24+
25+
The `pact/v2` namespace is available in `pact-ruby` v1.70.0.
26+
27+
It introduces a suite of new depedencies, including a reliance on the `pact-ffi` and `ffi` gems.
28+
29+
The native extensions are marked in an optional block, so they are opt in.
30+
31+
```rb
32+
gem "pact"
33+
gem "pact-ffi", "~> 0.4.28" # add this line, to use the pact/v2 namespace
34+
```
35+
36+
`pact-ffi` ships prebuilt binary gems, and does not support platforms outside of the released [pact_ffi](https://github.com/pact-foundation/pact-reference/tree/master/rust/pact_ffi) libraries
37+
38+
| Version | Platform |
39+
|-----------|----------------------|
40+
| 0.4.28.0 | x86_64-darwin |
41+
| 0.4.28.0 | arm64-darwin |
42+
| 0.4.28.0 | x86_64-linux |
43+
| 0.4.28.0 | aarch64-linux |
44+
| 0.4.28.0 | x86_64-linux-musl |
45+
| 0.4.28.0 | aarch64-linux-musl |
46+
| 0.4.28.0 | x64-mingw32 |
47+
| 0.4.28.0 | x64-mingw-ucrt |
48+
2349
## Usage
2450

2551
For each type of interaction (due to their specific features), a separate version of DSL has been implemented. However, the general principles remain the same for each type of interaction.

pact.gemspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ Gem::Specification.new do |gem|
3939
# Core dependencies (code loading)
4040
gem.add_dependency "zeitwerk", "~> 2.3"
4141
# For Pact support via Pact Rust Core
42-
gem.add_dependency "pact-ffi", "~> 0.4.28"
42+
# moved to optional group in Gemfile, to allow opt in for users who want Pact v2
43+
# and to support pact-ruby-standalone which cannot package the ffi for all supported platforms
44+
# gem.add_dependency "pact-ffi", "~> 0.4.28"
4345
# For Provider Side Verification
4446
gem.add_dependency "rack"
4547
gem.add_dependency "rack-proxy"

0 commit comments

Comments
 (0)