HornsAndHooves-slackiq 1.1.8 → 1.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/slackiq/time_helper.rb +6 -2
- data/lib/slackiq/version.rb +1 -1
- data/lib/slackiq.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e2654f9c8e79d968f1c8a67199095a7b510ca8ad6b7bffd996450b6a593f736
|
4
|
+
data.tar.gz: 6df536b9bf6743f581be49f48b7e6121b8699a780a74f0d9913fc6acb8501b0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df066fda791ed099d60a9a064ddc48b1552d132405c619454dff89792903c1aae7ea7e0aebd8cb107d147a751b8a829cc7eb3f623212e181d8ba7de18b2e933c
|
7
|
+
data.tar.gz: f30055ad833ce76b42ce12224f641280e17b1320e6018d5b79699194bc07c1364c789982caa71a13e879808f99f94161a8767dc31df9a36dec9031bb64a242da
|
data/Gemfile
CHANGED
data/lib/slackiq/time_helper.rb
CHANGED
@@ -12,7 +12,7 @@ module Slackiq
|
|
12
12
|
def elapsed_seconds(t0, t1)
|
13
13
|
dt0 = t0.to_datetime
|
14
14
|
dt1 = t1.to_datetime
|
15
|
-
((dt1-dt0)*24*60*60).
|
15
|
+
((dt1-dt0)*24*60*60).to_f.round(2)
|
16
16
|
end
|
17
17
|
|
18
18
|
# http://stackoverflow.com/questions/4136248/how-to-generate-a-human-readable-time-range-using-ruby-on-rails
|
@@ -20,7 +20,11 @@ module Slackiq
|
|
20
20
|
[[60, :s], [60, :m], [24, :h], [1000, :d]].map{ |count, name|
|
21
21
|
if secs > 0
|
22
22
|
secs, n = secs.divmod(count)
|
23
|
-
|
23
|
+
if name == :s
|
24
|
+
"%.2f#{name}" % [n.to_f]
|
25
|
+
else
|
26
|
+
"#{n.to_i}#{name}"
|
27
|
+
end
|
24
28
|
end
|
25
29
|
}.compact.reverse.join(' ')
|
26
30
|
end
|
data/lib/slackiq/version.rb
CHANGED
data/lib/slackiq.rb
CHANGED
@@ -28,7 +28,10 @@ module Slackiq
|
|
28
28
|
status = options[:status]
|
29
29
|
|
30
30
|
if (bid = options[:bid]) && status.nil?
|
31
|
-
raise
|
31
|
+
raise <<~EOT.chomp unless defined?(Sidekiq::Batch::Status)
|
32
|
+
Sidekiq::Batch::Status is not defined. \
|
33
|
+
Are you sure Sidekiq Pro is set up correctly?
|
34
|
+
EOT
|
32
35
|
status = Sidekiq::Batch::Status.new(bid)
|
33
36
|
end
|
34
37
|
|