bpm_manager 0.9.7 → 0.9.8

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
  SHA1:
3
- metadata.gz: 32df44da9683da124d48f2e91ddc01a29a063879
4
- data.tar.gz: 0db0e19a356e36f03f1cc8a2ee43d600a32f6d18
3
+ metadata.gz: 622fff9c4c04954799ef7c8f3ddf1803d7a000e8
4
+ data.tar.gz: deec1eefb19be045200bfc3936b5bde59ef3cc44
5
5
  SHA512:
6
- metadata.gz: 5650cdb0ebf13ac4b5bfb05cf12ddf03f442561f7f9572bd51cc0b5786aaf4c95590772de799312226b49b721504de229b48e5bfe1f1fd875295e6be498cd6e9
7
- data.tar.gz: e876beb1fcf85e101a119cb986ef5b1f4e9d6c6c7fa9081462f660ed0430333965f35f81142f130a20efd6ce35a74d92eaf8053b05e64baef5e847198fac6466
6
+ metadata.gz: 2744792511bc0734d427abe0a235ce4836d6ab666b17de00e241cebcc65ad5d5f03df013e10d1345fa1e144e1e8b7567ebb272557d5183790a3b21821a7ba45a
7
+ data.tar.gz: 2b23b86efe59884ecf7e3a996003ba6fbe3a6258cae0007bbed0d525d1e389d602235b51bf6566a21a3e2c2564dfb1db1388d954a03dcc2eb0d6495e3eab5f9d
@@ -149,17 +149,17 @@ module BpmManager
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
151
 
152
- sla_hours > 0 ? (start.to_f + sla_hours) * ((100 - offset) / 100) <= Time.now.utc.to_f ? 0 : (start.to_f + sla_hours <= Time.now.utc.to_f ? 1 : 2) : 0
152
+ sla_hours > 0 ? (start + sla_hours) * ((100 - offset) / 100) <= Time.now.utc ? 0 : (start + sla_hours <= Time.now.utc ? 1 : 2) : 0
153
153
  end
154
154
  private_class_method :calculate_sla
155
155
 
156
156
  def self.calculate_sla_percent(start, sla_hours=0, offset=20)
157
157
  sla_hours = sla_hours.to_f * 3600 # converts to seconds
158
158
  percent = OpenStruct.new
159
- total = Time.now.utc.to_f - start.to_f
159
+ total = Time.now.utc - start
160
160
 
161
- percent.green = sla_hours > 0 ? ((start.to_f + sla_hours) * (100 - offset) / 100) * 100 / total : 100
162
- percent.yellow = sla_hours > 0 ? ((start.to_f + sla_hours) * 100 / total) - percent.green : 0
161
+ percent.green = sla_hours > 0 ? ((start + sla_hours) * (100 - offset) / 100) * 100 / total : 100
162
+ percent.yellow = sla_hours > 0 ? ((start + sla_hours) * 100 / total) - percent.green : 0
163
163
  percent.red = sla_hours > 0 ? 100 - percent.yellow - percent.green : 0
164
164
 
165
165
  return percent
@@ -1,3 +1,3 @@
1
1
  module BpmManager
2
- VERSION = "0.9.7"
2
+ VERSION = "0.9.8"
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.7
4
+ version: 0.9.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Presa