pact-message 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9e2884875c85c338522d2113d74c7e742309cdc864180a6c7270bf3f3d31a175
4
- data.tar.gz: 786c95da06a2c7b44a5eb17c18c7f45b1c52fdbe0cab4d6732ab57d8d49b0954
3
+ metadata.gz: 8626b3359a7fdae0eb187aa5bf25768fbd673059f1af6e78151441834d735317
4
+ data.tar.gz: 10f3f19b10d7da81a729680847420d0f80d621728a406929bdca73f36e561c07
5
5
  SHA512:
6
- metadata.gz: ad49fca208a2fef4107862750d4349ba890354ecf220c497fc3fa192f1d78cd7dee3abba59770023682734e9d5236932d74faf488fe372637181aad81c569550
7
- data.tar.gz: 4b96ecd3a271135ede66c3d2f492030e4daa045362a8db507b236e6bad0e4e54aaaff064703dcbdf1970d7e73cb0673b45c0f8f49895726e6aee9bc3f58ae63e
6
+ metadata.gz: 8b27088fb2e9e6caf5ac067a05c39ed8f17155804411e89532907236f95268343e4c416bac1200dfb58230dc4fd3d79fa45815b32777426ed5b528b3f96fffc5
7
+ data.tar.gz: 81b005e65c3dfba662d0fac20f8afcfe0941f8dd1b6332ba7300d3e34be8565acca9269f4605fb3cc90f8feafaaf439a02f32ef11baf40f4bdc6e3b7a314a5ab
@@ -1,4 +1,5 @@
1
- name: Release gem
1
+ ---
2
+ name: "Release gem"
2
3
 
3
4
  on:
4
5
  repository_dispatch:
@@ -6,42 +7,28 @@ on:
6
7
  - release-triggered
7
8
 
8
9
  jobs:
9
- test:
10
- runs-on: ubuntu-latest
11
- steps:
12
- - uses: actions/checkout@v2
13
- - uses: actions/setup-ruby@v1
14
- with:
15
- ruby-version: '2.6'
16
- - run: |
17
- gem install bundler -v 2.1
18
- bundle install
19
- - name: Test
20
- run: bundle exec rake
21
-
22
10
  release:
23
- needs: test
24
11
  runs-on: ubuntu-latest
25
- outputs:
26
- gem_name: ${{ steps.release-gem.outputs.gem_name }}
27
- version: ${{ steps.release-gem.outputs.version }}
28
- increment: ${{ steps.release-gem.outputs.increment }}
29
12
  steps:
30
- - uses: actions/checkout@v2
31
- with:
32
- fetch-depth: 0
33
- - uses: pact-foundation/release-gem@v0.0.11
34
- id: release-gem
35
- env:
36
- GEM_HOST_API_KEY: '${{ secrets.RUBYGEMS_API_KEY }}'
37
- GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
38
- INCREMENT: '${{ github.event.client_payload.increment }}'
13
+ - uses: actions/checkout@v2
14
+ with:
15
+ fetch-depth: 0
16
+ - id: release-gem
17
+ uses: pact-foundation/release-gem@v0.0.11
18
+ env:
19
+ GEM_HOST_API_KEY: "${{ secrets.RUBYGEMS_API_KEY }}"
20
+ GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
21
+ INCREMENT: "${{ github.event.client_payload.increment }}"
22
+ outputs:
23
+ gem_name: "${{ steps.release-gem.outputs.gem_name }}"
24
+ version: "${{ steps.release-gem.outputs.version }}"
25
+ increment: "${{ steps.release-gem.outputs.increment }}"
39
26
 
40
27
  notify-gem-released:
41
28
  needs: release
42
29
  strategy:
43
30
  matrix:
44
- repository: [pact-foundation/pact-ruby-standalone]
31
+ repository: [pact-foundation/pact-ruby-cli, pact-foundation/pact-ruby-standalone]
45
32
  runs-on: ubuntu-latest
46
33
  steps:
47
34
  - name: Notify ${{ matrix.repository }} of gem release
