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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2c2f5a9c1c18e978423df936f1df40e5ac10e97ec28782260fb3980edac85a8
4
- data.tar.gz: f77a7dabc7c43e311af942ddb0218b9f044ebee1284190a37eb810e49da462c2
3
+ metadata.gz: 6224b3f14c08054d81bc9fbe675a1f120bca7291d7ed20b644b9bcf833c34458
4
+ data.tar.gz: 3691a1628e4eff782cfdd228ea2bc6eda0f16e970e4c8e8cde479612037d51d3
5
5
  SHA512:
6
- metadata.gz: 2db433d26e44683e749a86b8dae4ea426e002d2f3ef3c06aa36a731e75fb2ec7255ec81b36f4daa8c476326f4e45834c180b6d13c600ecd511a05bba800f23dc
7
- data.tar.gz: 0a36fb9aa42f326a9d63c203f8c263c69b11f2d92ab438eaf59072aac20c994c655b6125c0d52496fedf9588d44135bcc4c12dbeef2e39f42246d43288de64eb
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
- delegate :[], :to_s, :to_json, :inspect, to: :hash
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
- @job.status.update(hash)
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
@@ -15,6 +15,7 @@ module ActiveJob
15
15
  def read
16
16
  Storage.read(@job)
17
17
  end
18
+ alias to_h read
18
19
 
19
20
  def update(message)
20
21
  Storage.update(@job, message)
@@ -1,5 +1,5 @@
1
1
  module ActiveJob
2
2
  module Status
3
- VERSION = '0.1.5'.freeze
3
+ VERSION = '0.1.6'.freeze
4
4
  end
5
5
  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.5
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: 2018-06-28 00:00:00.000000000 Z
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
- rubyforge_project:
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