repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/animal-service-v2/lib/animal_service/animal_repository.rb
example/animal-service-v2/lib/animal_service/animal_repository.rb
require 'sequel' require_relative 'db' module AnimalService class AnimalRepository def self.find_alligator_by_name name DATABASE[:animals].where(name: name).single_record end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/animal-service-v2/lib/animal_service/api.rb
example/animal-service-v2/lib/animal_service/api.rb
require 'sinatra/base' require_relative 'animal_repository' require 'json' module AnimalService class Api < Sinatra::Base set :raise_errors, false set :show_exceptions, false error do e = env['sinatra.error'] content_type :json, :charset => 'utf-8' status 500 {error: e.message,...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app/spec/spec_helper.rb
example/zoo-app/spec/spec_helper.rb
$: << File.expand_path("../../lib", __FILE__) RSpec.configure do | config | config.color = true config.formatter = :documentation end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app/spec/service_providers/pact_helper.rb
example/zoo-app/spec/service_providers/pact_helper.rb
require_relative '../spec_helper' require 'pact/consumer/rspec' Pact.configure do | config | config.doc_generator = :markdown end Pact.service_consumer 'Zoo App' do has_pact_with "Animal Service" do mock_service :animal_service do port 8888 pact_specification_version "2.0.0" end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app/spec/service_providers/animal_service_client_spec.rb
example/zoo-app/spec/service_providers/animal_service_client_spec.rb
require_relative 'pact_helper' require 'zoo_app/animal_service_client' module ZooApp describe AnimalServiceClient, :pact => true do before do AnimalServiceClient.base_uri animal_service.mock_service_base_url end describe ".find_alligator_by_name" do context "when an alligator by the given n...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app/lib/zoo_app/version.rb
example/zoo-app/lib/zoo_app/version.rb
module ZooApp VERSION = '1.0.0' end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app/lib/zoo_app/animal_service_client.rb
example/zoo-app/lib/zoo_app/animal_service_client.rb
require 'httparty' require 'zoo_app/models/alligator' module ZooApp class AnimalServiceClient include HTTParty base_uri 'animal-service.com' def self.find_alligator_by_name name response = get("/alligators/#{name}", :headers => {'Accept' => 'application/json'}) when_successful(response) do ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/example/zoo-app/lib/zoo_app/models/alligator.rb
example/zoo-app/lib/zoo_app/models/alligator.rb
module ZooApp module Animals class Alligator attr_reader :name def initialize attributes @name = attributes[:name] end def == other other.is_a?(Alligator) && other.name == self.name end end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact.rb
lib/pact.rb
require 'pact/support' require 'pact/version' require 'pact/configuration' require 'pact/consumer' require 'pact/provider' require 'pact/consumer_contract' begin require 'pact/v2' rescue LoadError => e warn "Warning: Could not load 'pact/v2': #{e.message} \nPlease ensure that the 'pact-ffi' gem is included in your...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider.rb
lib/pact/provider.rb
require 'pact/configuration' require 'pact/provider/configuration' require 'pact/provider/world'
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/version.rb
lib/pact/version.rb
# Remember to bump pact-provider-proxy when this changes major version module Pact VERSION = "1.67.3" end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/pact_broker.rb
lib/pact/pact_broker.rb
require 'pact/pact_broker/fetch_pacts' require 'pact/pact_broker/fetch_pact_uris_for_verification' require 'pact/provider/pact_uri' # # @public Used by Pact Provider Verifier # module Pact module PactBroker extend self # Keep for backwards compatibility with pact-provider-verifier < 1.23.1 def fetch_pac...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/retry.rb
lib/pact/retry.rb
require 'pact/errors' module Pact class Retry class RescuableError UNRESCUEABLE = [Pact::Error] def self.===(e) case e when *UNRESCUEABLE then false else true end end end def self.until_true options = {} max_tries = opt...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/consumer.rb
lib/pact/consumer.rb
require 'pact/consumer_contract' require 'pact/consumer/configuration' require 'pact/consumer/consumer_contract_builder' require 'pact/consumer/consumer_contract_builders' require 'pact/consumer/interaction_builder' require 'pact/term' require 'pact/something_like'
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2.rb
lib/pact/v2.rb
# frozen_string_literal: true require "zeitwerk" require "pact/ffi" require "pact/v2/railtie" if defined?(Rails::Railtie) module Pact module V2 class Error < StandardError; end class ImplementationRequired < Error; end class FfiError < Error def initialize(msg, reason, status) super(msg...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/cli.rb
lib/pact/cli.rb
require 'thor' require 'pact/consumer/configuration' require 'pact/provider/configuration' module Pact class CLI < Thor def self.exit_on_failure? # Thor 1.0 deprecation guard false end desc 'verify', "Verify a pact" method_option :pact_helper, aliases: "-h", desc: "Pact helper file", :required...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/tasks.rb
lib/pact/tasks.rb
load File.expand_path('../tasks/pact.rake', File.dirname(__FILE__)) require 'pact/tasks/verification_task'
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/hash_refinements.rb
lib/pact/hash_refinements.rb
module Pact module HashRefinements refine Hash do def compact h = {} each do |key, value| h[key] = value unless value == nil end h end unless Hash.method_defined? :compact def compact! reject! {|_key, value| value == nil} end unless Hash.m...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/project_root.rb
lib/pact/project_root.rb
require 'pathname' module Pact def self.project_root @project_root ||= Pathname.new(File.expand_path('../../../',__FILE__)).freeze end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/tasks/verification_task.rb
lib/pact/tasks/verification_task.rb
require 'rake/tasklib' =begin To create a rake pact:verify:<something> task Pact::VerificationTask.new(:head) do | pact | pact.uri 'http://master.cd.vpc.realestate.com.au/browse/BIQ-MAS/latestSuccessful/artifact/JOB2/Pacts/mas-contract_transaction_service.json' pact.uri 'http://master.cd.vpc.realestate.c...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/tasks/task_helper.rb
lib/pact/tasks/task_helper.rb
require 'pact/configuration' require 'pact/provider/pact_helper_locator' require 'rake/file_utils' require 'shellwords' module Pact module TaskHelper PACT_INTERACTION_RERUN_COMMAND = "bundle exec rake pact:verify:at[<PACT_URI>] PACT_DESCRIPTION=\"<PACT_DESCRIPTION>\" PACT_PROVIDER_STATE=\"<PACT_PROVIDER_STATE>\...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/hal/entity.rb
lib/pact/hal/entity.rb
require 'uri' require 'delegate' require 'pact/hal/link' require 'pact/errors' module Pact module Hal class RelationNotFoundError < ::Pact::Error; end class ErrorResponseReturned < ::Pact::Error; end class Entity def initialize(href, data, http_client, response = nil) @href = href ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/hal/non_json_entity.rb
lib/pact/hal/non_json_entity.rb
module Pact module Hal class NonJsonEntity def initialize(href, body, http_client, response = nil) @href = href @body = body @client = http_client @response = response end def success? true end def response @response end ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/hal/link.rb
lib/pact/hal/link.rb
require 'erb' require 'delegate' module Pact module Hal class Link attr_reader :request_method, :href DEFAULT_GET_HEADERS = { "Accept" => "application/hal+json" }.freeze DEFAULT_POST_HEADERS = { "Accept" => "application/hal+json", "Content-Type" => "application/j...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/hal/http_client.rb
lib/pact/hal/http_client.rb
require 'pact/retry' require 'pact/hal/authorization_header_redactor' require 'net/http' require 'rack' require 'openssl' module Pact module Hal class HttpClient attr_accessor :username, :password, :verbose, :token def initialize options @username = options[:username] @password = opt...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/hal/authorization_header_redactor.rb
lib/pact/hal/authorization_header_redactor.rb
require 'delegate' module Pact module Hal class AuthorizationHeaderRedactor < SimpleDelegator def puts(*args) __getobj__().puts(*redact_args(args)) end def print(*args) __getobj__().puts(*redact_args(args)) end def <<(*args) __getobj__().send(:<<, *redact_a...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/pact_broker/notices.rb
lib/pact/pact_broker/notices.rb
module Pact module PactBroker class Notices < Array def before_verification_notices select { | notice | notice[:when].nil? || notice[:when].start_with?('before_verification') } end def before_verification_notices_text before_verification_notices.collect{ | notice | notice[:text]...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/pact_broker/pact_selection_description.rb
lib/pact/pact_broker/pact_selection_description.rb
module Pact module PactBroker module PactSelectionDescription def pact_selection_description(provider, consumer_version_selectors, options, broker_base_url) message = "Fetching pacts for #{provider} from #{broker_base_url} with the selection criteria: " if consumer_version_selectors.any? ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/pact_broker/fetch_pacts.rb
lib/pact/pact_broker/fetch_pacts.rb
require 'pact/hal/entity' require 'pact/hal/http_client' require 'pact/provider/pact_uri' require 'pact/errors' module Pact module PactBroker class FetchPacts attr_reader :provider, :tags, :broker_base_url, :http_client_options, :http_client, :index_entity ALL_PROVIDER_TAG_RELATION = 'pb:provider-pa...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/pact_broker/fetch_pact_uris_for_verification.rb
lib/pact/pact_broker/fetch_pact_uris_for_verification.rb
require 'pact/hal/entity' require 'pact/hal/http_client' require 'pact/provider/pact_uri' require 'pact/errors' require 'pact/pact_broker/fetch_pacts' require 'pact/pact_broker/notices' require 'pact/pact_broker/pact_selection_description' require "pact/hash_refinements" module Pact module PactBroker class Fetch...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/utils/string.rb
lib/pact/utils/string.rb
# Can't use refinements because of Travelling Ruby module Pact module Utils module String extend self # ripped from rubyworks/facets, thank you def camelcase(string, *separators) case separators.first when Symbol, TrueClass, FalseClass, NilClass first_letter = separa...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/utils/metrics.rb
lib/pact/utils/metrics.rb
require 'securerandom' require 'digest' require 'socket' require 'pact/version' require 'net/http' module Pact module Utils class Metrics def self.report_metric(event, category, action, value = 1) do_once_per_thread(:pact_metrics_message_shown) do if track_events? Pact.config...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/print_missing_provider_states.rb
lib/pact/provider/print_missing_provider_states.rb
require 'rainbow' module Pact module Provider class PrintMissingProviderStates # Hash of consumer names to array of names of missing provider states def self.call missing_provider_states, output if missing_provider_states.any? output.puts colorize(text(missing_provider_states)) ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/pact_spec_runner.rb
lib/pact/provider/pact_spec_runner.rb
require 'open-uri' require 'rspec' require 'rspec/core' require 'rspec/core/formatters/documentation_formatter' require 'pact/provider/pact_helper_locator' require 'pact/project_root' require 'pact/rspec' require 'pact/provider/pact_source' require 'pact/provider/help/write' require 'pact/provider/verification_results/...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/world.rb
lib/pact/provider/world.rb
require 'pact/provider/state/provider_state_proxy' module Pact def self.provider_world @world ||= Pact::Provider::World.new end # internal api, for testing only def self.clear_provider_world @world = nil end module Provider class World attr_accessor :pact_sources, :failed_examples, :v...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/test_methods.rb
lib/pact/provider/test_methods.rb
require 'pact/logging' require 'rack/test' require 'pact/consumer_contract/interaction' require 'pact/provider/state/provider_state' require 'pact/provider/state/provider_state_proxy' require 'pact/provider/request' require 'pact/provider/world' require 'pact/provider/state/provider_state_manager' module Pact module...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/pact_uri.rb
lib/pact/provider/pact_uri.rb
module Pact module Provider class PactURI attr_reader :uri, :options, :metadata def initialize(uri, options = nil, metadata = nil) @uri = uri @options = options || {} @metadata = metadata || {} # make sure it's not nil if nil is passed in end def == other ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/configuration.rb
lib/pact/provider/configuration.rb
require 'pact/provider/configuration/dsl' require 'pact/provider/configuration/configuration_extension' require 'pact/provider/state/provider_state' Pact.send(:extend, Pact::Provider::DSL) Pact.send(:extend, Pact::Provider::State::DSL) Pact::Configuration.send(:include, Pact::Provider::Configuration::ConfigurationExte...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/pact_source.rb
lib/pact/provider/pact_source.rb
require 'pact/consumer_contract/pact_file' require 'pact/hal/http_client' require 'pact/hal/entity' require 'pact/consumer_contract' module Pact module Provider class PactSource attr_reader :uri # PactURI class def initialize uri @uri = uri end def pact_json @pact_json ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/pact_verification.rb
lib/pact/provider/pact_verification.rb
module Pact::Provider class PactVerification attr_reader :consumer_name, :uri, :ref def initialize consumer_name, uri, ref @consumer_name = consumer_name @uri = uri @ref = ref end def == other other.is_a?(PactVerification) && consumer_name == other.consumer_name && ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/rspec.rb
lib/pact/provider/rspec.rb
require 'open-uri' require 'pact/consumer_contract' require 'pact/provider/rspec/matchers' require 'pact/provider/test_methods' require 'pact/provider/configuration' require 'pact/provider/matchers/messages' module Pact module Provider module RSpec module InstanceMethods def app Pact.co...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/verification_report.rb
lib/pact/provider/verification_report.rb
require 'pact/consumer_contract' module Pact::Provider class VerificationReport include Pact::FileName def initialize (options) @consumer = options[:consumer] @provider = options[:provider] @result = options[:result] @output = options[:output] end def to_hash { ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/request.rb
lib/pact/provider/request.rb
require 'json' require 'pact/reification' require 'pact/shared/null_expectation' require 'pact/generators' module Pact module Provider module Request class Replayable # See https://github.com/rack/rack/blob/e7d741c6282ca4cf4e01506f5681e6e6b14c0b32/SPEC#L87-89 NO_HTTP_PREFIX = ["CONTENT-TYP...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/context.rb
lib/pact/provider/context.rb
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/pact_helper_locator.rb
lib/pact/provider/pact_helper_locator.rb
module Pact module Provider module PactHelperLocater PACT_HELPER_FILE_PATTERNS = [ "spec/**/*service*consumer*/pact_helper.rb", "spec/**/*consumer*/pact_helper.rb", "spec/**/pact_helper.rb", "test/**/*service*consumer*/pact_helper.rb", "test/**/*consumer*/pact_helper....
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/rspec/matchers.rb
lib/pact/provider/rspec/matchers.rb
require 'rspec' require 'pact/matchers' require 'pact/provider/matchers/messages' require 'pact/rspec' require 'pact/shared/json_differ' module Pact module RSpec module Matchers module RSpec2Delegator # For backwards compatibility with rspec-2 def method_missing(method, *args, &block) ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/rspec/json_formatter.rb
lib/pact/provider/rspec/json_formatter.rb
require 'rspec/core/formatters/json_formatter' module Pact module Provider module RSpec class JsonFormatter < ::RSpec::Core::Formatters::JsonFormatter ::RSpec::Core::Formatters.register self, :message, :dump_summary, :dump_profile, :stop, :seed, :close def dump_summary(summary) s...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/rspec/pact_broker_formatter.rb
lib/pact/provider/rspec/pact_broker_formatter.rb
require 'rspec/core/formatters' require 'pact/provider/verification_results/publish_all' require 'rainbow' require 'pact/matchers/extract_diff_messages' module Pact module Provider module RSpec class PactBrokerFormatter < ::RSpec::Core::Formatters::BaseFormatter Pact::RSpec.with_rspec_3 do ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/rspec/backtrace_formatter.rb
lib/pact/provider/rspec/backtrace_formatter.rb
module RSpec module Core # RSpec 3 has a hardwired @system_exclusion_patterns which removes everything matching /bin\// # This causes *all* the backtrace lines to be cleaned, as rake pact:verify now shells out # to the executable `pact verify ...` # which then causes *all* the lines to be included as...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/rspec/formatter_rspec_3.rb
lib/pact/provider/rspec/formatter_rspec_3.rb
require 'pact/provider/print_missing_provider_states' require 'rspec/core/formatters' require 'rainbow' require 'pact/provider/help/prompt_text' module Pact module Provider module RSpec class Formatter < ::RSpec::Core::Formatters::DocumentationFormatter class NilFormatter < ::RSpec::Core::Formatte...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/rspec/calculate_exit_code.rb
lib/pact/provider/rspec/calculate_exit_code.rb
module Pact module Provider module RSpec module CalculateExitCode def self.call(pact_sources, failed_examples) any_non_pending_failures = pact_sources.any? do |pact_source| if pact_source.pending? nil else failed_examples.select { |e| e.m...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/rspec/formatter_rspec_2.rb
lib/pact/provider/rspec/formatter_rspec_2.rb
require 'pact/provider/print_missing_provider_states' require 'rspec/core/formatters/documentation_formatter' require 'rainbow' require 'pact/provider/help/prompt_text' module Pact module Provider module RSpec class Formatter2 < ::RSpec::Core::Formatters::DocumentationFormatter class NilFormatter ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/verification_results/publish.rb
lib/pact/provider/verification_results/publish.rb
require 'json' require 'pact/errors' require 'pact/retry' require 'pact/hal/entity' require 'pact/hal/http_client' # TODO move this to the pact broker client module Pact module Provider module VerificationResults class PublicationError < Pact::Error; end class Publish PUBLISH_RELATION = 'p...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/verification_results/verification_result.rb
lib/pact/provider/verification_results/verification_result.rb
require 'json' module Pact module Provider module VerificationResults class VerificationResult attr_reader :success, :provider_application_version, :test_results_hash def initialize publishable, success, provider_application_version, test_results_hash, build_url @publishable = pu...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/verification_results/create.rb
lib/pact/provider/verification_results/create.rb
require 'pact/provider/verification_results/verification_result' module Pact module Provider module VerificationResults class Create def self.call pact_source, test_results_hash new(pact_source, test_results_hash).call end def initialize pact_source, test_results_hash ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/verification_results/publish_all.rb
lib/pact/provider/verification_results/publish_all.rb
require'pact/provider/verification_results/create' require'pact/provider/verification_results/publish' module Pact module Provider module VerificationResults class PublishAll def self.call pact_sources, test_results_hash, options = {} new(pact_sources, test_results_hash, options).call ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/state/tear_down.rb
lib/pact/provider/state/tear_down.rb
require 'pact/provider/state/provider_state_manager' module Pact module Provider module State class TearDown def self.call provider_state_name, consumer, options = {} State::ProviderStateManager.new(provider_state_name, options[:params], consumer).tear_down_provider_state end ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/state/provider_state_proxy.rb
lib/pact/provider/state/provider_state_proxy.rb
module Pact module Provider::State class ProviderStateProxy attr_reader :missing_provider_states def initialize @missing_provider_states = {} end def get name, options = {} unless provider_state = ProviderStates.get(name, options) register_missing_provider_stat...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/state/set_up.rb
lib/pact/provider/state/set_up.rb
require 'pact/provider/state/provider_state_manager' module Pact module Provider module State class SetUp def self.call provider_state_name, consumer, options = {} State::ProviderStateManager.new(provider_state_name, options[:params], consumer).set_up_provider_state end end ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/state/provider_state_configured_modules.rb
lib/pact/provider/state/provider_state_configured_modules.rb
require 'rspec/mocks' module Pact module Provider module State module ProviderStateConfiguredModules include ::RSpec::Mocks::ExampleMethods # Placeholder for modules configured using config.include end end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/state/provider_state_manager.rb
lib/pact/provider/state/provider_state_manager.rb
module Pact module Provider::State class ProviderStateManager attr_reader :provider_state_name, :params, :consumer def initialize provider_state_name, params, consumer @provider_state_name = provider_state_name @params = params @consumer = consumer end def set_up...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/state/provider_state.rb
lib/pact/provider/state/provider_state.rb
require 'pact/shared/dsl' require 'pact/provider/state/provider_state_configured_modules' module Pact module Provider::State BASE_PROVIDER_STATE_NAME = "__base_provider_state__" module DSL def provider_state name, &block ProviderStates.provider_state(name, &block).register end de...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/help/pact_diff.rb
lib/pact/provider/help/pact_diff.rb
require 'pact/hal/entity' module Pact module Provider module Help class PactDiff class PrintPactDiffError < StandardError; end attr_reader :pact_source, :output def initialize pact_source @pact_source = pact_source end def self.call pact_source ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/help/prompt_text.rb
lib/pact/provider/help/prompt_text.rb
require 'pact/consumer/configuration' require 'rainbow' require 'pathname' module Pact module Provider module Help class PromptText def self.call reports_dir = Pact.configuration.reports_dir, options = {color: Pact.configuration.color_enabled} new(reports_dir, options).call end ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/help/content.rb
lib/pact/provider/help/content.rb
require 'pact/provider/help/pact_diff' module Pact module Provider module Help class Content def initialize pact_sources @pact_sources = pact_sources end def text help_text + "\n\n" + pact_diffs end private attr_reader :pact_sources ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/help/write.rb
lib/pact/provider/help/write.rb
require 'pact/provider/help/content' require 'fileutils' require 'pact/consumer/configuration' module Pact module Provider module Help class Write HELP_FILE_NAME = 'help.md' def self.call pact_sources, reports_dir = Pact.configuration.reports_dir new(pact_sources, reports_dir).c...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/help/console_text.rb
lib/pact/provider/help/console_text.rb
require 'pact/provider/help/content' require 'fileutils' require 'pact/consumer/configuration' require 'pact/provider/help/write' require 'rainbow' module Pact module Provider module Help class ConsoleText def self.call reports_dir = Pact.configuration.reports_dir, options = {color: true} ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/configuration/configuration_extension.rb
lib/pact/provider/configuration/configuration_extension.rb
require 'pact/provider/state/provider_state' require 'pact/provider/state/provider_state_configured_modules' require 'pact/provider/state/set_up' require 'pact/provider/state/tear_down' module Pact module Provider module Configuration module ConfigurationExtension attr_accessor :provider_applic...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/configuration/pact_verification_from_broker.rb
lib/pact/provider/configuration/pact_verification_from_broker.rb
require 'pact/shared/dsl' require 'pact/provider/world' require 'pact/pact_broker/fetch_pact_uris_for_verification' require 'pact/errors' require 'pact/utils/string' module Pact module Provider module Configuration class PactVerificationFromBroker extend Pact::DSL # If user declares a var...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/configuration/dsl.rb
lib/pact/provider/configuration/dsl.rb
require 'pact/provider/configuration/service_provider_dsl' require 'pact/provider/configuration/message_provider_dsl' module Pact module Provider module DSL def service_provider name, &block Configuration::ServiceProviderDSL.build(name, &block) end def message_provider name, &block ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/configuration/message_provider_dsl.rb
lib/pact/provider/configuration/message_provider_dsl.rb
require 'pact/provider/configuration/service_provider_dsl' module Pact module Provider module Configuration class MessageProviderDSL < ServiceProviderDSL class RackToMessageAdapter def initialize(message_builder) @message_builder = message_builder end def ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/configuration/pact_verification.rb
lib/pact/provider/configuration/pact_verification.rb
require 'pact/provider/pact_verification' require 'pact/provider/pact_uri' require 'pact/shared/dsl' require 'pact/provider/world' module Pact module Provider module Configuration class PactVerification extend Pact::DSL attr_accessor :consumer_name, :pact_uri, :ref def initiali...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/configuration/service_provider_dsl.rb
lib/pact/provider/configuration/service_provider_dsl.rb
require 'pact/provider/configuration/pact_verification' require 'pact/provider/configuration/pact_verification_from_broker' require 'pact/provider/configuration/service_provider_config' require 'pact/errors' module Pact module Provider module Configuration class Error < ::Pact::Error; end class S...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/configuration/service_provider_config.rb
lib/pact/provider/configuration/service_provider_config.rb
module Pact module Provider module Configuration class ServiceProviderConfig attr_accessor :application_version attr_reader :branch, :build_url def initialize application_version, branch, tags, publish_verification_results, build_url, &app_block @application_version = app...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/provider/matchers/messages.rb
lib/pact/provider/matchers/messages.rb
require 'rainbow' require 'pact/term' module Pact module Matchers module Messages def match_term_failure_message diff, actual, diff_formatter, color_enabled actual_string = String === actual ? actual : actual.to_json maybe_coloured_string = color_enabled ? Rainbow(actual_string).white : ac...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider.rb
lib/pact/v2/provider.rb
# frozen_string_literal: true module Pact module V2 module Provider end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/matchers.rb
lib/pact/v2/matchers.rb
# frozen_string_literal: true module Pact module V2 module Matchers PACT_SPEC_V1 = 1 PACT_SPEC_V2 = 2 PACT_SPEC_V3 = 3 PACT_SPEC_V4 = 4 ANY_STRING_REGEX = /.*/ UUID_REGEX = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i # simplified ISO8601_REGEX...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/generators.rb
lib/pact/v2/generators.rb
# frozen_string_literal: true module Pact module V2 module Generators def generate_random_int(min:, max:) Pact::V2::Generators::RandomIntGenerator.new(min: min, max: max) end def generate_random_decimal(digits:) Pact::V2::Generators::RandomDecimalGenerator.new(digits: digits) ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/railtie.rb
lib/pact/v2/railtie.rb
# frozen_string_literal: true require "rails/railtie" module Pact module V2 class Railtie < Rails::Railtie rake_tasks do load "pact/v2/tasks/pact.rake" end end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/configuration.rb
lib/pact/v2/configuration.rb
# frozen_string_literal: true module Pact module V2 class Configuration attr_reader :before_provider_state_proc, :after_provider_state_proc class GlobalProviderConfigurationError < ::Pact::V2::Error; end def before_provider_state_setup(&block) raise GlobalProviderConfigurationError, "...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/consumer.rb
lib/pact/v2/consumer.rb
# frozen_string_literal: true module Pact module V2 module Consumer end end end
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/rspec.rb
lib/pact/v2/rspec.rb
# frozen_string_literal: true require "rspec" require_relative "rspec/support/pact_consumer_helpers" require_relative "rspec/support/pact_provider_helpers" RSpec.configure do |config| config.define_derived_metadata(file_path: %r{spec/pact/}) { |metadata| metadata[:pact] = true } # it's not an error: consumer tes...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/rspec/support/pact_provider_helpers.rb
lib/pact/v2/rspec/support/pact_provider_helpers.rb
# frozen_string_literal: true require_relative "pact_message_helpers" require_relative "webmock/webmock_helpers" module PactV2ProducerDsl module ClassMethods PACT_PROVIDER_NOT_DECLARED_MESSAGE = "http_pact_provider or grpc_pact_provider should be declared first" def http_pact_provider(provider, opts: {}) ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/rspec/support/pact_consumer_helpers.rb
lib/pact/v2/rspec/support/pact_consumer_helpers.rb
# frozen_string_literal: true require_relative "pact_message_helpers" require "json" module PactV2ConsumerDsl include Pact::V2::Matchers include Pact::V2::Generators module ClassMethods def has_http_pact_between(consumer, provider, opts: {}) _has_pact_between(:http, consumer, provider, opts: opts) ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/rspec/support/pact_message_helpers.rb
lib/pact/v2/rspec/support/pact_message_helpers.rb
# frozen_string_literal: true require_relative "waterdrop/pact_waterdrop_client" module PactMessageHelpers module ProviderHelpers def with_pact_producer client = PactWaterdropClient.new yield(client) client.to_pact end def produce_outbox_item(item) raise "Please require sbmt/kaf...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/rspec/support/waterdrop/pact_waterdrop_client.rb
lib/pact/v2/rspec/support/waterdrop/pact_waterdrop_client.rb
# frozen_string_literal: true class PactWaterdropClient attr_reader :message Report = Struct.new(:partition, :offset, :topic_name, keyword_init: true) def produce_async(message) @message = message end def produce_sync(message) @message = message Report.new(partition: 0, offset: 0, topic_name: ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/rspec/support/webmock/webmock_helpers.rb
lib/pact/v2/rspec/support/webmock/webmock_helpers.rb
# frozen_string_literal: true module WebmockHelpers def self.turned_off yield unless defined?(::WebMock) allow_net_connect = WebMock::Config.instance.allow_net_connect allow_localhost = WebMock::Config.instance.allow_localhost allow_hosts = WebMock::Config.instance.allow net_http_connect_on_star...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/native/logger.rb
lib/pact/v2/native/logger.rb
# frozen_string_literal: true require "pact/ffi/logger" module Pact module V2 module Native module Logger LOG_LEVELS = { off: PactFfi::FfiLogLevelFilter["LOG_LEVEL_OFF"], error: PactFfi::FfiLogLevelFilter["LOG_LEVEL_ERROR"], warn: PactFfi::FfiLogLevelFilter["LOG_LEVEL...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/native/blocking_verifier.rb
lib/pact/v2/native/blocking_verifier.rb
# frozen_string_literal: true require "ffi" require "pact/ffi/verifier" module Pact module V2 module Native module BlockingVerifier extend FFI::Library ffi_lib DetectOS.get_bin_path attach_function :execute, :pactffi_verifier_execute, %i[pointer], :int32, blocking: true end ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/generators/base.rb
lib/pact/v2/generators/base.rb
# frozen_string_literal: true module Pact module V2 module Generators module Base def as_basic raise NotImplementedError, "Subclasses must implement the as_basic method" end end class RandomIntGenerator include Base def initialize(min:, max:) ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider/http_server.rb
lib/pact/v2/provider/http_server.rb
# frozen_string_literal: true module Pact module V2 module Provider # inspired by Gruf::Cli::Executor class HttpServer SERVER_STOP_TIMEOUT_SEC = 15 def initialize(options = {}) @options = options @server_pid = nil @host = @options[:host] || "localhost"...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider/gruf_server.rb
lib/pact/v2/provider/gruf_server.rb
# frozen_string_literal: true module Pact module V2 module Provider # inspired by Gruf::Cli::Executor class GrufServer SERVER_STOP_TIMEOUT_SEC = 15 def initialize(options = {}) @options = options setup! @server_pid = nil @services = @options...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider/async_message_verifier.rb
lib/pact/v2/provider/async_message_verifier.rb
# frozen_string_literal: true require "pact/ffi/verifier" require "pact/v2/native/logger" module Pact module V2 module Provider class AsyncMessageVerifier < BaseVerifier PROVIDER_TRANSPORT_TYPE = "message" def initialize(pact_config, mixed_config = nil) super raise Ar...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider/pact_config.rb
lib/pact/v2/provider/pact_config.rb
# frozen_string_literal: true # require_relative "pact_config/grpc" module Pact module V2 module Provider module PactConfig def self.new(transport_type, provider_name:, opts: {}) case transport_type when :http Http.new(provider_name: provider_name, opts: opts) ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider/mixed_verifier.rb
lib/pact/v2/provider/mixed_verifier.rb
# # frozen_string_literal: true module Pact module V2 module Provider # MixedVerifier coordinates verification for all present configs (async, grpc, http) class MixedVerifier attr_reader :mixed_config, :verifiers def initialize(mixed_config) unless mixed_config.is_a?(::Pact:...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider/base_verifier.rb
lib/pact/v2/provider/base_verifier.rb
# frozen_string_literal: true require "pact/ffi/verifier" require "pact/v2/native/logger" require "pact/v2/native/blocking_verifier" module Pact module V2 module Provider class BaseVerifier PROVIDER_TRANSPORT_TYPE = nil attr_reader :logger class VerificationError < Pact::V2::FfiEr...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider/provider_server_runner.rb
lib/pact/v2/provider/provider_server_runner.rb
# frozen_string_literal: true require "webrick" module Pact module V2 module Provider class ProviderServerRunner attr_reader :logger SETUP_PROVIDER_STATE_PATH = "/setup-provider" VERIFY_MESSAGE_PATH = "/verify-message" def initialize(port: 9001, host: "127.0.0.1", logger:...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider/grpc_verifier.rb
lib/pact/v2/provider/grpc_verifier.rb
# frozen_string_literal: true require "pact/ffi/verifier" require "pact/v2/native/logger" module Pact module V2 module Provider class GrpcVerifier < BaseVerifier PROVIDER_TRANSPORT_TYPE = "grpc" def initialize(pact_config, mixed_config = nil) super raise ArgumentError...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider/message_provider_servlet.rb
lib/pact/v2/provider/message_provider_servlet.rb
# frozen_string_literal: true require "webrick" module Pact module V2 module Provider class MessageProviderServlet < WEBrick::HTTPServlet::ProcHandler attr_reader :logger CONTENT_TYPE_JSON = "application/json" CONTENT_TYPE_PROTO = "application/protobuf" METADATA_HEADER = "...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false
pact-foundation/pact-ruby
https://github.com/pact-foundation/pact-ruby/blob/5563e56523bc1856e6216c2cc6ded980fc8da4af/lib/pact/v2/provider/provider_state_configuration.rb
lib/pact/v2/provider/provider_state_configuration.rb
# frozen_string_literal: true module Pact module V2 module Provider class ProviderStateConfiguration attr_reader :name, :opts, :setup_proc, :teardown_proc class ProviderStateConfigurationError < ::Pact::V2::Error; end def initialize(name, opts: {}) @name = name ...
ruby
MIT
5563e56523bc1856e6216c2cc6ded980fc8da4af
2026-01-04T15:57:25.715386Z
false