fleiss 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +1 -1
- data/.travis.yml +0 -1
- data/Gemfile.lock +40 -38
- data/fleiss.gemspec +3 -3
- data/lib/fleiss/backend/active_record/concern.rb +3 -3
- data/lib/fleiss/cli.rb +1 -1
- data/lib/fleiss/executor.rb +1 -1
- data/spec/spec_helper.rb +8 -4
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f4d85ef0b2ad7bfb482ec68a3ee93ac2d9a6298cb32583b1bec22dd0c59f170
|
4
|
+
data.tar.gz: 126d02197dc2c427dcfab96e79aee80d27b3ca709a0443a07131516031cd8d2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4104bc953340edc36e2ef2c54ca55428cbc4334c1ff1b833b5dbe242c649bd55eef6b4fca58eb626a6cba3da5e8e9d71d8035e46fb0f3035afad8176b5cbb3f
|
7
|
+
data.tar.gz: 8ccafa26982aa0b09f8bd1b5a3e664d6c66610e4cffa36cf3bfa0b0327b2d315529a5d7231d1a683a50b2a20b9a44d74b2b0f504c4d0d0af3d904a09589cf980
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fleiss (0.3.
|
4
|
+
fleiss (0.3.1)
|
5
5
|
activejob (>= 5.0)
|
6
6
|
activerecord (>= 5.0)
|
7
7
|
concurrent-ruby
|
@@ -9,63 +9,65 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activejob (
|
13
|
-
activesupport (=
|
12
|
+
activejob (6.0.2.1)
|
13
|
+
activesupport (= 6.0.2.1)
|
14
14
|
globalid (>= 0.3.6)
|
15
|
-
activemodel (
|
16
|
-
activesupport (=
|
17
|
-
activerecord (
|
18
|
-
activemodel (=
|
19
|
-
activesupport (=
|
20
|
-
|
21
|
-
activesupport (5.2.3)
|
15
|
+
activemodel (6.0.2.1)
|
16
|
+
activesupport (= 6.0.2.1)
|
17
|
+
activerecord (6.0.2.1)
|
18
|
+
activemodel (= 6.0.2.1)
|
19
|
+
activesupport (= 6.0.2.1)
|
20
|
+
activesupport (6.0.2.1)
|
22
21
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
23
22
|
i18n (>= 0.7, < 2)
|
24
23
|
minitest (~> 5.1)
|
25
24
|
tzinfo (~> 1.1)
|
26
|
-
|
25
|
+
zeitwerk (~> 2.2)
|
27
26
|
ast (2.4.0)
|
28
|
-
concurrent-ruby (1.1.
|
27
|
+
concurrent-ruby (1.1.6)
|
29
28
|
diff-lcs (1.3)
|
30
29
|
globalid (0.4.2)
|
31
30
|
activesupport (>= 4.2.0)
|
32
|
-
i18n (1.
|
31
|
+
i18n (1.8.2)
|
33
32
|
concurrent-ruby (~> 1.0)
|
34
|
-
jaro_winkler (1.5.
|
35
|
-
minitest (5.
|
36
|
-
mysql2 (0.5.
|
37
|
-
parallel (1.
|
38
|
-
parser (2.
|
33
|
+
jaro_winkler (1.5.4)
|
34
|
+
minitest (5.14.0)
|
35
|
+
mysql2 (0.5.3)
|
36
|
+
parallel (1.19.1)
|
37
|
+
parser (2.7.0.3)
|
39
38
|
ast (~> 2.4.0)
|
40
|
-
pg (1.
|
39
|
+
pg (1.2.2)
|
41
40
|
rainbow (3.0.0)
|
42
|
-
rake (
|
43
|
-
|
44
|
-
|
45
|
-
rspec-
|
46
|
-
rspec-
|
47
|
-
|
48
|
-
|
49
|
-
|
41
|
+
rake (13.0.1)
|
42
|
+
rexml (3.2.4)
|
43
|
+
rspec (3.9.0)
|
44
|
+
rspec-core (~> 3.9.0)
|
45
|
+
rspec-expectations (~> 3.9.0)
|
46
|
+
rspec-mocks (~> 3.9.0)
|
47
|
+
rspec-core (3.9.1)
|
48
|
+
rspec-support (~> 3.9.1)
|
49
|
+
rspec-expectations (3.9.0)
|
50
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-mocks (3.
|
51
|
+
rspec-support (~> 3.9.0)
|
52
|
+
rspec-mocks (3.9.1)
|
53
53
|
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
-
rspec-support (~> 3.
|
55
|
-
rspec-support (3.
|
56
|
-
rubocop (0.
|
54
|
+
rspec-support (~> 3.9.0)
|
55
|
+
rspec-support (3.9.2)
|
56
|
+
rubocop (0.80.1)
|
57
57
|
jaro_winkler (~> 1.5.1)
|
58
58
|
parallel (~> 1.10)
|
59
|
-
parser (>= 2.
|
59
|
+
parser (>= 2.7.0.1)
|
60
60
|
rainbow (>= 2.2.2, < 4.0)
|
61
|
+
rexml
|
61
62
|
ruby-progressbar (~> 1.7)
|
62
63
|
unicode-display_width (>= 1.4.0, < 1.7)
|
63
64
|
ruby-progressbar (1.10.1)
|
64
|
-
sqlite3 (1.
|
65
|
+
sqlite3 (1.4.2)
|
65
66
|
thread_safe (0.3.6)
|
66
|
-
tzinfo (1.2.
|
67
|
+
tzinfo (1.2.6)
|
67
68
|
thread_safe (~> 0.1)
|
68
|
-
unicode-display_width (1.6.
|
69
|
+
unicode-display_width (1.6.1)
|
70
|
+
zeitwerk (2.2.2)
|
69
71
|
|
70
72
|
PLATFORMS
|
71
73
|
ruby
|
@@ -78,7 +80,7 @@ DEPENDENCIES
|
|
78
80
|
rake
|
79
81
|
rspec
|
80
82
|
rubocop
|
81
|
-
sqlite3
|
83
|
+
sqlite3
|
82
84
|
|
83
85
|
BUNDLED WITH
|
84
|
-
2.
|
86
|
+
2.1.4
|
data/fleiss.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'fleiss'
|
3
|
-
s.version = '0.3.
|
3
|
+
s.version = '0.3.1'
|
4
4
|
s.authors = ['Black Square Media Ltd']
|
5
5
|
s.email = ['info@blacksquaremedia.com']
|
6
6
|
s.summary = %(Minimialist background jobs backed by ActiveJob and ActiveRecord.)
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^spec/}) }
|
13
13
|
s.test_files = `git ls-files -z -- spec/*`.split("\x0")
|
14
14
|
s.require_paths = ['lib']
|
15
|
-
s.required_ruby_version = '>= 2.
|
15
|
+
s.required_ruby_version = '>= 2.5'
|
16
16
|
|
17
17
|
s.add_dependency 'activejob', '>= 5.0'
|
18
18
|
s.add_dependency 'activerecord', '>= 5.0'
|
@@ -24,5 +24,5 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_development_dependency 'rake'
|
25
25
|
s.add_development_dependency 'rspec'
|
26
26
|
s.add_development_dependency 'rubocop'
|
27
|
-
s.add_development_dependency 'sqlite3'
|
27
|
+
s.add_development_dependency 'sqlite3'
|
28
28
|
end
|
@@ -8,10 +8,10 @@ module Fleiss
|
|
8
8
|
scope :in_queue, ->(qs) { where(queue_name: Array.wrap(qs)) }
|
9
9
|
scope :finished, -> { where.not(finished_at: nil) }
|
10
10
|
scope :not_finished, -> { where(finished_at: nil) }
|
11
|
-
scope :not_expired, ->(now=Time.zone.now) { where(arel_table[:expires_at].eq(nil).or(arel_table[:expires_at].gt(now))) }
|
11
|
+
scope :not_expired, ->(now = Time.zone.now) { where(arel_table[:expires_at].eq(nil).or(arel_table[:expires_at].gt(now))) }
|
12
12
|
scope :started, -> { where(arel_table[:started_at].not_eq(nil)) }
|
13
13
|
scope :not_started, -> { where(arel_table[:started_at].eq(nil)) }
|
14
|
-
scope :scheduled, ->(now=Time.zone.now) { where(arel_table[:scheduled_at].gt(now)) }
|
14
|
+
scope :scheduled, ->(now = Time.zone.now) { where(arel_table[:scheduled_at].gt(now)) }
|
15
15
|
end
|
16
16
|
|
17
17
|
module ClassMethods
|
@@ -20,7 +20,7 @@ module Fleiss
|
|
20
20
|
end
|
21
21
|
|
22
22
|
# @return [ActiveRecord::Relation] pending scope
|
23
|
-
def pending(now=Time.zone.now)
|
23
|
+
def pending(now = Time.zone.now)
|
24
24
|
not_finished
|
25
25
|
.not_expired(now)
|
26
26
|
.not_started
|
data/lib/fleiss/cli.rb
CHANGED
data/lib/fleiss/executor.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -5,15 +5,19 @@ require 'fleiss'
|
|
5
5
|
require 'fleiss/backend/active_record/migration'
|
6
6
|
require 'active_job'
|
7
7
|
require 'active_job/queue_adapters/fleiss_adapter'
|
8
|
-
require '
|
8
|
+
require 'fileutils'
|
9
9
|
|
10
10
|
ActiveJob::Base.queue_adapter = :fleiss
|
11
11
|
ActiveJob::Base.logger = Logger.new(nil)
|
12
12
|
|
13
13
|
Time.zone_default = Time.find_zone!('UTC')
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
tmpdir = File.expand_path('./tmp', __dir__)
|
16
|
+
FileUtils.rm_rf tmpdir
|
17
|
+
FileUtils.mkdir_p tmpdir
|
18
|
+
|
19
|
+
database_url = ENV['DATABASE_URL'] || "sqlite3://#{tmpdir}/fleiss-test.sqlite3"
|
20
|
+
ActiveRecord::Base.configurations = { 'test' => { 'url' => database_url, 'pool' => 20 } }
|
17
21
|
|
18
22
|
ActiveRecord::Base.establish_connection :test
|
19
23
|
ActiveRecord::Base.connection.drop_table('fleiss_jobs', if_exists: true)
|
@@ -32,7 +36,7 @@ class TestJob < ActiveJob::Base
|
|
32
36
|
72.hours
|
33
37
|
end
|
34
38
|
|
35
|
-
def perform(msg=nil)
|
39
|
+
def perform(msg = nil)
|
36
40
|
raise 'Failing' if msg == 'raise'
|
37
41
|
|
38
42
|
self.class.performed.push(msg)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fleiss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Black Square Media Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -140,16 +140,16 @@ dependencies:
|
|
140
140
|
name: sqlite3
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- - "
|
143
|
+
- - ">="
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
145
|
+
version: '0'
|
146
146
|
type: :development
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
|
-
- - "
|
150
|
+
- - ">="
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
152
|
+
version: '0'
|
153
153
|
description: Run background jobs with your favourite stack.
|
154
154
|
email:
|
155
155
|
- info@blacksquaremedia.com
|
@@ -195,14 +195,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
195
195
|
requirements:
|
196
196
|
- - ">="
|
197
197
|
- !ruby/object:Gem::Version
|
198
|
-
version: '2.
|
198
|
+
version: '2.5'
|
199
199
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
200
200
|
requirements:
|
201
201
|
- - ">="
|
202
202
|
- !ruby/object:Gem::Version
|
203
203
|
version: '0'
|
204
204
|
requirements: []
|
205
|
-
rubygems_version: 3.0.
|
205
|
+
rubygems_version: 3.0.6
|
206
206
|
signing_key:
|
207
207
|
specification_version: 4
|
208
208
|
summary: Minimialist background jobs backed by ActiveJob and ActiveRecord.
|