@@ -0,0 +1,23 @@
1
+ name: Test
2
+
3
+ on: push
4
+
5
+ jobs:
6
+ test:
7
+ runs-on: "ubuntu-latest"
8
+ continue-on-error: ${{ matrix.experimental }}
9
+ strategy:
10
+ fail-fast: false
11
+ matrix:
12
+ ruby_version: ["2.2", "2.7"]
13
+ experimental: [false]
14
+ include:
15
+ - ruby_version: "3.0"
16
+ experimental: true
17
+ steps:
18
+ - uses: actions/checkout@v2
19
+ - uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: ${{ matrix.ruby_version }}
22
+ - run: "bundle install"
23
+ - run: "bundle exec rake"
@@ -1,3 +1,10 @@
1
+ <a name="v0.10.0"></a>
2
+ ### v0.10.0 (2021-01-22)
3
+
4
+ #### Features
5
+
6
+ * allow pact-message update to receive JSON via the standard input ([5cbb664](/../../commit/5cbb664))
7
+
1
8
  <a name="v0.9.0"></a>
2
9
  ### v0.9.0 (2020-11-04)
3
10
 
@@ -9,13 +9,23 @@ module Pact
9
9
  method_option :pact_dir, required: true, desc: "The Pact directory"
10
10
  method_option :pact_specification_version, required: false, default: "2.0.0", desc: "The Pact Specification version"
11
11
 
12
- desc 'update MESSAGE_JSON', 'Update a pact with the given message, or create the pact if it does not exist. The MESSAGE_JSON may be in the legacy Ruby JSON format or the v2+ format.'
13
- def update(message)
12
+ # Update a pact with the given message, or create the pact if it does not exist
13
+ desc 'update MESSAGE_JSON', "Update/create a pact. If MESSAGE_JSON is omitted or '-', it is read from stdin"
14
+ long_desc <<-MSG, wrapping: false
15
+ Update a pact with the given message, or create the pact if it does not exist.
16
+ The MESSAGE_JSON may be in the legacy Ruby JSON format or the v2+ format.
17
+ If MESSAGE_JSON is not provided or is '-', the content will be read from
18
+ standard input.
19
+ MSG
20
+ def update(maybe_json = '-')
14
21
  require 'pact/message'
15
22
  require 'pact/message/consumer/write_pact'
23
+
24
+ message_json = JSON.parse(maybe_json == '-' ? $stdin.read : maybe_json)
25
+
16
26
  pact_specification_version = Pact::SpecificationVersion.new(options.pact_specification_version)
17
- message = Pact::Message.from_hash(JSON.load(message), { pact_specification_version: pact_specification_version })
18
- Pact::Message::Consumer::WritePact.call(message, options.pact_dir, options.consumer, options.provider, options.pact_specification_version, :update)
27
+ message_hash = Pact::Message.from_hash(message_json, { pact_specification_version: pact_specification_version })
28
+ Pact::Message::Consumer::WritePact.call(message_hash, options.pact_dir, options.consumer, options.provider, options.pact_specification_version, :update)
19
29
  end
20
30
 
21
31
  desc 'reify', "Take a JSON document with embedded pact matchers and return a concrete example"
@@ -1,5 +1,5 @@
1
1
  module Pact
2
2
  module Message
3
- VERSION = "0.9.0"
3
+ VERSION = "0.10.0"
4
4
  end
5
5
  end
@@ -12,14 +12,14 @@ else
12
12
  increment="null"
13
13
  fi
14
14
 
15
- repository_slug=$(git remote get-url $(git remote show) | cut -d':' -f2 | sed 's/\.git//')
15
+ repository_slug=$(git remote get-url origin | cut -d':' -f2 | sed 's/\.git//')
16
16
 
