Commit 9567b36a26f9013c95b287102e2983365ca13719
Committed by
Rafael Manzo
1 parent
b01bb30a
Exists in
colab
and in
4 other branches
Updating kalibro_client gem and factories
Signed off by: Diego Araújo <diegoamc90@gmail.com>
Showing
21 changed files
with
43 additions
and
39 deletions
Show diff stats
Gemfile.lock
1 | 1 | GIT |
2 | 2 | remote: https://github.com/mezuro/kalibro_client |
3 | - revision: 59630ab6b9dbf7a763c6c0ee08404ec4c9acd65b | |
3 | + revision: 190e8b25819846b52eb1faff07f20f3a3ecad4c9 | |
4 | 4 | specs: |
5 | - kalibro_client (0.0.1) | |
6 | - activeresource (~> 4.0.0) | |
5 | + kalibro_client (1.0.0) | |
6 | + activesupport (>= 2.2.1) | |
7 | + faraday_middleware (~> 0.9.0) | |
7 | 8 | |
8 | 9 | GIT |
9 | 10 | remote: https://github.com/seyhunak/twitter-bootstrap-rails.git |
... | ... | @@ -38,10 +39,6 @@ GEM |
38 | 39 | activemodel (= 4.1.8) |
39 | 40 | activesupport (= 4.1.8) |
40 | 41 | arel (~> 5.0.0) |
41 | - activeresource (4.0.0) | |
42 | - activemodel (~> 4.0) | |
43 | - activesupport (~> 4.0) | |
44 | - rails-observers (~> 0.1.1) | |
45 | 42 | activesupport (4.1.8) |
46 | 43 | i18n (~> 0.6, >= 0.6.9) |
47 | 44 | json (~> 1.7, >= 1.7.7) |
... | ... | @@ -131,11 +128,15 @@ GEM |
131 | 128 | factory_girl_rails (4.5.0) |
132 | 129 | factory_girl (~> 4.5.0) |
133 | 130 | railties (>= 3.0.0) |
131 | + faraday (0.9.1) | |
132 | + multipart-post (>= 1.2, < 3) | |
133 | + faraday_middleware (0.9.1) | |
134 | + faraday (>= 0.7.4, < 0.10) | |
134 | 135 | gherkin (2.12.2) |
135 | 136 | multi_json (~> 1.3) |
136 | 137 | google-analytics-rails (0.0.6) |
137 | 138 | hike (1.2.3) |
138 | - i18n (0.6.11) | |
139 | + i18n (0.7.0) | |
139 | 140 | jbuilder (2.2.5) |
140 | 141 | activesupport (>= 3.0.0, < 5) |
141 | 142 | multi_json (~> 1.2) |
... | ... | @@ -144,7 +145,7 @@ GEM |
144 | 145 | thor (>= 0.14, < 2.0) |
145 | 146 | jquery-ui-rails (5.0.3) |
146 | 147 | railties (>= 3.2.16) |
147 | - json (1.8.1) | |
148 | + json (1.8.2) | |
148 | 149 | konacha (3.3.0) |
149 | 150 | actionpack (>= 3.1, < 5) |
150 | 151 | capybara |
... | ... | @@ -157,11 +158,12 @@ GEM |
157 | 158 | metaclass (0.0.4) |
158 | 159 | mime-types (2.4.3) |
159 | 160 | mini_portile (0.6.1) |
160 | - minitest (5.5.0) | |
161 | + minitest (5.5.1) | |
161 | 162 | mocha (1.1.0) |
162 | 163 | metaclass (~> 0.0.1) |
163 | 164 | multi_json (1.10.1) |
164 | 165 | multi_test (0.1.1) |
166 | + multipart-post (2.0.0) | |
165 | 167 | net-scp (1.2.1) |
166 | 168 | net-ssh (>= 2.6.5) |
167 | 169 | net-ssh (2.9.1) |
... | ... | @@ -188,8 +190,6 @@ GEM |
188 | 190 | bundler (>= 1.3.0, < 2.0) |
189 | 191 | railties (= 4.1.8) |
190 | 192 | sprockets-rails (~> 2.0) |
191 | - rails-observers (0.1.2) | |
192 | - activemodel (~> 4.0) | |
193 | 193 | railties (4.1.8) |
194 | 194 | actionpack (= 4.1.8) |
195 | 195 | activesupport (= 4.1.8) | ... | ... |
app/models/kalibro_configuration.rb
app/models/metric_configuration.rb
app/models/mezuro_range.rb
app/models/module_result.rb
app/models/processing.rb
app/models/project.rb
app/models/reading.rb
app/models/reading_group.rb
app/models/repository.rb
features/step_definitions/repository_steps.rb
... | ... | @@ -12,13 +12,17 @@ end |
12 | 12 | |
13 | 13 | Given(/^I have a sample configuration with native metrics$/) do |
14 | 14 | reading_group = FactoryGirl.create(:reading_group, id: nil) |
15 | - reading = FactoryGirl.create(:reading, {id: nil, group_id: reading_group.id}) | |
15 | + reading = FactoryGirl.create(:reading, {id: nil, reading_group_id: reading_group.id}) | |
16 | + | |
17 | + KalibroClient::Processor::MetricCollector.find('Analizo').supported_metrics.select { |x| not x.persisted? }.save | |
18 | + | |
19 | + | |
16 | 20 | @kalibro_configuration = FactoryGirl.create(:kalibro_configuration, id: nil) |
17 | - metric_configuration = FactoryGirl.create(:metric_configuration, | |
21 | + metric_configuration = FactoryGirl.create(:metric_configuration_with_snapshot, | |
18 | 22 | {id: nil, |
19 | 23 | metric: FactoryGirl.build(:loc), |
20 | 24 | reading_group_id: reading_group.id, |
21 | - configuration_id: @kalibro_configuration.id, | |
25 | + kalibro_configuration_id: @kalibro_configuration.id, | |
22 | 26 | code: 'loc'}) |
23 | 27 | range = FactoryGirl.build(:mezuro_range, {id: nil, reading_id: reading.id, beginning: '-INF', :end => 'INF', metric_configuration_id: metric_configuration.id}) |
24 | 28 | range.save | ... | ... |
spec/factories/date_module_results.rb
1 | 1 | FactoryGirl.define do |
2 | - factory :date_module_result, class: KalibroClient::Miscellaneous::DateModuleResult do | |
2 | + factory :date_module_result, class: KalibroClient::Entities::Miscellaneous::DateModuleResult do | |
3 | 3 | date "2011-10-20T18:26:43.151+00:00" |
4 | 4 | module_result {FactoryGirl.build(:module_result)} |
5 | 5 | ... | ... |
spec/factories/metric_collectors.rb
1 | 1 | FactoryGirl.define do |
2 | - factory :metric_collector, class: KalibroClient::Processor::MetricCollector do | |
2 | + factory :metric_collector, class: KalibroClient::Entities::Processor::MetricCollectorDetails do | |
3 | 3 | name 'Analizo' |
4 | 4 | description 'A metric collector' |
5 | 5 | supported_metrics { { "total_abstract_classes" => FactoryGirl.build(:metric), "loc" => FactoryGirl.build(:loc)} } | ... | ... |
spec/factories/metric_configurations.rb
... | ... | @@ -7,7 +7,7 @@ FactoryGirl.define do |
7 | 7 | weight 1 |
8 | 8 | aggregation_form "AVERAGE" |
9 | 9 | reading_group_id 1 |
10 | - configuration_id 1 | |
10 | + kalibro_configuration_id 1 | |
11 | 11 | end |
12 | 12 | |
13 | 13 | factory :compound_metric_configuration, class: MetricConfiguration do |
... | ... | @@ -17,7 +17,7 @@ FactoryGirl.define do |
17 | 17 | weight 1 |
18 | 18 | aggregation_form "AVERAGE" |
19 | 19 | reading_group_id 1 |
20 | - configuration_id 1 | |
20 | + kalibro_configuration_id 1 | |
21 | 21 | end |
22 | 22 | |
23 | 23 | factory :metric_configuration_with_snapshot, class: MetricConfiguration do |
... | ... | @@ -28,7 +28,7 @@ FactoryGirl.define do |
28 | 28 | weight 1 |
29 | 29 | aggregation_form "MEDIAN" |
30 | 30 | reading_group_id 1 |
31 | - configuration_id 1 | |
31 | + kalibro_configuration_id 1 | |
32 | 32 | end |
33 | 33 | |
34 | 34 | end | ... | ... |
spec/factories/metric_configurations_snapshot.rb
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | |
17 | 17 | FactoryGirl.define do |
18 | - factory :metric_configuration_snapshot, class: KalibroClient::Configurations::MetricSnapshot do | |
18 | + factory :metric_configuration_snapshot, class: KalibroClient::Entities::Configurations::MetricSnapshot do | |
19 | 19 | code "code" |
20 | 20 | weight "1.0" |
21 | 21 | aggregation_form 'AVERAGE' | ... | ... |
spec/factories/metric_results.rb
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | |
17 | 17 | FactoryGirl.define do |
18 | - factory :metric_result, class: KalibroClient::Processor::MetricResult do | |
18 | + factory :metric_result, class: KalibroClient::Entities::Processor::MetricResult do | |
19 | 19 | id "42" |
20 | 20 | self.configuration { FactoryGirl.build(:metric_configuration) } |
21 | 21 | value "10.0" | ... | ... |
spec/factories/metrics.rb
1 | 1 | FactoryGirl.define do |
2 | - factory :metric, class: KalibroClient::Processor::NativeMetric do | |
2 | + factory :metric, class: KalibroClient::Entities::Processor::NativeMetric do | |
3 | 3 | name "Total Abstract Classes" |
4 | 4 | code "total_abstract_classes" |
5 | 5 | scope "SOFTWARE" |
... | ... | @@ -9,7 +9,7 @@ FactoryGirl.define do |
9 | 9 | initialize_with { new(name, code, scope, description, languages) } |
10 | 10 | end |
11 | 11 | |
12 | - factory :loc, class: KalibroClient::Processor::NativeMetric do | |
12 | + factory :loc, class: KalibroClient::Entities::Processor::NativeMetric do | |
13 | 13 | name "Lines of Code" |
14 | 14 | code "loc" |
15 | 15 | scope "CLASS" |
... | ... | @@ -19,7 +19,7 @@ FactoryGirl.define do |
19 | 19 | initialize_with { new(name, code, scope, description, languages) } |
20 | 20 | end |
21 | 21 | |
22 | - factory :compound_metric, class: KalibroClient::Processor::CompoundMetric do | |
22 | + factory :compound_metric, class: KalibroClient::Entities::Processor::CompoundMetric do | |
23 | 23 | name "Compound" |
24 | 24 | code "compound" |
25 | 25 | scope "CLASS" | ... | ... |
spec/factories/modules.rb
spec/factories/process_times.rb
1 | 1 | FactoryGirl.define do |
2 | - factory :process_time, class: KalibroClient::Processor::ProcessTime do | |
2 | + factory :process_time, class: KalibroClient::Entities::Processor::ProcessTime do | |
3 | 3 | state "Ready" |
4 | 4 | time "3600" |
5 | 5 | end |
6 | 6 | |
7 | - factory :analyzing_process_time, class: KalibroClient::Processor::ProcessTime do | |
7 | + factory :analyzing_process_time, class: KalibroClient::Entities::Processor::ProcessTime do | |
8 | 8 | state "Analyzing" |
9 | 9 | time "12345" |
10 | 10 | end | ... | ... |
spec/factories/ranges_snapshot.rb
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 | |
17 | 17 | FactoryGirl.define do |
18 | - factory :range_snapshot, class: KalibroClient::Configurations::KalibroRange do | |
18 | + factory :range_snapshot, class: KalibroClient::Entities::Configurations::KalibroRange do | |
19 | 19 | beginning 1.1 |
20 | 20 | self.end 5.1 |
21 | 21 | label "Snapshot" | ... | ... |