bpm_manager 0.9.13 → 0.9.14

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: 3d32365d205fa3caf9f8dde5176f45894ada9641
4
- data.tar.gz: 7a9c10fc5c8a62c371efcd6a648d06a823d14532
3
+ metadata.gz: 16dbf474090e8666a761ab34711919b30b4f5857
4
+ data.tar.gz: 245372ec47a9bbdb3f81fb499fdceab8940f417b
5
5
  SHA512:
6
- metadata.gz: e08d29baf879a6013dfb077769c8df452d3193b432476b55b7e7af32d39e33eed81c999c6388f23d41f5f3a4e2a634c52169d6ee9ede1c0f9472e81dffb2e4dd
7
- data.tar.gz: 19773372ddb9796d42219bebdfa9ed6b5e2278df931c33036bf70ff7e527b32b19108a5902440fcc85563dd9368b1e065d287471a6628e15e77109a5ba91cf06
6
+ metadata.gz: da1ff1eec46fe57e7848c13d8a14c6f3e7082802da1f1111cf71fb1b773fa076c227b0adf47096008b9d8c1714e90e091ba820624d8eeb5ec3d20f18f73c7482
7
+ data.tar.gz: 2e0a0b72aa597a50cb990a3cbc0fc18e18d656b48b7285d6a72b9f2fe0c35b72af47d4a45b98818e9cc6d08098232ba86922e2c4cba4a96420c420a8a3ca7984
@@ -132,12 +132,12 @@ module BpmManager
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')
135
- sla.process.percent = calculate_sla_percent(my_task.process.start_on, process_sla_hours, warning_offset_percent)
135
+ sla.process.percentages = calculate_sla_percent(my_task.process.start_on, process_sla_hours, warning_offset_percent)
136
136
 
137
137
  # Calculates the task sla
138
138
  sla.task.status = calculate_sla(my_task.created_on, task_sla_hours, warning_offset_percent)
139
139
  sla.task.status_name = (calculate_sla(my_task.created_on, task_sla_hours, warning_offset_percent) == 0) ? 'ok' : (calculate_sla(my_task.created_on, task_sla_hours, warning_offset_percent) == 1 ? 'warning' : 'due')
140
- sla.task.percent = calculate_sla_percent(my_task.created_on, task_sla_hours, warning_offset_percent)
140
+ sla.task.percentages = calculate_sla_percent(my_task.created_on, task_sla_hours, warning_offset_percent)
141
141
  else
142
142
  sla = nil
143
143
  end
@@ -159,13 +159,13 @@ module BpmManager
159
159
  def self.calculate_sla_percent(start, sla_hours = 0.0, offset = 20)
160
160
  total = (Time.now.utc - start.utc).to_f
161
161
  sla_hours = sla_hours.to_f * 3600 # converts to seconds
162
- percentage = OpenStruct.new
162
+ percent = OpenStruct.new
163
163
 
164
- percentage.green = sla_hours > 0 ? (start.utc + (sla_hours * (100 - offset) / 100)).to_f * 100 / total : 100
165
- percentage.yellow = sla_hours > 0 ? ((start.utc + sla_hours).to_f * 100 / total) - percent.green : 0
166
- percentage.red = sla_hours > 0 ? 100 - percent.yellow - percent.green : 0
164
+ percent.green = sla_hours > 0 ? (start.utc + (sla_hours * (100 - offset) / 100)).to_f * 100 / total : 100
165
+ percent.yellow = sla_hours > 0 ? ((start.utc + sla_hours).to_f * 100 / total) - percent.green : 0
166
+ percent.red = sla_hours > 0 ? 100 - percent.yellow - percent.green : 0
167
167
 
168
- return percentage
168
+ return percent
169
169
  end
170
170
  private_class_method :calculate_sla_percent
171
171
 
@@ -1,3 +1,3 @@
1
1
  module BpmManager
2
- VERSION = "0.9.13"
2
+ VERSION = "0.9.14"
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.13
4
+ version: 0.9.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ariel Presa