17
- output=$(curl -v -X POST https://api.github.com/repos/${repository_slug}/dispatches \
17
+ output=$(curl -v https://api.github.com/repos/${repository_slug}/dispatches \
18
18
  -H 'Accept: application/vnd.github.everest-preview+json' \
19
19
  -H "Authorization: Bearer $GITHUB_ACCESS_TOKEN_FOR_PF_RELEASES" \
20
20
  -d "{\"event_type\": \"release-triggered\", \"client_payload\": {\"increment\": ${increment}}}" 2>&1)
21
21
 
22
- if ! echo "${output}" | grep "HTTP\/1.1 204" > /dev/null; then
22
+ if ! echo "${output}" | grep "HTTP\/.* 204" > /dev/null; then
23
23
  echo "$output" | sed "s/${GITHUB_ACCESS_TOKEN_FOR_PF_RELEASES}/********/g"
24
24
  echo "Failed to trigger release"
25
25
  exit 1
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pact-message
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Beth Skurrie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-04 00:00:00.000000000 Z
11
+ date: 2021-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pact-support
@@ -139,9 +139,9 @@ extensions: []
139
139
  extra_rdoc_files: []
140
140
  files:
141
141
  - ".github/workflows/release_gem.yml"
142
+ - ".github/workflows/test.yml"
142
143
  - ".gitignore"
143
144
  - ".rspec"
144
- - ".travis.yml"
145
145
  - CHANGELOG.md
146
146
  - CONTRIBUTING.md
147
147
  - DEVELOPER_DOCUMENTATION.md
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  - !ruby/object:Gem::Version
207
207
  version: '0'
208
208
  requirements: []
209
- rubygems_version: 3.1.4
209
+ rubygems_version: 3.2.6
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Consumer contract library for messages
@@ -1,33 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.2.4
5
- before_install:
6
- - rvm use @global
7
- - gem uninstall bundler -x || gem uninstall bundler -a || true
8
- - gem install bundler -v 1.17.3
9
- - bundler --version
10
- script:
11
- - rvm use @global
12
- - bundle exec rake
13
- jobs:
14
- # include:
15
- # - stage: gem release
16
- # rvm: 2.2.4
17
- # script: echo "Deploying to rubygems.org ..."
18
- # deploy:
19
- # provider: rubygems
20
- # api_key:
21
- # secure: NEA7BYENheSN8qF/6BP52uQjTS5U43MXsyxBeqxbp1JOkJxVSNzQw14xy41aXX0gphT7wEVHinnWS+1slLKXvu4OzGKKzcUsnekYFZoGW7eTyKUx7lh/XtFejQ/Mm4P5t75GBgMoaIi+Pa1rD4fcE7zYGrgCvTwIrOGb/SPIKILj0yT8UXMFod8yDDmxzivSSKYe4rgWYlq8aiidDZr2M5ypBR4WcOptCrkBCF8XxXzhFMY4QtrXLsLFRyCzCrDHmosCfC/bLJQltlJjLXfB5ksgaImWAD7wZ6Q4uC5QqmPShonQiPlLEh53Q5nkEWPIcsV7FVZqzXUjPN3LYHlRv+7D3AvbHmJggSt7fXr8YxbzVUkviBlKqNmc9cqM6CSO++QT3UShNgH5b03YKI8rRjFMWYKn1DrN5F5rFNDoGFcZtQSjFN5g/fEiSYsdkNsIeTp4YFxMkTztAYT8TxgcBvCnfXox6xDaLaPWh13UrUL2VL7O7uDK06xWUCp9Hm3/AXz0wRzya1tK9dCWamE5BOzk2ScOiLOgmpgwNHFVA1U93rkHq7Ixr11wazP3Dcinv0kWcW7hdMcI7VA0DUesxLKw6mkcQpd3NLgSU4mWtpoVFcmdERQUGsNM1d5NjGjBeyVMpC0I9NXM1Wv6cLENSX9b4GR7lkwGG/IHRFNciHk=
22
- # gem: pact-message
23
- # on:
24
- # tags: true
25
- # repo: pact-foundation/pact-message-ruby
26
- # notifications:
27
- # webhooks:
28
- # urls:
29
- # - https://webhooks.gitter.im/e/6523128341fad111ed79
30
- # on_success: change
31
- # on_failure: always
32
- # on_start: never
33
-