<commit_before># Pact Broker

The Pact Broker provides a repository for pacts created using the pact gem. It solves the problem of how to share pacts between consumer and provider projects.

Travis CI Status: [![Build Status](https://travis-ci.org/bethesque/pact_broker.svg?branch=master)](https://travis-ci.org/bethesque/pact_broker)

The Pact Broker:

* Enables pacts to be shared between consumer and provider projects.
* Displays autogenerated documentation for each pact.
* Enables a pact to be tagged (ie. "prod") so a provider can verify itself against a fixed version of a pact to ensure backwards compatibility.
* Provides webhooks to trigger a provider build when a consumer publishes a change to a pact.
* Displays dynamically generated network diagrams.

See the [Pact Broker Client](https://github.com/bethesque/pact_broker-client) for documentation on how to publish a pact to the Pact Broker, and configure the URLs in the provider project.

### Screenshots

#### Index
<img src="https://raw.githubusercontent.com/wiki/bethesque/pact_broker/images/index.png"/>

#### Autogenerated documentation
<img src="https://raw.githubusercontent.com/wiki/bethesque/pact_broker/images/autogenerated_documentation.png"/>

#### Network diagram
<img src="https://raw.githubusercontent.com/wiki/bethesque/pact_broker/images/network_diagram.png"/>

## Documentation

See the [wiki](https://github.com/bethesque/pact_broker/wiki) for documentation.

## Usage

* Create a database using a product that is supported by the Sequel gem (listed on this page http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html). At time of writing, Sequel has adapters for:  ADO, Amalgalite, CUBRID, DataObjects, DB2, DBI, Firebird, IBM_DB, Informix, JDBC, MySQL, Mysql2, ODBC, OpenBase, Oracle, PostgreSQL, SQLAnywhere, SQLite3, Swift, and TinyTDS.
* __Note:__ It is recommended to use __PostgreSQL__ as it will support JSON search features that are planned in a future release.
* Install ruby 1.9.3 or later
* Copy the [example](/example) directory to your workstation.
* Modify the config.ru and Gemfile as desired (eg. choose database driver gem, set your database credentials)
* Run `bundle`
* Run `bundle exec rackup`
* Open [http://localhost:9292](http://localhost:9292) and you should see the HAL browser.

For production usage, use a web application server like [Phusion Passenger](https://www.phusionpassenger.com) to serve the Pact Broker application.
<commit_msg>Added instruction about Sequel connection encoding.<commit_after># Pact Broker

The Pact Broker provides a repository for pacts created using the pact gem. It solves the problem of how to share pacts between consumer and provider projects.

Travis CI Status: [![Build Status](https://travis-ci.org/bethesque/pact_broker.svg?branch=master)](https://travis-ci.org/bethesque/pact_broker)

The Pact Broker:

* Enables pacts to be shared between consumer and provider projects.
* Displays autogenerated documentation for each pact.
* Enables a pact to be tagged (ie. "prod") so a provider can verify itself against a fixed version of a pact to ensure backwards compatibility.
* Provides webhooks to trigger a provider build when a consumer publishes a change to a pact.
* Displays dynamically generated network diagrams.

See the [Pact Broker Client](https://github.com/bethesque/pact_broker-client) for documentation on how to publish a pact to the Pact Broker, and configure the URLs in the provider project.

### Screenshots

#### Index
<img src="https://raw.githubusercontent.com/wiki/bethesque/pact_broker/images/index.png"/>

#### Autogenerated documentation
<img src="https://raw.githubusercontent.com/wiki/bethesque/pact_broker/images/autogenerated_documentation.png"/>

#### Network diagram
<img src="https://raw.githubusercontent.com/wiki/bethesque/pact_broker/images/network_diagram.png"/>

## Documentation

See the [wiki](https://github.com/bethesque/pact_broker/wiki) for documentation.

## Usage

* Create a database using a product that is supported by the Sequel gem (listed on this page http://sequel.jeremyevans.net/rdoc/files/README_rdoc.html). At time of writing, Sequel has adapters for:  ADO, Amalgalite, CUBRID, DataObjects, DB2, DBI, Firebird, IBM_DB, Informix, JDBC, MySQL, Mysql2, ODBC, OpenBase, Oracle, PostgreSQL, SQLAnywhere, SQLite3, Swift, and TinyTDS.
* __Note:__ It is recommended to use __PostgreSQL__ as it will support JSON search features that are planned in a future release.
* Install ruby 1.9.3 or later
* Copy the [example](/example) directory to your workstation.
* Modify the config.ru and Gemfile as desired (eg. choose database driver gem, set your database credentials)
* Please ensure you use `encoding: 'utf8'` in your Sequel options to avoid encoding issues.
* Run `bundle`
* Run `bundle exec rackup`
* Open [http://localhost:9292](http://localhost:9292) and you should see the HAL browser.

For production usage, use a web application server like [Phusion Passenger](https://www.phusionpassenger.com) to serve the Pact Broker application.

{'fraction_non_alphanumeric': 0.09242364141213805, 'fraction_numerical': 0.005751685838952796, 'mean_word_length': 5.112727272727272, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 16, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3326377', 'n_tokens_mistral': 1531, 'n_tokens_neox': 1468, 'n_words': 563}