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>
Gemfile
... ... @@ -28,7 +28,7 @@ gem &#39;jbuilder&#39;, &#39;~&gt; 2.0&#39;
28 28 gem 'devise', '~> 3.5.1'
29 29  
30 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 33 # PostgreSQL integration
34 34 gem "pg", "~> 0.18.1"
... ...
Gemfile.lock
  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 10 GEM
2 11 remote: https://rubygems.org/
3 12 specs:
... ... @@ -121,7 +130,7 @@ GEM
121 130 railties (>= 3.0.0)
122 131 faraday (0.9.1)
123 132 multipart-post (>= 1.2, < 3)
124   - faraday_middleware (0.9.2)
  133 + faraday_middleware (0.10.0)
125 134 faraday (>= 0.7.4, < 0.10)
126 135 gherkin (2.12.2)
127 136 multi_json (~> 1.3)
... ... @@ -148,9 +157,6 @@ GEM
148 157 railties (>= 3.2)
149 158 sprockets-rails
150 159 json (1.8.3)
151   - kalibro_client (1.3.0)
152   - activesupport (>= 2.2.1)
153   - faraday_middleware (~> 0.9.0)
154 160 konacha (3.5.1)
155 161 actionpack (>= 3.1, < 5)
156 162 capybara
... ... @@ -348,7 +354,7 @@ DEPENDENCIES
348 354 jquery-rails
349 355 jquery-ui-rails (~> 5.0.0)
350 356 js-routes (~> 1.1.0)
351   - kalibro_client (~> 1.3.0)
  357 + kalibro_client!
352 358 konacha
353 359 less-rails (~> 2.7.0)
354 360 mocha
... ...
app/helpers/processings_helper.rb
... ... @@ -9,17 +9,7 @@ module ProcessingsHelper
9 9  
10 10 def find_range_snapshot(metric_result)
11 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 13 end
24 14  
25 15 def format_module_name(module_name)
... ...