activejob-lockable 0.2.0 → 0.3.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: e7030403a0857ccb1c8c520af5f8aa65dae5c62436d3b2ee6aba9e98b5150200
4
- data.tar.gz: a2e9f0462fadb5601d318b702b9fb242cbe6f5ced1eb93a2004ed9d8e98ffd91
3
+ metadata.gz: 17228343c0631b12e161a5107bcafca105666f2ae6427a390fa1abca3fbf6ecd
4
+ data.tar.gz: 0e6f680d5345f613ec56eee6c679762d5e8d1d8d7527b74bdd110b9cbfdeb0d5
5
5
  SHA512:
6
- metadata.gz: 182ce05c231b63b810e8d37d7ee9886f0552e461650d2f776bb56a7cd5f00cafe5ba0b1d969af72b4e18fedf783f9ef4042caf25f483437ae9db35c76ef8d48f
7
- data.tar.gz: e6234683928e34b0c38172138ddaa95c9bc14510ad10b20b3d1c500a0c200824bc7653d3f53e09e9f826c2bd32cb8cf684e3323abec6d68fc88e585779a55601
6
+ metadata.gz: 19975324abaee6a55dacb7b2f36ae3d822e54d5736085af01219f8190cd48993b999f0bdeb998a8691d203a45b44cef4b8dc02ac7b2244cc247ec96d959c4528
7
+ data.tar.gz: 40568b070ef7b83a7de563095c4dcded599b3efd3f6b531037a47540a0a9007087ef2d1281f915ce8c82cc4f17e88bffb7293397dded56c8b9cb29e1270e1f39
@@ -0,0 +1,35 @@
1
+ name: Ruby Gem
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ paths:
8
+ - lib/activejob/lockable/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
- # ActiveJob::Lockable [![Build Status](https://travis-ci.org/qonto/activejob-lockable.svg?branch=master)](https://travis-ci.org/qonto/activejob-lockable)
1
+ ![Gem Version](https://badge.fury.io/rb/activejob-lockable.svg) ![CI Status](https://github.com/qonto/activejob-lockable/actions/workflows/tests.yml/badge.svg)
2
+
3
+ # ActiveJob::Lockable
2
4
 
3
5
  Gem to make to make jobs lockable. Useful when a job is called N times, but only a single execution is needed.
4
6
 
@@ -17,7 +19,7 @@ And then execute:
17
19
  Or install it yourself as:
18
20
 
19
21
  $ gem install activejob-lockable
20
-
22
+
21
23
  ## Configuration
22
24
 
23
25
  Create an initializer with redis connection:
@@ -102,3 +104,7 @@ Bug reports and pull requests are welcome on GitHub at [qonto/activejob-lockable
102
104
  ## License
103
105
 
104
106
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
107
+
108
+ ## Releasing
109
+
110
+ To publish a new version to rubygems, update the version in `lib/activejob/lockable/version.rb`, and merge.
@@ -23,9 +23,9 @@ Gem::Specification.new do |spec|
23
23
  spec.add_dependency 'activejob'
24
24
  spec.add_dependency 'activesupport'
25
25
 
26
- spec.add_development_dependency 'bundler', '~> 1.15'
27
- spec.add_development_dependency 'rake', '~> 10.0'
28
- spec.add_development_dependency 'rspec', '~> 3.0'
26
+ spec.add_development_dependency 'bundler'
27
+ spec.add_development_dependency 'rake'
28
+ spec.add_development_dependency 'rspec'
29
29
  spec.add_development_dependency 'fakeredis'
30
30
  spec.add_development_dependency 'pry'
31
31
  end
@@ -49,7 +49,7 @@ module ActiveJob
49
49
  end
50
50
 
51
51
  def locked?
52
- ActiveJob::Lockable::RedisStore.exists?(lock_key)
52
+ ActiveJob::Lockable::RedisStore.exists?(lock_key) != 0
53
53
  end
54
54
 
55
55
  def locked_ttl
@@ -3,7 +3,7 @@ module ActiveJob
3
3
  class RedisStore
4
4
  class << self
5
5
  def set(cache_key, cache_value, options = {})
6
- ActiveJob::Lockable.redis.set(cache_key, cache_value, options)
6
+ ActiveJob::Lockable.redis.set(cache_key, cache_value, **options)
7
7
  end
8
8
 
9
9
  def exists?(cache_key)
@@ -1,5 +1,5 @@
1
1
  module ActiveJob
2
2
  module Lockable
3
- VERSION = '0.2.0'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activejob-lockable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmytro Zakharov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-28 00:00:00.000000000 Z
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob
@@ -42,44 +42,44 @@ dependencies:
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.15'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.15'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - "~>"
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: '3.0'
75
+ version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - "~>"
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: '3.0'
82
+ version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: fakeredis
85
85
  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
  - Gemfile
122
123
  - LICENSE.txt
123
124
  - README.md
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
149
  - !ruby/object:Gem::Version
149
150
  version: '0'
150
151
  requirements: []
151
- rubygems_version: 3.0.3
152
+ rubygems_version: 3.4.10
152
153
  signing_key:
153
154
  specification_version: 4
154
155
  summary: Prevents jobs from enqueuing with unique arguments for a certain period of
data/.travis.yml DELETED
@@ -1,13 +0,0 @@
1
- sudo: false
2
- language: ruby
3
- rvm:
4
- - 2.4.2
5
- deploy:
6
- skip_cleanup: true
7
- provider: rubygems
8
- api_key:
9
- secure: aD0lrk/+PZnWSJVdDRHFB6kzea1dmJl1nlWXMsyr0s5FlXPGuF1O01LEJIxQSNhl2AiA/yQBbT/ldcEsYyzYvRJWlkXbzzfTNa3pl0MYM3U7lDfAA9oJn2Xis/jiW7pI+vEehIA+6V5rr/V1KBNrxxveWQhcpfiQi7p6efF/XBugCqNhVW8G/NLN2S2Zi5ITFekAHoubYh1h0stFqnt9pxKLlm3eTBjs77DsMtLZtoy5KIMptRCOxTSOGteqFy/saeDWEPTWJWaKZ6zJ4bCQG15WJIJ+J+zcCO3kTD+hZUGkOgsy/lYuwOPu845f16kstPVBkqbcxbCdrQaI5sgwwdGNLF14yzwFS8c309ZC9Wnx6QsfPdQjV6Ol4ZTufVqi3EMEmvJQ78gX2T3J8E/6Cer4Ay2vrny5SyzekFSbGcMPr++iGk4JVn/jgEulAxMvDJoqdrJhETCKAcPlk1EesPUPP5JuXuW6HfDXNEYvv7Bzo2xVuaUsNvSMLsbZai7E2PchkBYApIKg9A6hFkt7ymiAIszMiSDuIj90aBtKpOIoMw6TyRp/x0qXJkPw2UOO22YJHeJanEjKtc2jk3r65FPCRKna3GcHXBXGAcJTKP2fJdBcRKtB7Y/SjRq84uDZJxwNKRBfyCittpMuu20uln+ylQzE9hnM28O7dOUfNBs=
10
- gem: activejob-lockable
11
- on:
12
- tags: true
13
- repo: qonto/activejob-lockable