dronejob 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d289e8680b74218314d2494741bcea27c1433408
4
- data.tar.gz: 9d709407b987a68b9575e9417f7b3cc876c6b626
3
+ metadata.gz: a850605973ac67b8964a4bbfc2c503763a2971ab
4
+ data.tar.gz: be0c29c72a5d089dc2d2a6eaf0a23d1084361d80
5
5
  SHA512:
6
- metadata.gz: 3651cd2b5f05d27d785382ce476385dca08199b7fc0cc1bae9de5cd9a291ec31402a88d00a981f52c3617a3850f90f084a32b9a99cc498f221dc3b4ef643c497
7
- data.tar.gz: 255e1b4a054280eb2621663835467fa60cde4f420da2b56c546458120f643ef2509eda9e20be4fcf330dbb53efc355da9caceb7681a44b4a2210244cc4ca5360
6
+ metadata.gz: f378b7e017133a338969441a3acb491970591715d90035c85c8db9ac967f80f1fcd4f1ee2764dfa952716d9f76b6445550c5a985f91e7e76399c62da653ca99f
7
+ data.tar.gz: 4fc9e842d39cb41c95047c602c31878fd28acd42715bedb2b1a4f51fe5a95d39f61976bd9fd9fbfb2a641846f8f2c5186576e5046332c9f3734d11ca0b9e2654
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dronejob (1.1.2)
4
+ dronejob (1.1.3)
5
5
  activejob (~> 4.2)
6
6
  bundler (>= 1.3.0, < 2.0)
7
7
  git (~> 1.2)
@@ -10,6 +10,16 @@ module Dronejob
10
10
  set_callback :job, :after, :notify_after_job
11
11
  end
12
12
 
13
+ class_methods do
14
+ def notify(value=true)
15
+ @notify = value
16
+ end
17
+
18
+ def notify?
19
+ !!@notify
20
+ end
21
+ end
22
+
13
23
  def publish_status(data={}, status="working", backend=false)
14
24
  data[:action] = "update_process"
15
25
  data[:user_id] = param(:user_id)
@@ -34,13 +44,12 @@ module Dronejob
34
44
  end
35
45
 
36
46
  def should_notify?
37
- param(:notify) and !param(:run)
47
+ self.class.notify? and param(:notify) and !param(:run)
38
48
  end
39
49
 
40
50
  def publish_progress(progress, description=nil)
41
51
  publish_status({title: self.title, description: description, phase: @phase, progress: progress}, "working") if should_notify?
42
52
  end
43
-
44
53
  end
45
54
  end
46
55
  end
@@ -1,3 +1,3 @@
1
1
  module Dronejob
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dronejob
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Strebitzer