Commit 3332d2e7409fc9ed9c4b0761f078a9ad53303386

Authored by Caio Salgado + Alessandro Palmeira
Committed by Paulo Meireles
1 parent 2833c8bd

[Mezuro] Updated function names from rebase.

plugins/mezuro/lib/kalibro/entities/metric_result.rb
@@ -5,9 +5,9 @@ class Kalibro::Entities::MetricResult < Kalibro::Entities::Entity @@ -5,9 +5,9 @@ class Kalibro::Entities::MetricResult < Kalibro::Entities::Entity
5 def metric=(value) 5 def metric=(value)
6 if value.kind_of?(Hash) 6 if value.kind_of?(Hash)
7 if value.has_key?(:script) 7 if value.has_key?(:script)
8 - @metric = to_entity(value, Kalibro::Entities::CompoundMetric) 8 + @metric = to_entity(value, Kalibro::CompoundMetric)
9 else 9 else
10 - @metric = to_entity(value, Kalibro::Entities::NativeMetric) 10 + @metric = to_entity(value, Kalibro::NativeMetric)
11 end 11 end
12 else 12 else
13 @metric = value 13 @metric = value
plugins/mezuro/lib/kalibro/module_result.rb
@@ -22,7 +22,7 @@ class Kalibro::ModuleResult < Kalibro::Model @@ -22,7 +22,7 @@ class Kalibro::ModuleResult < Kalibro::Model
22 :project_name => project_name, 22 :project_name => project_name,
23 :module_name => module_name, 23 :module_name => module_name,
24 })[:module_result] 24 })[:module_result]
25 - to_entity_array(response) 25 + to_objects_array(response)
26 end 26 end
27 27
28 #FIXME change Kalibro::Entities::Module 28 #FIXME change Kalibro::Entities::Module
@@ -45,15 +45,6 @@ class Kalibro::ModuleResult < Kalibro::Model @@ -45,15 +45,6 @@ class Kalibro::ModuleResult < Kalibro::Model
45 end 45 end
46 46
47 private 47 private
48 -  
49 - def self.to_entity_array(value)  
50 - array = value.kind_of?(Array) ? value : [value]  
51 - array.each.collect { |element| to_entity(element) }  
52 - end  
53 -  
54 - def self.to_entity(value)  
55 - value.kind_of?(Hash) ? new(value) : value  
56 - end  
57 48
58 def self.date_with_milliseconds(date) 49 def self.date_with_milliseconds(date)
59 milliseconds = "." + (date.sec_fraction * 60 * 60 * 24 * 1000).to_s 50 milliseconds = "." + (date.sec_fraction * 60 * 60 * 24 * 1000).to_s
plugins/mezuro/test/fixtures/module_result_fixtures.rb
@@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/compound_metric_with_error_fixtures' @@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/compound_metric_with_error_fixtures'
5 class ModuleResultFixtures 5 class ModuleResultFixtures
6 6
7 def self.module_result 7 def self.module_result
8 - fixture = Kalibro::ModuleResult.new( module_result_hash ) 8 + Kalibro::ModuleResult.new( module_result_hash )
9 end 9 end
10 10
11 def self.module_result_hash 11 def self.module_result_hash