idempotent-request 0.1.7 → 0.2.1

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: 5791ba0801f04874aca3ba71bde40a860d314409f63608f29c11a0e736c887b8
4
- data.tar.gz: ccc7d160e6fb70fa22730f13c1fc6f8aa433953dcb4715499387039bf16a7fe0
3
+ metadata.gz: d7ac4e2bd8a8f54e7c5207a118c28c32e797c5a50acc5310e64b551a9b2ca53b
4
+ data.tar.gz: b7bc57a3663ce4304ff73ab975c57b8a4c4f26024bab602a3bcc0f2546501191
5
5
  SHA512:
6
- metadata.gz: 147935f35c5b61def21a0a25f7e3ba4e5bc7b4f76e5d9034da1b44506ab4b064444405fd28086061ea71d9e2100b107c178d0fa101731cf9d65a9736906f7994
7
- data.tar.gz: d11013511ed396e74388644d4f9cdbc80d35780bf305861920524f96a0ec682329fe58f033f96e98c0d16bc64fb9a111bd4c6fde2d060c3f307ec3331a1d3a41
6
+ metadata.gz: 4ae72cfc8d983b9a1b7b2ed6a2b7f97a47952681ace48dfd0984eb13110346fefd78c93a275904ac6525e1113e1103568bd3be68b3fa44a9f4eea8d9a355e12e
7
+ data.tar.gz: 025aadf293f91ff4a2e50b9d69bd1f42a957f0c17ec2236a6f7f4d8e1309eb8490bafea3caa578da9b8381d8221fb12291d1ccb14dfe8bec18accd986155d624
@@ -0,0 +1,35 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ paths:
8
+ - lib/version.rb
9
+
10
+ jobs:
11
+ build:
12
+ name: Build and publish
13
+ runs-on: ubuntu-latest
14
+ environment: master
15
+ permissions:
16
+ contents: read
17
+ packages: write
18
+
19
+ steps:
20
+ - uses: actions/checkout@v3
21
+ - name: Set up Ruby 3.2
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: 3.2.2
25
+
26
+ - name: Publish to RubyGems
27
+ run: |
28
+ mkdir -p $HOME/.gem
29
+ touch $HOME/.gem/credentials
30
+ chmod 0600 $HOME/.gem/credentials
31
+ printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
32
+ gem build *.gemspec
33
+ gem push *.gem
34
+ env:
35
+ GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
@@ -0,0 +1,27 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: ["master"]
6
+ pull_request:
7
+ branches: ["master"]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ matrix:
17
+ ruby-version: ['3.0', '3.1', '3.2']
18
+
19
+ steps:
20
+ - uses: actions/checkout@v3
21
+ - name: Set up Ruby
22
+ uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: ${{ matrix.ruby-version }}
25
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
26
+ - name: Run tests
27
+ run: bundle exec rake
data/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # Idempotent Request [![Build Status](https://travis-ci.org/qonto/idempotent-request.svg?branch=master)](https://travis-ci.org/qonto/idempotent-request)
1
+ ![Gem Version](https://badge.fury.io/rb/idempotent-request.svg) ![CI Status](https://github.com/qonto/idempotent-request/actions/workflows/tests.yml/badge.svg)
2
+
3
+ # Idempotent Request
2
4
 
3
5
  Rack middleware ensuring at most once requests for mutating endpoints.
4
6
 
@@ -140,11 +142,11 @@ Get notified when a client sends a request with the same idempotency key:
140
142
  ```ruby
141
143
  class RailsCallback
142
144
  attr_reader :request
143
-
145
+
144
146
  def initialize(request)
145
147
  @request = request
146
148
  end
147
-
149
+
148
150
  def detected(key:)
149
151
  Rails.logger.warn "IdempotentRequest request detected, key: #{key}"
150
152
  end
@@ -166,3 +168,8 @@ The gem is available as open source under the terms of the [MIT License](http://
166
168
  ## Code of Conduct
167
169
 
168
170
  Everyone interacting in the Idempotent::Request project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/idempotent-request/blob/master/CODE_OF_CONDUCT.md).
171
+
172
+
173
+ ## Releasing
174
+
175
+ To publish a new version to rubygems, update the version in `lib/version.rb`, and merge.
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ['lib']
22
22
 
23
- spec.add_dependency 'rack', '~> 2.0'
23
+ spec.add_dependency 'rack', '~> 3.0'
24
24
  spec.add_dependency 'oj', '~> 3.0'
25
25
 
26
26
  spec.add_development_dependency 'bundler'
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module IdempotentRequest
2
- VERSION = "0.1.7"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idempotent-request
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmytro Zakharov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-07 00:00:00.000000000 Z
11
+ date: 2023-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: '3.0'
20
20
  type: :runtime
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.0'
26
+ version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: oj
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -115,9 +115,10 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".github/workflows/rubygems.yml"
119
+ - ".github/workflows/tests.yml"
118
120
  - ".gitignore"
119
121
  - ".rspec"
120
- - ".travis.yml"
121
122
  - CHANGELOG.md
122
123
  - CODE_OF_CONDUCT.md
123
124
  - Gemfile
@@ -152,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
153
  - !ruby/object:Gem::Version
153
154
  version: '0'
154
155
  requirements: []
155
- rubygems_version: 3.0.8
156
+ rubygems_version: 3.4.10
156
157
  signing_key:
157
158
  specification_version: 4
158
159
  summary: Rack middleware ensuring at most once requests for mutating endpoints.
data/.travis.yml DELETED
@@ -1,21 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.10
5
- - 2.5.8
6
- - 2.6.6
7
- - 2.7.1
8
-
9
- jobs:
10
- include:
11
- - stage: gem release
12
- rvm: 2.7.1
13
- deploy:
14
- skip_cleanup: true
15
- provider: rubygems
16
- api_key:
17
- secure: JOZUQM6qAYJN/N0k4UmV3jBSKMaW3oMYiZ4boPrGm7MsUY8ETHXSYR+dDhrWOvDR4Wdr6DVbTmMtXkWJHaQaM/LkrjN2FM6mTuDfmhkcvi9VBOMstptwXeHMS9fWeogtQwHyd+pKac9vUlaMhRYyoeYyJ1i6/LHua4NftZZ8oPu/9kMuKDD3Rj8zPJNui+fGcZxq90XdxjafCfRJu7EnzSZXzVi5msaEBKcUVxsHxprBjyjmp/yh/Wn0GLyBkYYXkKEUNx9DhxVtWaNG2FfOzznj3HLXQgBdz1or1tDxG8iIegC5jEj4G+gLtldLhMYWfHDaEr4iqKLF1LkjO9TK0RjcVzGNHNxCTQaDDcjgimcVNozWg707IzT5Ap6jG4Y9JWk5KY4ysOaVFqhemafoDwQcXkPb+39N/tpeBPCByCVNrZ+5lgWaHvs+iDv0X9PyAFs5nTz6/u6bz7GDZ91oJOGs9OW6szzHwkQn5TN4omdGiOFca7lviz6OyjXeSn+a6whU2DsRXxp+omrPT/gELLGl21Wd3GGTpiGAdnu/vwvoKOZqGfkr8HS/Bozc0S/vafFJ5KoPAkNQ9iwxPgL1xcEbSF5uK67T2EYVKg7z4psXDeWGBWzk8657SBCB1VCgujkmhg+lWt0TGgrckupKSyUXL4/nnAECgizSLJSbgRE=
18
- gem: idempotent-request
19
- on:
20
- tags: true
21
- repo: qonto/idempotent-request