activejob-status 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/activejob-status/progress.rb +9 -6
- data/lib/activejob-status/status.rb +1 -0
- data/lib/activejob-status/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6224b3f14c08054d81bc9fbe675a1f120bca7291d7ed20b644b9bcf833c34458
|
4
|
+
data.tar.gz: 3691a1628e4eff782cfdd228ea2bc6eda0f16e970e4c8e8cde479612037d51d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d537c5d9794dcca9eb1171d400cee21958716e89989fd87db61600475929e565d026b10b49fe0778b4e3dbd80d11f907564daa7434c6b47652fe8c7bc573ffb
|
7
|
+
data.tar.gz: 7957e2ee9d3deb2227e2dcef5e9d3945bf89f279afb7b70aa96c6c9838302535e297a0c92e2743b60ecaee5ce15e74695cd5e567d16865275f39d4a45b1f1b20
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module ActiveJob
|
2
2
|
module Status
|
3
3
|
class Progress
|
4
|
-
|
4
|
+
attr_reader :job, :total, :progress
|
5
|
+
|
6
|
+
delegate :[], :to_s, :to_json, :inspect, to: :to_h
|
7
|
+
delegate :status, to: :job, prefix: true
|
5
8
|
|
6
9
|
def initialize(job)
|
7
10
|
@job = job
|
@@ -30,17 +33,17 @@ module ActiveJob
|
|
30
33
|
update { @total }
|
31
34
|
end
|
32
35
|
|
36
|
+
def to_h
|
37
|
+
{ progress: @progress, total: @total }
|
38
|
+
end
|
39
|
+
|
33
40
|
private
|
34
41
|
|
35
42
|
def update
|
36
43
|
@progress = yield if block_given?
|
37
|
-
|
44
|
+
job_status.update(to_h)
|
38
45
|
self
|
39
46
|
end
|
40
|
-
|
41
|
-
def hash
|
42
|
-
{ progress: @progress, total: @total }
|
43
|
-
end
|
44
47
|
end
|
45
48
|
end
|
46
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activejob-status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Savater Sebastien
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|
@@ -69,8 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: '0'
|
71
71
|
requirements: []
|
72
|
-
|
73
|
-
rubygems_version: 2.7.7
|
72
|
+
rubygems_version: 3.0.6
|
74
73
|
signing_key:
|
75
74
|
specification_version: 4
|
76
75
|
summary: Monitor your jobs
|