pact_broker 1.11.1 → 1.11.2
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/.travis.yml +0 -1
- data/CHANGELOG.md +7 -0
- data/README.md +3 -3
- data/example/pact_broker_database.sqlite3 +0 -0
- data/lib/pact_broker/api/resources/pact_content_diff.rb +2 -2
- data/lib/pact_broker/date_helper.rb +1 -1
- data/lib/pact_broker/pacts/diff.rb +5 -1
- data/lib/pact_broker/version.rb +1 -1
- data/pact_broker.gemspec +1 -1
- data/spec/features/{get_diff.rb → get_diff_spec.rb} +6 -5
- data/spec/service_consumers/provider_states_for_pact_broker_client.rb +1 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a30055706afb5eca1184777c027d6c89fcc58d9
|
4
|
+
data.tar.gz: ded720370181e3cf0afe1554253b6e13a374a2f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 771ed02390e14db3c6aef45d2d1faa2784dea6a4f2d50040873378876ada7b6e42cc7d8a67db2f9c4bd60b576e7669b41706e5433b0c24f2792814819a3200df
|
7
|
+
data.tar.gz: 957fcf5f64742d212d1936a39288fa556d8476ec81f8a740899fe6cbd372728db596e3bc6c854a34ed9a68f8bbf5d7edb7199d09ce6b55207e6e8bb7102dab0d
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,13 @@ Do this to generate your change history
|
|
2
2
|
|
3
3
|
$ git log --pretty=format:' * %h - %s (%an, %ad)' vX.Y.Z..HEAD
|
4
4
|
|
5
|
+
#### 1.11.2 (2016-11-25)
|
6
|
+
* 43f2373 - Added require to hopefully fix broken build. https://travis-ci.org/bethesque/pact_broker/jobs/174397806 (Bethany Skurrie, Thu Nov 24 07:47:07 2016 +1100)
|
7
|
+
* f747e09 - Removed ruby 2.1 build as it is failing (Beth Skurrie, Wed Nov 9 13:42:08 2016 +1100)
|
8
|
+
* 2dd77a5 - Added extra pact version to example database so that the diff feature could be explored. (Beth, Wed Nov 9 10:07:33 2016 +1100)
|
9
|
+
* 5c04c59 - Updated trailblazer gem to ~>0.3.0 and fixed pact diff spec. (Beth, Wed Nov 9 10:05:53 2016 +1100)
|
10
|
+
* 8102ac9 - Use respond_to?(:acts_like_time?) instead of acts_like?(:time) as it blows up (Beth, Sun Nov 6 12:00:30 2016 +1100)
|
11
|
+
|
5
12
|
#### 1.11.1 (2016-10-13)
|
6
13
|
* 14381ac - Fix issue #59 Error when executing web hook with body. (Beth Skurrie, Thu Oct 13 12:50:17 2016 +1100)
|
7
14
|
|
data/README.md
CHANGED
@@ -80,7 +80,7 @@ Use the HAL browser to view documentation as you browse.
|
|
80
80
|
|
81
81
|
### To have a play around on your local machine
|
82
82
|
|
83
|
-
* Install ruby 1.9.3 or later
|
83
|
+
* Install ruby 1.9.3 or later and bundler >= 1.12.0 as there is currently an issue with [bundler 1.13](https://github.com/bethesque/pact_broker/issues/57)
|
84
84
|
* Run `git clone git@github.com:bethesque/pact_broker.git && cd pact_broker/example`
|
85
85
|
* Run `bundle`
|
86
86
|
* Run `bundle exec rackup -p 8080`
|
@@ -95,8 +95,8 @@ Use the HAL browser to view documentation as you browse.
|
|
95
95
|
You can use the [Pact Broker Docker container][docker] or [Terraform on AWS][terraform] or to roll your own...
|
96
96
|
|
97
97
|
* 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). The migrations have been tested on MySQL and PostgreSQL - your milage will vary on other databases.
|
98
|
-
* __Note:__ It is recommended to use __PostgreSQL__ as it will support JSON search features that are planned in a future release, however MySQL the other
|
99
|
-
* Install ruby 1.9.3 or later
|
98
|
+
* __Note:__ It is recommended to use __PostgreSQL__ as it will support JSON search features that are planned in a future release, however MySQL the other [semi supported](https://github.com/bethesque/pact_broker/issues/33) database.
|
99
|
+
* Install ruby 1.9.3 or later and bundler >= 1.12.0 as there is currently an issue with [bundler 1.13](https://github.com/bethesque/pact_broker/issues/57)
|
100
100
|
* Copy the [example](/example) directory to the location you want to install the application.
|
101
101
|
* Modify the config.ru and Gemfile as desired (eg. choose database driver gem, set your database credentials. Use the "pg" gem if using Postgres.)
|
102
102
|
* Please ensure you use `encoding: 'utf8'` in your Sequel options to avoid encoding issues.
|
Binary file
|
@@ -22,8 +22,8 @@ module PactBroker
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def to_text
|
25
|
-
_,
|
26
|
-
response.body =
|
25
|
+
_, operation = PactBroker::Pacts::Diff.run pact_params, base_url: base_url
|
26
|
+
response.body = operation.output
|
27
27
|
end
|
28
28
|
|
29
29
|
def pact
|
@@ -62,7 +62,7 @@ module PactBroker
|
|
62
62
|
# 60 days up to 365 days
|
63
63
|
when 86400...525600 then locale.t :x_months, :count => (distance_in_minutes.to_f / 43200.0).round
|
64
64
|
else
|
65
|
-
if from_time.
|
65
|
+
if from_time.respond_to?(:acts_like_time?) && to_time.respond_to?(:acts_like_time?)
|
66
66
|
fyear = from_time.year
|
67
67
|
fyear += 1 if from_time.month >= 3
|
68
68
|
tyear = to_time.year
|
@@ -17,7 +17,7 @@ module PactBroker
|
|
17
17
|
def process params, options
|
18
18
|
pact = pact_repository.find_pact(params.consumer_name, params.consumer_version_number, params.provider_name)
|
19
19
|
previous_distinct_pact = pact_repository.find_previous_distinct_pact pact
|
20
|
-
if previous_distinct_pact
|
20
|
+
@output = if previous_distinct_pact
|
21
21
|
next_pact = pact_repository.find_next_pact previous_distinct_pact
|
22
22
|
DiffDecorator.new(pact, previous_distinct_pact, next_pact, options[:base_url]).to_text
|
23
23
|
else
|
@@ -29,6 +29,10 @@ module PactBroker
|
|
29
29
|
"No previous distinct version was found for #{pact.name}"
|
30
30
|
end
|
31
31
|
|
32
|
+
def output
|
33
|
+
@output
|
34
|
+
end
|
35
|
+
|
32
36
|
private
|
33
37
|
|
34
38
|
# The next pact version after the previous distinct version.
|
data/lib/pact_broker/version.rb
CHANGED
data/pact_broker.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |gem|
|
|
35
35
|
gem.add_runtime_dependency 'pact-support', '~>0.4', '>=0.4.2'
|
36
36
|
gem.add_runtime_dependency 'padrino-core', '~>0.12.4'
|
37
37
|
gem.add_runtime_dependency 'haml'
|
38
|
-
gem.add_runtime_dependency 'trailblazer', '~>0.
|
38
|
+
gem.add_runtime_dependency 'trailblazer', '~>0.3.0'
|
39
39
|
|
40
40
|
gem.add_development_dependency 'sqlite3'
|
41
41
|
gem.add_development_dependency 'pry'
|
@@ -4,7 +4,7 @@ describe "Get diff between versions" do
|
|
4
4
|
|
5
5
|
let(:path) { "/pacts/provider/Provider/consumer/Consumer/version/3/diff/previous-distinct" }
|
6
6
|
|
7
|
-
let(:last_response_body) {
|
7
|
+
let(:last_response_body) { subject.body }
|
8
8
|
|
9
9
|
subject { get path; last_response }
|
10
10
|
|
@@ -30,12 +30,13 @@ describe "Get diff between versions" do
|
|
30
30
|
|
31
31
|
context "when the versions exist" do
|
32
32
|
|
33
|
-
it "returns a 200
|
34
|
-
expect(subject).to
|
33
|
+
it "returns a 200 text response" do
|
34
|
+
expect(subject.headers['Content-Type']).to eq "text/plain;charset=utf-8"
|
35
35
|
end
|
36
36
|
|
37
37
|
it "returns the JSON representation of the diff" do
|
38
|
-
expect(last_response_body).to include(
|
38
|
+
expect(last_response_body).to include('"method": "post"')
|
39
|
+
expect(last_response_body).to include('"method": "get"')
|
39
40
|
end
|
40
41
|
|
41
42
|
end
|
@@ -44,7 +45,7 @@ describe "Get diff between versions" do
|
|
44
45
|
|
45
46
|
let(:path) { "/pacts/provider/Provider/consumer/Consumer/versions/1/diff/previous-distinct" }
|
46
47
|
|
47
|
-
|
48
|
+
it "returns a 404 response" do
|
48
49
|
expect(subject).to be_a_404_response
|
49
50
|
end
|
50
51
|
|
@@ -14,6 +14,7 @@ Pact.provider_states_for "Pact Broker Client" do
|
|
14
14
|
|
15
15
|
provider_state "an error occurs while publishing a pact" do
|
16
16
|
set_up do
|
17
|
+
require 'pact_broker/pacts/service'
|
17
18
|
allow(PactBroker::Pacts::Service).to receive(:create_or_update_pact).and_raise("an error")
|
18
19
|
end
|
19
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pact_broker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bethany Skurrie
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-11-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|
@@ -206,14 +206,14 @@ dependencies:
|
|
206
206
|
requirements:
|
207
207
|
- - "~>"
|
208
208
|
- !ruby/object:Gem::Version
|
209
|
-
version: 0.
|
209
|
+
version: 0.3.0
|
210
210
|
type: :runtime
|
211
211
|
prerelease: false
|
212
212
|
version_requirements: !ruby/object:Gem::Requirement
|
213
213
|
requirements:
|
214
214
|
- - "~>"
|
215
215
|
- !ruby/object:Gem::Version
|
216
|
-
version: 0.
|
216
|
+
version: 0.3.0
|
217
217
|
- !ruby/object:Gem::Dependency
|
218
218
|
name: sqlite3
|
219
219
|
requirement: !ruby/object:Gem::Requirement
|
@@ -571,7 +571,7 @@ files:
|
|
571
571
|
- script/update-hal-browser
|
572
572
|
- spec/features/create_webhook_spec.rb
|
573
573
|
- spec/features/delete_pact_spec.rb
|
574
|
-
- spec/features/
|
574
|
+
- spec/features/get_diff_spec.rb
|
575
575
|
- spec/features/get_pact_spec.rb
|
576
576
|
- spec/features/get_previous_distinct_version.rb
|
577
577
|
- spec/features/get_provider_pacts.rb
|
@@ -730,7 +730,7 @@ summary: See description
|
|
730
730
|
test_files:
|
731
731
|
- spec/features/create_webhook_spec.rb
|
732
732
|
- spec/features/delete_pact_spec.rb
|
733
|
-
- spec/features/
|
733
|
+
- spec/features/get_diff_spec.rb
|
734
734
|
- spec/features/get_pact_spec.rb
|
735
735
|
- spec/features/get_previous_distinct_version.rb
|
736
736
|
- spec/features/get_provider_pacts.rb
|