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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc830ab389f4f3e9d551dfe18c204975c4975567cbb568d1232950dd7342211c
4
- data.tar.gz: ad3290f716db24d030d8f2bc7196132b70b9973c04790009afeeb825452ecfa5
3
+ metadata.gz: 5e2654f9c8e79d968f1c8a67199095a7b510ca8ad6b7bffd996450b6a593f736
4
+ data.tar.gz: 6df536b9bf6743f581be49f48b7e6121b8699a780a74f0d9913fc6acb8501b0b
5
5
  SHA512:
6
- metadata.gz: eebfd125cfceaf0a9d967e79de21565c55547a8589124b8e61e94f50813142ad4b20dc4169258adef2bd7f218849b9d7ac9a0ee4138049587f6e8ff0173f7e38
7
- data.tar.gz: f33cdb4c155ecaa99a50fbb979c02b9acf0233dab690ecab52168ff1380edc23eed4ca99ce90e3d123a8bf637271a82b5e460dcc7a7f99763a341d494818b42b
6
+ metadata.gz: df066fda791ed099d60a9a064ddc48b1552d132405c619454dff89792903c1aae7ea7e0aebd8cb107d147a751b8a829cc7eb3f623212e181d8ba7de18b2e933c
7
+ data.tar.gz: f30055ad833ce76b42ce12224f641280e17b1320e6018d5b79699194bc07c1364c789982caa71a13e879808f99f94161a8767dc31df9a36dec9031bb64a242da
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in slackiq.gemspec
4
- gemspec
4
+ gemspec
@@ -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).to_i
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
- "#{n.to_i}#{name}"
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
@@ -1,3 +1,3 @@
1
1
  module Slackiq
2
- VERSION = "1.1.8"
2
+ VERSION = "1.1.9"
3
3
  end
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 "Sidekiq::Batch::Status is not defined. Are you sure Sidekiq Pro is set up correctly?" unless defined?(Sidekiq::Batch::Status)
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HornsAndHooves-slackiq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - HornsAndHooves