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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/dronejob/modules/queue.rb +11 -2
- data/lib/dronejob/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a850605973ac67b8964a4bbfc2c503763a2971ab
|
4
|
+
data.tar.gz: be0c29c72a5d089dc2d2a6eaf0a23d1084361d80
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f378b7e017133a338969441a3acb491970591715d90035c85c8db9ac967f80f1fcd4f1ee2764dfa952716d9f76b6445550c5a985f91e7e76399c62da653ca99f
|
7
|
+
data.tar.gz: 4fc9e842d39cb41c95047c602c31878fd28acd42715bedb2b1a4f51fe5a95d39f61976bd9fd9fbfb2a641846f8f2c5186576e5046332c9f3734d11ca0b9e2654
|
data/Gemfile.lock
CHANGED
@@ -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
|
data/lib/dronejob/version.rb
CHANGED