bpm_manager 0.9.9 → 0.9.10

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: f7f876541b39e60726f2644add52fa577b12028d
4
- data.tar.gz: 096681dcbc632614fb2effe487c0f135143f0098
3
+ metadata.gz: 8c61895e4bada0ee5102c2d9c506421f32b1121a
4
+ data.tar.gz: bb1585e4cb189df3c8c570195ca0f081ca7ada5e
5
5
  SHA512:
6
- metadata.gz: 612ceebb30f46fc50ffb6f2f45f0ffd19d28bc6b9c723ed70ce377260ed50f203b2ac6792e5680e3c022987b4d8c3f0bffa2f886a75220ebbb699a4b8f1a9bdc
7
- data.tar.gz: dd91fa634f1a5ca1265cdced29443e30bed2eb0443b8745f932139f78f3310bda563b2a263b970d515fe664bf1b03c12c1e0e0a266d5a65732e59650374df8bd
6
+ metadata.gz: 606831ca1c306ba5e2d07ee14eaac10bc8b493c814002bdd90f1dd440dd40f30fec554150e6701355c92ac12344498342c21009fbaab481cce58a1345a678a15
7
+ data.tar.gz: ec135ee4c4bed56e3ed9044aea87e116d0c19c0744f88a11aba6cbac19f7c3c1b3f9df2d23169369665012f8d3c6b5107e542e2835e58db557b05a004ec87aa9
@@ -128,7 +128,7 @@ module BpmManager
128
128
 
129
129
  unless my_task.nil?
130
130
  sla = OpenStruct.new(:task => OpenStruct.new, :process => OpenStruct.new)
131
-
131
+
132
132
  # Calculates the process sla
133
133
  sla.process.status = calculate_sla(my_task.process.start_on, process_sla_hours, warning_offset_percent)
134
134
  sla.process.status_name = (calculate_sla(my_task.process.start_on, process_sla_hours, warning_offset_percent) == 0) ? 'ok' : (calculate_sla(my_task.process.start_on, process_sla_hours, warning_offset_percent) == 1 ? 'warning' : 'due')
@@ -148,14 +148,14 @@ module BpmManager
148
148
  # Private class methods
149
149
  def self.calculate_sla(start, sla_hours = 0.0, offset = 20)
150
150
  sla_hours = sla_hours.to_f * 3600 # converts to seconds
151
- sla_hours > 0 ? Time.at((start.utc + sla_hours).to_f * ((100 - offset) / 100)) <= Time.now.utc ? 0 : (start.utc + sla_hours <= Time.now.utc ? 1 : 2) : 0
151
+ sla_hours > 0 ? Time.at((start.utc + sla_hours).to_f * ((100 - offset) / 100)) >= Time.now.utc ? 0 : (start.utc + sla_hours >= Time.now.utc ? 1 : 2) : 0
152
152
  end
153
153
  private_class_method :calculate_sla
154
154
 
155
155
  def self.calculate_sla_percent(start, sla_hours=0, offset=20)
156
156
  sla_hours = sla_hours.to_f * 3600 # converts to seconds
157
157
  percent = OpenStruct.new
158
- total = Time.now.utc - start.utc
158
+ total = (Time.now.utc - start.utc).to_f
159
159
 
160
160
  percent.green = sla_hours > 0 ? ((start.utc + sla_hours).to_f * (100 - offset) / 100) * 100 / total : 100
161
161
  percent.yellow = sla_hours > 0 ? ((start.utc + sla_hours).to_f * 100 / total) - percent.green : 0
@@ -1,3 +1,3 @@
1
1
  module BpmManager
2
- VERSION = "0.9.9"
2
+ VERSION = "0.9.10"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bpm_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Presa