pact-ffi 0.0.3-x86_64-darwin → 0.4.22-x86_64-darwin
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/README.md +48 -21
- data/ffi/macos-x64/libpact_ffi.dylib +0 -0
- data/lib/pact/detect_os.rb +13 -12
- data/lib/pact/ffi/async_message_pact.rb +5 -3
- data/lib/pact/ffi/http_consumer.rb +8 -4
- data/lib/pact/ffi/logger.rb +5 -4
- data/lib/pact/ffi/{message_pact.rb → message_consumer.rb} +5 -3
- data/lib/pact/ffi/mock_server.rb +2 -1
- data/lib/pact/ffi/{plugins.rb → plugin_consumer.rb} +2 -1
- data/lib/pact/ffi/sync_http_consumer.rb +2 -1
- data/lib/pact/ffi/sync_message_consumer.rb +2 -1
- data/lib/pact/ffi/utils.rb +8 -1
- data/lib/pact/ffi/verifier.rb +3 -2
- data/lib/pact/ffi/version.rb +1 -1
- data/lib/pact/ffi.rb +14 -3
- metadata +38 -11
- data/lib/pact/fiddle.rb +0 -1292
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b04787fb0afd1b94d3a4504cd466cf576339d05e934f90b4c4cfc345eb160936
|
4
|
+
data.tar.gz: 325a03c13186c7a5c5cb01b3472ae85a205ddfb98408d5de58be8f5d68146306
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b4e9df6654c0d136d553265a4f4cf04b662f5235596969f0b1c860a5ceb5e82776e17cfc6a69c6ce31e9ac6a78e58a0d527d02388b7480c5857c5783357baed
|
7
|
+
data.tar.gz: de753ef9bd135774a81d3bda9338ac0063a2bbbd42caa8900ffa2385c3b4c4cabafe17f9e5374391aa73f254bc704943c95d60bd3e3b325ce6259358c42db420
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Ruby spike gem, to show interactions with the Pact Rust FFI methods.
|
4
4
|
|
5
|
-
Available on RubyGems - https://rubygems.org/gems/pact-ffi
|
5
|
+
Available on RubyGems - <https://rubygems.org/gems/pact-ffi>
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -14,16 +14,12 @@ gem 'pact-ffi'
|
|
14
14
|
|
15
15
|
And then execute:
|
16
16
|
|
17
|
-
|
18
17
|
bundle
|
19
18
|
|
20
|
-
|
21
19
|
Or install it yourself as:
|
22
|
-
|
23
20
|
|
24
21
|
gem install pact-ffi
|
25
22
|
|
26
|
-
|
27
23
|
## Usage
|
28
24
|
|
29
25
|
Simple
|
@@ -34,43 +30,42 @@ require 'pact/ffi'
|
|
34
30
|
puts PactFfi.pactffi_version
|
35
31
|
```
|
36
32
|
|
37
|
-
|
38
33
|
- See [`lib/pact/ffi.rb`](lib/pact/ffi.rb) for all available methods
|
39
34
|
- See [`spec`](spec) folder to see the tests, with the library in use
|
40
35
|
- See [`examples/area_calculator`](examples/area_calculator) folder for an example using a pact-plugin, to test the canonical area_calculator example
|
41
|
-
- Test it out in your browser, with our Killercoda example! https://killercoda.com/safdotdev/course/safacoda/grpc_plugins_quick_start_ruby
|
42
|
-
|
36
|
+
- Test it out in your browser, with our Killercoda example! <https://killercoda.com/safdotdev/course/safacoda/grpc_plugins_quick_start_ruby>
|
43
37
|
|
44
38
|
## Supported Platforms
|
45
39
|
|
46
40
|
- Ruby
|
47
|
-
- This gem is compatible with all the rubies, and various platforms, it comes pre-packaged with the pact_ffi binary for each platform.
|
41
|
+
- This gem is compatible with all the rubies, and various platforms, it comes pre-packaged with the pact_ffi binary for each platform.
|
48
42
|
|
49
|
-
| OS
|
50
|
-
| -------
|
51
|
-
| OSX
|
52
|
-
| OSX
|
53
|
-
| Linux
|
54
|
-
| Linux
|
55
|
-
|
|
43
|
+
| OS | Ruby | Architecture | Supported | Ruby Platform |
|
44
|
+
| ------- | ------- | ------------ | --------- | --------- |
|
45
|
+
| OSX | 2.6 - 3.3 | x86_64 | ✅ | x86_64-darwin |
|
46
|
+
| OSX | 2.6 - 3.3 | aarch64 (arm)| ✅ | arm64-darwin |
|
47
|
+
| Linux | 2.6 - 3.3 | x86_64 | ✅ | x86_64-linux |
|
48
|
+
| Linux | 2.6 - 3.3 | aarch64 (arm)| ✅ | aarch64-linux |
|
49
|
+
| Linux (musl) | 2.6 - 3.3 | x86_64 | ✅ | x86_64-linux-musl |
|
50
|
+
| Linux (musl) | 2.6 - 3.3 | aarch64 (arm)| ✅ | aarch64-linux-musl|
|
51
|
+
| Windows | 2.6 - 3.3 | x86_64 | ✅ | x64-mingw-ucrt |
|
56
52
|
|
57
53
|
You can checkout the ci tests, to see all the architectures, platforms and examples tested
|
58
54
|
|
59
|
-
- GitHub Actions https://github.com/YOU54F/pact-ruby-ffi/actions
|
60
|
-
- Cirrus CI https://cirrus-ci.com/github/YOU54F/pact-ruby-ffi/main
|
55
|
+
- GitHub Actions <https://github.com/YOU54F/pact-ruby-ffi/actions>
|
56
|
+
- Cirrus CI <https://cirrus-ci.com/github/YOU54F/pact-ruby-ffi/main>
|
61
57
|
|
62
58
|
_note_ - Alpine is currently not supported, but is on the list
|
63
59
|
|
64
60
|
- FFI libraries for your current platform - run `./script/download-libs.sh` to download
|
65
61
|
|
66
62
|
- If testing the protobuf plugin
|
67
|
-
- `
|
68
|
-
- See https://grpc.io/docs/languages/ruby/quickstart
|
63
|
+
- `3.0` for protobuf/grpc example
|
64
|
+
- See <https://grpc.io/docs/languages/ruby/quickstart/> for steps
|
69
65
|
- See `examples/proto-ruby/README.md` for notes
|
70
66
|
- ruby-grpc is not currently, on m1 hardware for the `pact-protobuf-plugin` example
|
71
67
|
- Have the pact-protobuf plugin available
|
72
68
|
- Run `pact-plugin-cli -y install https://github.com/pactflow/pact-protobuf-plugin/releases/latest`
|
73
|
-
|
74
69
|
|
75
70
|
## Development
|
76
71
|
|
@@ -89,3 +84,35 @@ The gem is available as open source under the terms of the [MIT License](http://
|
|
89
84
|
## Code of Conduct
|
90
85
|
|
91
86
|
Everyone interacting in the PactFfi project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/pact-ffi/blob/master/CODE_OF_CONDUCT.md).
|
87
|
+
|
88
|
+
## Pact Compatibility Suite
|
89
|
+
|
90
|
+
Help us implement the [Pact Compatibility Suite](https://github.com/pact-foundation/pact-compatibility-suite)
|
91
|
+
|
92
|
+
```
|
93
|
+
compatibility-suite/pact-compatibility-suite/features
|
94
|
+
├── V1
|
95
|
+
│ ├── http_consumer.feature
|
96
|
+
│ └── http_provider.feature
|
97
|
+
├── V2
|
98
|
+
│ ├── http_consumer.feature
|
99
|
+
│ └── http_provider.feature
|
100
|
+
├── V3
|
101
|
+
│ ├── generators.feature
|
102
|
+
│ ├── http_consumer.feature
|
103
|
+
│ ├── http_generators.feature
|
104
|
+
│ ├── http_matching.feature
|
105
|
+
│ ├── http_provider.feature
|
106
|
+
│ ├── matching_rules.feature
|
107
|
+
│ ├── message_consumer.feature
|
108
|
+
│ └── message_provider.feature
|
109
|
+
├── V4
|
110
|
+
│ ├── generators.feature
|
111
|
+
│ ├── http_consumer.feature ✅
|
112
|
+
│ ├── http_provider.feature
|
113
|
+
│ ├── matching_rules.feature
|
114
|
+
│ ├── message_consumer.feature ✅
|
115
|
+
│ ├── message_provider.feature ✅
|
116
|
+
│ ├── synchronous_message_consumer.feature ✅
|
117
|
+
│ └── v4.feature ✅
|
118
|
+
```
|
Binary file
|
data/lib/pact/detect_os.rb
CHANGED
@@ -1,43 +1,40 @@
|
|
1
1
|
module DetectOS
|
2
2
|
def self.windows?
|
3
3
|
return if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RbConfig::CONFIG['arch']).nil?
|
4
|
-
|
5
|
-
puts 'detected windows'
|
6
4
|
true
|
7
5
|
end
|
8
6
|
|
9
7
|
def self.mac_arm?
|
10
8
|
return unless !(/darwin/ =~ RbConfig::CONFIG['arch']).nil? && !(/arm64/ =~ RbConfig::CONFIG['arch']).nil?
|
11
|
-
|
12
|
-
puts 'detected macos arm'
|
13
9
|
true
|
14
10
|
end
|
15
11
|
|
16
12
|
def self.mac?
|
17
13
|
return unless !(/darwin/ =~ RbConfig::CONFIG['arch']).nil? && !(/x86_64/ =~ RbConfig::CONFIG['arch']).nil?
|
14
|
+
true
|
15
|
+
end
|
18
16
|
|
19
|
-
|
17
|
+
def self.linux_arm_musl?
|
18
|
+
return unless !(/linux/ =~ RbConfig::CONFIG['arch']).nil? && !(/aarch64/ =~ RbConfig::CONFIG['arch']).nil? && !(/musl/ =~ RbConfig::CONFIG['arch']).nil?
|
20
19
|
true
|
21
20
|
end
|
22
21
|
|
22
|
+
def self.linux_musl?
|
23
|
+
return unless !(/linux/ =~ RbConfig::CONFIG['arch']).nil? && !(/x86_64/ =~ RbConfig::CONFIG['arch']).nil?&& !(/musl/ =~ RbConfig::CONFIG['arch']).nil?
|
24
|
+
true
|
25
|
+
end
|
23
26
|
def self.linux_arm?
|
24
27
|
return unless !(/linux/ =~ RbConfig::CONFIG['arch']).nil? && !(/aarch64/ =~ RbConfig::CONFIG['arch']).nil?
|
25
|
-
|
26
|
-
puts 'detected linux aarch64'
|
27
28
|
true
|
28
29
|
end
|
29
30
|
|
30
31
|
def self.linux?
|
31
32
|
return unless !(/linux/ =~ RbConfig::CONFIG['arch']).nil? && !(/x86_64/ =~ RbConfig::CONFIG['arch']).nil?
|
32
|
-
|
33
|
-
puts 'detected linux'
|
34
33
|
true
|
35
34
|
end
|
36
35
|
|
37
36
|
def self.debug?
|
38
37
|
return if ENV['DEBUG_TARGET'].nil?
|
39
|
-
|
40
|
-
puts 'detected debug target' + ENV['DEBUG_TARGET']
|
41
38
|
true
|
42
39
|
end
|
43
40
|
|
@@ -50,6 +47,10 @@ module DetectOS
|
|
50
47
|
File.join(__dir__, '../../ffi/macos-arm64/libpact_ffi.dylib')
|
51
48
|
elsif mac?
|
52
49
|
File.join(__dir__, '../../ffi/macos-x64/libpact_ffi.dylib')
|
50
|
+
elsif linux_arm_musl?
|
51
|
+
File.join(__dir__, '../../ffi/linux-arm64-musl/libpact_ffi.so')
|
52
|
+
elsif linux_musl?
|
53
|
+
File.join(__dir__, '../../ffi/linux-x64-musl/libpact_ffi.so')
|
53
54
|
elsif linux_arm?
|
54
55
|
File.join(__dir__, '../../ffi/linux-arm64/libpact_ffi.so')
|
55
56
|
elsif linux?
|
@@ -76,4 +77,4 @@ module DetectOS
|
|
76
77
|
end
|
77
78
|
end
|
78
79
|
|
79
|
-
puts DetectOS.get_bin_path
|
80
|
+
ENV['PACT_DEBUG'] ? (puts "Detected platform: #{RbConfig::CONFIG['arch']} \nLoad Path: #{DetectOS.get_bin_path}" ): nil
|
@@ -7,9 +7,10 @@ module PactFfi
|
|
7
7
|
extend FFI::Library
|
8
8
|
ffi_lib DetectOS.get_bin_path
|
9
9
|
|
10
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
10
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
11
|
+
(typedef :uint32, :uint32_type)
|
11
12
|
|
12
|
-
attach_function :
|
13
|
+
attach_function :new_async_message, :pactffi_async_message_new, %i[], :pointer
|
13
14
|
attach_function :delete, :pactffi_async_message_delete, %i[pointer], :void
|
14
15
|
attach_function :get_contents, :pactffi_async_message_get_contents, %i[pointer], :pointer
|
15
16
|
attach_function :get_contents_str, :pactffi_async_message_get_contents_str, %i[pointer], :string
|
@@ -22,6 +23,7 @@ module PactFfi
|
|
22
23
|
attach_function :get_provider_state, :pactffi_async_message_get_provider_state, %i[pointer uint32_type], :pointer
|
23
24
|
attach_function :get_provider_state_iter, :pactffi_async_message_get_provider_state_iter, %i[pointer], :pointer
|
24
25
|
attach_function :new, :pactffi_new_async_message, %i[uint16 string], :uint32_type
|
25
|
-
attach_function :pact_interaction_as_asynchronous_message, :pactffi_pact_interaction_as_asynchronous_message,
|
26
|
+
attach_function :pact_interaction_as_asynchronous_message, :pactffi_pact_interaction_as_asynchronous_message,
|
27
|
+
%i[pointer], :pointer
|
26
28
|
end
|
27
29
|
end
|
@@ -7,7 +7,8 @@ module PactFfi
|
|
7
7
|
extend FFI::Library
|
8
8
|
ffi_lib DetectOS.get_bin_path
|
9
9
|
|
10
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
10
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
11
|
+
(typedef :uint32, :uint32_type)
|
11
12
|
|
12
13
|
attach_function :pact_interaction_iter_next, :pactffi_pact_interaction_iter_next, %i[pointer], :pointer
|
13
14
|
attach_function :pact_interaction_iter_delete, :pactffi_pact_interaction_iter_delete, %i[pointer], :void
|
@@ -16,7 +17,7 @@ module PactFfi
|
|
16
17
|
attach_function :upon_receiving, :pactffi_upon_receiving, %i[uint32_type string], :bool
|
17
18
|
attach_function :given, :pactffi_given, %i[uint32_type string], :bool
|
18
19
|
attach_function :given_with_param, :pactffi_given_with_param, %i[uint32_type string], :bool
|
19
|
-
attach_function :given_with_params, :pactffi_given_with_params, %i[
|
20
|
+
attach_function :given_with_params, :pactffi_given_with_params, %i[uint32_type string string], :int32
|
20
21
|
attach_function :interaction_test_name, :pactffi_interaction_test_name, %i[uint32_type string], :uint32_type
|
21
22
|
attach_function :given_with_param, :pactffi_given_with_param, %i[uint32_type string string string], :bool
|
22
23
|
attach_function :with_request, :pactffi_with_request, %i[uint32_type string string], :bool
|
@@ -30,7 +31,10 @@ module PactFfi
|
|
30
31
|
attach_function :response_status, :pactffi_response_status, %i[uint32_type uint16], :bool
|
31
32
|
attach_function :with_body, :pactffi_with_body, %i[uint32_type int32 string string], :bool
|
32
33
|
attach_function :with_binary_file, :pactffi_with_binary_file, %i[uint32_type int32 string pointer size_t], :bool
|
33
|
-
attach_function :with_multipart_file, :pactffi_with_multipart_file, %i[uint32_type int32 string string string],
|
34
|
-
|
34
|
+
attach_function :with_multipart_file, :pactffi_with_multipart_file, %i[uint32_type int32 string string string], :pointer
|
35
|
+
attach_function :set_header, :pactffi_set_header, %i[uint32_type int32 string string], :bool
|
36
|
+
attach_function :with_binary_body, :pactffi_with_binary_body, %i[uint32_type int32 string pointer size_t], :bool
|
37
|
+
attach_function :with_matching_rules, :pactffi_with_matching_rules, %i[uint32_type int32 string], :bool
|
38
|
+
attach_function :with_multipart_file_v2, :pactffi_with_multipart_file_v2, %i[uint32_type int32 string string string string], :pointer
|
35
39
|
end
|
36
40
|
end
|
data/lib/pact/ffi/logger.rb
CHANGED
@@ -7,7 +7,8 @@ module PactFfi
|
|
7
7
|
extend FFI::Library
|
8
8
|
ffi_lib DetectOS.get_bin_path
|
9
9
|
|
10
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
10
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
11
|
+
(typedef :uint32, :uint32_type)
|
11
12
|
|
12
13
|
LogLevel = Hash[
|
13
14
|
'OFF' => 0,
|
@@ -19,15 +20,15 @@ module PactFfi
|
|
19
20
|
]
|
20
21
|
|
21
22
|
attach_function :enable_ansi_support, :pactffi_enable_ansi_support, %i[], :void
|
22
|
-
attach_function :
|
23
|
+
attach_function :message, :pactffi_log_message, %i[string string string], :void
|
23
24
|
attach_function :get_error_message, :pactffi_get_error_message, %i[string int32], :int32
|
24
25
|
attach_function :log_to_stdout, :pactffi_log_to_stdout, %i[int32], :int32
|
25
26
|
attach_function :log_to_stderr, :pactffi_log_to_stderr, %i[int32], :int32
|
26
27
|
attach_function :log_to_file, :pactffi_log_to_file, %i[string int32], :int32
|
27
28
|
attach_function :log_to_buffer, :pactffi_log_to_buffer, %i[int32], :int32
|
28
|
-
attach_function :
|
29
|
+
attach_function :init, :pactffi_logger_init, %i[], :void
|
29
30
|
attach_function :attach_sink, :pactffi_logger_attach_sink, %i[string int32], :int32
|
30
|
-
attach_function :
|
31
|
+
attach_function :apply, :pactffi_logger_apply, %i[], :int32
|
31
32
|
attach_function :fetch_log_buffer, :pactffi_fetch_log_buffer, %i[string], :string
|
32
33
|
end
|
33
34
|
end
|
@@ -7,7 +7,8 @@ module PactFfi
|
|
7
7
|
extend FFI::Library
|
8
8
|
ffi_lib DetectOS.get_bin_path
|
9
9
|
|
10
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
10
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
11
|
+
(typedef :uint32, :uint32_type)
|
11
12
|
|
12
13
|
FfiSpecificationVersion = Hash[
|
13
14
|
'SPECIFICATION_VERSION_UNKNOWN' => 0,
|
@@ -71,7 +72,7 @@ module PactFfi
|
|
71
72
|
]
|
72
73
|
|
73
74
|
attach_function :contents_get_contents_str, :pactffi_message_contents_get_contents_str, %i[pointer], :string
|
74
|
-
attach_function :contents_set_contents_str
|
75
|
+
attach_function :contents_set_contents_str, :pactffi_message_contents_set_contents_str, %i[pointer string string], :void
|
75
76
|
attach_function :contents_get_contents_length, :pactffi_message_contents_get_contents_length, %i[pointer], :size_t
|
76
77
|
attach_function :contents_get_contents_bin, :pactffi_message_contents_get_contents_bin, %i[pointer], :pointer
|
77
78
|
attach_function :contents_set_contents_bin, :pactffi_message_contents_set_contents_bin, %i[pointer pointer size_t string], :void
|
@@ -118,10 +119,11 @@ module PactFfi
|
|
118
119
|
attach_function :given_with_param, :pactffi_message_given_with_param, %i[uint32_type string string string], :void
|
119
120
|
attach_function :with_contents, :pactffi_message_with_contents, %i[uint32_type string pointer size_t], :void
|
120
121
|
attach_function :with_metadata, :pactffi_message_with_metadata, %i[uint32_type string string], :void
|
121
|
-
attach_function :
|
122
|
+
attach_function :reify, :pactffi_message_reify, %i[uint32_type], :string
|
122
123
|
attach_function :write_message_pact_file, :pactffi_write_message_pact_file, %i[uint16 string bool], :int32
|
123
124
|
attach_function :with_message_pact_metadata, :pactffi_with_message_pact_metadata, %i[uint16 string string string], :void
|
124
125
|
attach_function :free_handle, :pactffi_free_message_pact_handle, %i[uint16], :uint32_type
|
125
126
|
attach_function :pact_handle_get_message_iter, :pactffi_pact_handle_get_message_iter, %i[uint16], :pointer
|
127
|
+
attach_function :with_metadata_v2, :pactffi_message_with_metadata_v2, %i[uint32_type string string], :void
|
126
128
|
end
|
127
129
|
end
|
data/lib/pact/ffi/mock_server.rb
CHANGED
@@ -7,7 +7,8 @@ module PactFfi
|
|
7
7
|
extend FFI::Library
|
8
8
|
ffi_lib DetectOS.get_bin_path
|
9
9
|
|
10
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
10
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
11
|
+
(typedef :uint32, :uint32_type)
|
11
12
|
|
12
13
|
FfiSpecificationVersion = Hash[
|
13
14
|
'SPECIFICATION_VERSION_UNKNOWN' => 0,
|
@@ -7,7 +7,8 @@ module PactFfi
|
|
7
7
|
extend FFI::Library
|
8
8
|
ffi_lib DetectOS.get_bin_path
|
9
9
|
|
10
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
10
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
11
|
+
(typedef :uint32, :uint32_type)
|
11
12
|
|
12
13
|
# /*
|
13
14
|
# -1 A null pointer was received
|
@@ -7,7 +7,8 @@ module PactFfi
|
|
7
7
|
extend FFI::Library
|
8
8
|
ffi_lib DetectOS.get_bin_path
|
9
9
|
|
10
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
10
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
11
|
+
(typedef :uint32, :uint32_type)
|
11
12
|
|
12
13
|
attach_function :new, :pactffi_sync_http_new, %i[], :pointer
|
13
14
|
attach_function :delete, :pactffi_sync_http_delete, %i[pointer], :void
|
@@ -7,7 +7,8 @@ module PactFfi
|
|
7
7
|
extend FFI::Library
|
8
8
|
ffi_lib DetectOS.get_bin_path
|
9
9
|
|
10
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
10
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
11
|
+
(typedef :uint32, :uint32_type)
|
11
12
|
|
12
13
|
attach_function :pact_interaction_as_synchronous_message, :pactffi_pact_interaction_as_synchronous_message, %i[pointer], :pointer
|
13
14
|
attach_function :iter_next, :pactffi_pact_sync_message_iter_next, %i[pointer], :pointer
|
data/lib/pact/ffi/utils.rb
CHANGED
@@ -7,7 +7,8 @@ module PactFfi
|
|
7
7
|
extend FFI::Library
|
8
8
|
ffi_lib DetectOS.get_bin_path
|
9
9
|
|
10
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
10
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
11
|
+
(typedef :uint32, :uint32_type)
|
11
12
|
FfiSpecificationVersion = Hash[
|
12
13
|
'SPECIFICATION_VERSION_UNKNOWN' => 0,
|
13
14
|
'SPECIFICATION_VERSION_V1' => 1,
|
@@ -69,6 +70,10 @@ module PactFfi
|
|
69
70
|
'RESULT_FAILED' => 1,
|
70
71
|
]
|
71
72
|
|
73
|
+
attach_function :add_text_comment, :pactffi_add_text_comment, %i[uint32_type string], :bool
|
74
|
+
attach_function :set_comment, :pactffi_set_comment, %i[uint32_type string string], :bool
|
75
|
+
attach_function :set_pending, :pactffi_set_pending, %i[uint32_type bool], :bool
|
76
|
+
attach_function :set_key, :pactffi_set_key, %i[uint32_type string], :bool
|
72
77
|
attach_function :match_message, :pactffi_match_message, %i[pointer pointer], :pointer
|
73
78
|
attach_function :mismatches_get_iter, :pactffi_mismatches_get_iter, %i[pointer], :pointer
|
74
79
|
attach_function :mismatches_delete, :pactffi_mismatches_delete, %i[pointer], :void
|
@@ -139,5 +144,7 @@ module PactFfi
|
|
139
144
|
attach_function :matches_binary_value, :pactffi_matches_binary_value,
|
140
145
|
%i[pointer pointer ulong_long pointer ulong_long uint8], :string
|
141
146
|
attach_function :matches_json_value, :pactffi_matches_json_value, %i[pointer string string uint8], :string
|
147
|
+
attach_function :pact_handle_to_pointer, :pactffi_pact_handle_to_pointer, %i[uint16], :pointer
|
148
|
+
attach_function :handle_get_pact_spec_version, :pactffi_handle_get_pact_spec_version, %i[uint16], :int32
|
142
149
|
end
|
143
150
|
end
|
data/lib/pact/ffi/verifier.rb
CHANGED
@@ -9,7 +9,8 @@ module PactFfi
|
|
9
9
|
module Verifier
|
10
10
|
extend FFI::Library
|
11
11
|
ffi_lib DetectOS.get_bin_path
|
12
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
12
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
13
|
+
(typedef :uint32, :uint32_type)
|
13
14
|
|
14
15
|
# /*
|
15
16
|
# * | Error | Description |
|
@@ -28,7 +29,7 @@ module PactFfi
|
|
28
29
|
]
|
29
30
|
|
30
31
|
attach_function :verify, :pactffi_verify, %i[string], :int32
|
31
|
-
attach_function :new, :
|
32
|
+
attach_function :new, :pactffi_verifier_new, %i[], :pointer
|
32
33
|
attach_function :new_for_application, :pactffi_verifier_new_for_application, %i[string string], :pointer
|
33
34
|
attach_function :shutdown, :pactffi_verifier_shutdown, %i[pointer], :void
|
34
35
|
attach_function :set_provider_info, :pactffi_verifier_set_provider_info,
|
data/lib/pact/ffi/version.rb
CHANGED
data/lib/pact/ffi.rb
CHANGED
@@ -8,8 +8,8 @@ module PactFfi
|
|
8
8
|
|
9
9
|
# at least neccessary on x64-mingw-ucrt as uint32_type is undefined
|
10
10
|
# also neccessary on linux aarch64 it seems
|
11
|
-
DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type)
|
12
|
-
|
11
|
+
# DetectOS.windows? || DetectOS.linux_arm? ? (typedef :uint32, :uint32_type) : (typedef :uint32_t, :uint32_type) (typedef :uint32, :uint32_type)
|
12
|
+
(typedef :uint32, :uint32_type)
|
13
13
|
FfiSpecificationVersion = Hash[
|
14
14
|
'SPECIFICATION_VERSION_UNKNOWN' => 0,
|
15
15
|
'SPECIFICATION_VERSION_V1' => 1,
|
@@ -306,7 +306,7 @@ module PactFfi
|
|
306
306
|
attach_function :upon_receiving, :pactffi_upon_receiving, %i[uint32_type string], :bool
|
307
307
|
attach_function :given, :pactffi_given, %i[uint32_type string], :bool
|
308
308
|
attach_function :given, :pactffi_given, %i[uint32_type string], :bool
|
309
|
-
attach_function :given_with_params, :pactffi_given_with_params, %i[
|
309
|
+
attach_function :given_with_params, :pactffi_given_with_params, %i[uint32_type string string], :int32
|
310
310
|
attach_function :interaction_test_name, :pactffi_interaction_test_name, %i[uint32_type string], :uint32_type
|
311
311
|
attach_function :given_with_param, :pactffi_given_with_param, %i[uint32_type string string string], :bool
|
312
312
|
attach_function :with_request, :pactffi_with_request, %i[uint32_type string string], :bool
|
@@ -330,6 +330,8 @@ module PactFfi
|
|
330
330
|
attach_function :message_given_with_param, :pactffi_message_given_with_param, %i[uint32_type string string string], :void
|
331
331
|
attach_function :message_with_contents, :pactffi_message_with_contents, %i[uint32_type string pointer size_t], :void
|
332
332
|
attach_function :message_with_metadata, :pactffi_message_with_metadata, %i[uint32_type string string], :void
|
333
|
+
attach_function :message_with_metadata_v2, :pactffi_message_with_metadata_v2, %i[uint32_type string string], :void
|
334
|
+
attach_function :with_metadata, :pactffi_with_metadata, %i[uint32_type string string int], :void
|
333
335
|
attach_function :message_reify, :pactffi_message_reify, %i[uint32_type], :string
|
334
336
|
attach_function :write_message_pact_file, :pactffi_write_message_pact_file, %i[uint16 string bool], :int32
|
335
337
|
attach_function :with_message_pact_metadata, :pactffi_with_message_pact_metadata, %i[uint16 string string string], :void
|
@@ -372,4 +374,13 @@ module PactFfi
|
|
372
374
|
attach_function :matches_bool_value, :pactffi_matches_bool_value, %i[pointer uint8 uint8 uint8], :string
|
373
375
|
attach_function :matches_binary_value, :pactffi_matches_binary_value, %i[pointer pointer ulong_long pointer ulong_long uint8], :string
|
374
376
|
attach_function :matches_json_value, :pactffi_matches_json_value, %i[pointer string string uint8], :string
|
377
|
+
attach_function :pact_handle_to_pointer, :pactffi_pact_handle_to_pointer, %i[uint16], :pointer
|
378
|
+
attach_function :handle_get_pact_spec_version, :pactffi_handle_get_pact_spec_version, %i[uint16], :int32
|
379
|
+
attach_function :with_multipart_file, :pactffi_with_multipart_file, %i[uint32_type int32 string string string], :pointer
|
380
|
+
attach_function :set_header, :pactffi_set_header, %i[uint32_type int32 string string], :bool
|
381
|
+
attach_function :with_binary_body, :pactffi_with_binary_body, %i[uint32_type int32 string pointer size_t], :bool
|
382
|
+
attach_function :with_matching_rules, :pactffi_with_matching_rules, %i[uint32_type int32 string], :bool
|
383
|
+
attach_function :with_multipart_file_v2, :pactffi_with_multipart_file_v2, %i[uint32_type int32 string string string string], :pointer
|
384
|
+
attach_function :message_with_metadata_v2, :pactffi_message_with_metadata_v2, %i[uint32_type string string], :void
|
385
|
+
attach_function :with_generators, :pactffi_with_generators, %i[uint32_type int string], :bool
|
375
386
|
end
|
metadata
CHANGED
@@ -1,43 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact-ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.22
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- Yousaf Nabi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: cucumber
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '2
|
19
|
+
version: '9.2'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '2
|
26
|
+
version: '9.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: httparty
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.21.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.21.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: nokogiri
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.16'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.16'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: rake
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +80,20 @@ dependencies:
|
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: webrick
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.8'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.8'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: ffi
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -99,15 +127,14 @@ files:
|
|
99
127
|
- lib/pact/ffi/async_message_pact.rb
|
100
128
|
- lib/pact/ffi/http_consumer.rb
|
101
129
|
- lib/pact/ffi/logger.rb
|
102
|
-
- lib/pact/ffi/
|
130
|
+
- lib/pact/ffi/message_consumer.rb
|
103
131
|
- lib/pact/ffi/mock_server.rb
|
104
|
-
- lib/pact/ffi/
|
132
|
+
- lib/pact/ffi/plugin_consumer.rb
|
105
133
|
- lib/pact/ffi/sync_http_consumer.rb
|
106
134
|
- lib/pact/ffi/sync_message_consumer.rb
|
107
135
|
- lib/pact/ffi/utils.rb
|
108
136
|
- lib/pact/ffi/verifier.rb
|
109
137
|
- lib/pact/ffi/version.rb
|
110
|
-
- lib/pact/fiddle.rb
|
111
138
|
homepage: https://github.com/you54f/pact-ffi
|
112
139
|
licenses:
|
113
140
|
- MIT
|
@@ -127,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
154
|
- !ruby/object:Gem::Version
|
128
155
|
version: '0'
|
129
156
|
requirements: []
|
130
|
-
rubygems_version: 3.
|
157
|
+
rubygems_version: 3.5.11
|
131
158
|
signing_key:
|
132
159
|
specification_version: 4
|
133
160
|
summary: Pact Reference FFI libpact_ffi library wrapper
|