Commit 8be8048aba7fd201e909b9fbe0fce98b7793da0d

Authored by Heitor
Committed by Rafael Manzo
1 parent e0e2d8e5

Updated range checking to use kalibro_client implementation

Signed off by: Daniel Miranda <danielkza2@gmail.com>
@@ -28,7 +28,7 @@ gem &#39;jbuilder&#39;, &#39;~&gt; 2.0&#39; @@ -28,7 +28,7 @@ gem &#39;jbuilder&#39;, &#39;~&gt; 2.0&#39;
28 gem 'devise', '~> 3.5.1' 28 gem 'devise', '~> 3.5.1'
29 29
30 # Kalibro integration 30 # Kalibro integration
31 -gem 'kalibro_client', '~> 1.3.0' 31 +gem 'kalibro_client', git: 'https://github.com/mezuro/kalibro_client.git', branch: 'create_kalibro_range_range'
32 32
33 # PostgreSQL integration 33 # PostgreSQL integration
34 gem "pg", "~> 0.18.1" 34 gem "pg", "~> 0.18.1"
  1 +GIT
  2 + remote: https://github.com/mezuro/kalibro_client.git
  3 + revision: 476ed6072156b7be0af0d3f9b61c43aa875bdf86
  4 + branch: create_kalibro_range_range
  5 + specs:
  6 + kalibro_client (1.3.0)
  7 + activesupport (>= 2.2.1)
  8 + faraday_middleware (~> 0.10.0)
  9 +
1 GEM 10 GEM
2 remote: https://rubygems.org/ 11 remote: https://rubygems.org/
3 specs: 12 specs:
@@ -121,7 +130,7 @@ GEM @@ -121,7 +130,7 @@ GEM
121 railties (>= 3.0.0) 130 railties (>= 3.0.0)
122 faraday (0.9.1) 131 faraday (0.9.1)
123 multipart-post (>= 1.2, < 3) 132 multipart-post (>= 1.2, < 3)
124 - faraday_middleware (0.9.2) 133 + faraday_middleware (0.10.0)
125 faraday (>= 0.7.4, < 0.10) 134 faraday (>= 0.7.4, < 0.10)
126 gherkin (2.12.2) 135 gherkin (2.12.2)
127 multi_json (~> 1.3) 136 multi_json (~> 1.3)
@@ -148,9 +157,6 @@ GEM @@ -148,9 +157,6 @@ GEM
148 railties (>= 3.2) 157 railties (>= 3.2)
149 sprockets-rails 158 sprockets-rails
150 json (1.8.3) 159 json (1.8.3)
151 - kalibro_client (1.3.0)  
152 - activesupport (>= 2.2.1)  
153 - faraday_middleware (~> 0.9.0)  
154 konacha (3.5.1) 160 konacha (3.5.1)
155 actionpack (>= 3.1, < 5) 161 actionpack (>= 3.1, < 5)
156 capybara 162 capybara
@@ -348,7 +354,7 @@ DEPENDENCIES @@ -348,7 +354,7 @@ DEPENDENCIES
348 jquery-rails 354 jquery-rails
349 jquery-ui-rails (~> 5.0.0) 355 jquery-ui-rails (~> 5.0.0)
350 js-routes (~> 1.1.0) 356 js-routes (~> 1.1.0)
351 - kalibro_client (~> 1.3.0) 357 + kalibro_client!
352 konacha 358 konacha
353 less-rails (~> 2.7.0) 359 less-rails (~> 2.7.0)
354 mocha 360 mocha
app/helpers/processings_helper.rb
@@ -9,17 +9,7 @@ module ProcessingsHelper @@ -9,17 +9,7 @@ module ProcessingsHelper
9 9
10 def find_range_snapshot(metric_result) 10 def find_range_snapshot(metric_result)
11 range_snapshots = metric_result.metric_configuration.kalibro_ranges 11 range_snapshots = metric_result.metric_configuration.kalibro_ranges
12 -  
13 - range_snapshots.each do |range_snapshot|  
14 - range = Range.new(  
15 - range_snapshot.beginning == '-INF' ? -Float::INFINITY : range_snapshot.beginning.to_f,  
16 - range_snapshot.end == 'INF' ? Float::INFINITY : range_snapshot.end.to_f,  
17 - exclude_end: true  
18 - )  
19 - return range_snapshot if range === metric_result.value  
20 - end  
21 -  
22 - return nil 12 + range_snapshots.detect { |range_snapshot| range_snapshot.range === metric_result.value }
23 end 13 end
24 14
25 def format_module_name(module_name) 15 def format_module_name(module_name)