Commit 7b76f7a9e5670dff5a3e5c089946df0c84276a7d
Exists in
colab
and in
4 other branches
Merge pull request #309 from mezuro/update_client
Update kalibro_client
Showing
9 changed files
with
21 additions
and
17 deletions
Show diff stats
.travis.yml
@@ -9,8 +9,8 @@ before_script: | @@ -9,8 +9,8 @@ before_script: | ||
9 | - pushd kalibro_install | 9 | - pushd kalibro_install |
10 | # Remove bugged libzmq3 package, see https://github.com/travis-ci/travis-ci/issues/982 and https://github.com/travis-ci/travis-ci/issues/1715 for details | 10 | # Remove bugged libzmq3 package, see https://github.com/travis-ci/travis-ci/issues/982 and https://github.com/travis-ci/travis-ci/issues/1715 for details |
11 | - sudo apt-get remove libzmq3 | 11 | - sudo apt-get remove libzmq3 |
12 | - - export KALIBRO_PROCESSOR_VERSION=v1.1.4 | ||
13 | - - export KALIBRO_CONFIGURATIONS_VERSION=v1.2.4 | 12 | + - export KALIBRO_PROCESSOR_VERSION=v1.1.7.rc1 |
13 | + - export KALIBRO_CONFIGURATIONS_VERSION=v2.0.0 | ||
14 | - bash install.sh | 14 | - bash install.sh |
15 | - popd | 15 | - popd |
16 | - cp config/database.yml.sample config/database.yml | 16 | - cp config/database.yml.sample config/database.yml |
Gemfile
@@ -28,7 +28,7 @@ gem 'jbuilder', '~> 2.0' | @@ -28,7 +28,7 @@ gem 'jbuilder', '~> 2.0' | ||
28 | gem 'devise', '~> 3.5.1' | 28 | gem 'devise', '~> 3.5.1' |
29 | 29 | ||
30 | # Kalibro integration | 30 | # Kalibro integration |
31 | -gem 'kalibro_client', '~> 2.1.2' | 31 | +gem 'kalibro_client', '~> 3.0.0' |
32 | 32 | ||
33 | # PostgreSQL integration | 33 | # PostgreSQL integration |
34 | gem "pg", "~> 0.18.1" | 34 | gem "pg", "~> 0.18.1" |
Gemfile.lock
@@ -154,7 +154,7 @@ GEM | @@ -154,7 +154,7 @@ GEM | ||
154 | railties (>= 3.2) | 154 | railties (>= 3.2) |
155 | sprockets-rails | 155 | sprockets-rails |
156 | json (1.8.3) | 156 | json (1.8.3) |
157 | - kalibro_client (2.1.2) | 157 | + kalibro_client (3.0.0) |
158 | activesupport (>= 2.2.1) | 158 | activesupport (>= 2.2.1) |
159 | faraday_middleware (~> 0.10.0) | 159 | faraday_middleware (~> 0.10.0) |
160 | konacha (3.7.0) | 160 | konacha (3.7.0) |
@@ -188,7 +188,7 @@ GEM | @@ -188,7 +188,7 @@ GEM | ||
188 | metaclass (0.0.4) | 188 | metaclass (0.0.4) |
189 | mime-types (2.6.2) | 189 | mime-types (2.6.2) |
190 | mini_portile (0.6.2) | 190 | mini_portile (0.6.2) |
191 | - minitest (5.8.1) | 191 | + minitest (5.8.4) |
192 | mocha (1.1.0) | 192 | mocha (1.1.0) |
193 | metaclass (~> 0.0.1) | 193 | metaclass (~> 0.0.1) |
194 | multi_json (1.11.2) | 194 | multi_json (1.11.2) |
@@ -356,7 +356,7 @@ DEPENDENCIES | @@ -356,7 +356,7 @@ DEPENDENCIES | ||
356 | jquery-rails | 356 | jquery-rails |
357 | jquery-ui-rails (~> 5.0.0) | 357 | jquery-ui-rails (~> 5.0.0) |
358 | js-routes (~> 1.1.0) | 358 | js-routes (~> 1.1.0) |
359 | - kalibro_client (~> 2.1.2) | 359 | + kalibro_client (~> 3.0.0) |
360 | konacha | 360 | konacha |
361 | less-rails (~> 2.7.0) | 361 | less-rails (~> 2.7.0) |
362 | mocha | 362 | mocha |
app/controllers/compound_metric_configurations_controller.rb
@@ -8,7 +8,7 @@ class CompoundMetricConfigurationsController < BaseMetricConfigurationsControlle | @@ -8,7 +8,7 @@ class CompoundMetricConfigurationsController < BaseMetricConfigurationsControlle | ||
8 | end | 8 | end |
9 | 9 | ||
10 | def metric_configuration_params | 10 | def metric_configuration_params |
11 | - params.require(:metric_configuration).permit(:reading_group_id, :weight, :metric => [:name, :description, :script, :scope, :code]) | 11 | + params.require(:metric_configuration).permit(:reading_group_id, :weight, :metric => [:name, :description, :script, :code, :scope => [:type]]) |
12 | end | 12 | end |
13 | 13 | ||
14 | def set_metric_configurations | 14 | def set_metric_configurations |
app/helpers/kalibro_modules_helper.rb
@@ -17,7 +17,7 @@ module KalibroModulesHelper | @@ -17,7 +17,7 @@ module KalibroModulesHelper | ||
17 | if (a.kalibro_module.granularity == b.kalibro_module.granularity) | 17 | if (a.kalibro_module.granularity == b.kalibro_module.granularity) |
18 | a.kalibro_module.name <=> b.kalibro_module.name | 18 | a.kalibro_module.name <=> b.kalibro_module.name |
19 | else | 19 | else |
20 | - (ComparableGranularity.new(b.kalibro_module.granularity.to_sym) <=> ComparableGranularity.new(a.kalibro_module.granularity.to_sym)) | 20 | + (ComparableGranularity.new(b.kalibro_module.granularity.type) <=> ComparableGranularity.new(a.kalibro_module.granularity.type)) |
21 | end | 21 | end |
22 | end | 22 | end |
23 | end | 23 | end |
app/views/compound_metric_configurations/_metric_options.html.erb
@@ -36,8 +36,10 @@ | @@ -36,8 +36,10 @@ | ||
36 | 36 | ||
37 | <div class="form-row"> | 37 | <div class="form-row"> |
38 | <div class="field-container"> | 38 | <div class="field-container"> |
39 | - <%= f.label :scope, compound_metric_human_attribute_name('scope'), class: 'control-label' %> | ||
40 | - <%= f.select( :scope, scope_options, {class: 'form-control', selected: (metric.scope unless metric.nil?)} ) %> | 39 | + <%= f.fields_for :scope do |scope_form| %> |
40 | + <%= scope_form.label :type, compound_metric_human_attribute_name('scope'), class: 'control-label' %> | ||
41 | + <%= scope_form.select( :type, scope_options, {class: 'form-control', selected: (metric.scope.type unless metric.nil?)} ) %> | ||
42 | + <% end %> | ||
41 | </div> | 43 | </div> |
42 | <div class="help-container"> | 44 | <div class="help-container"> |
43 | <p> | 45 | <p> |
app/views/modules/_module_result.html.erb
@@ -7,6 +7,6 @@ | @@ -7,6 +7,6 @@ | ||
7 | <% end %> | 7 | <% end %> |
8 | <%= link_to format_module_name(module_result.kalibro_module.name), "#module_#{module_result.id}", onClick: "Module.Tree.load('#{escape_javascript(image_tag 'loader.gif')} #{escape_javascript(t('loading_data'))}', #{module_result.id});" %> | 8 | <%= link_to format_module_name(module_result.kalibro_module.name), "#module_#{module_result.id}", onClick: "Module.Tree.load('#{escape_javascript(image_tag 'loader.gif')} #{escape_javascript(t('loading_data'))}', #{module_result.id});" %> |
9 | </td> | 9 | </td> |
10 | - <td><%= module_result.kalibro_module.granularity["type"] %></td> | 10 | + <td><%= module_result.kalibro_module.granularity %></td> |
11 | <td><%= format_grade(module_result.grade) %></td> | 11 | <td><%= format_grade(module_result.grade) %></td> |
12 | </tr> | 12 | </tr> |
app/views/modules/_module_tree.html.erb
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | </p> | 4 | </p> |
5 | <p> | 5 | <p> |
6 | <strong><%= KalibroModule.human_attribute_name('granularity') %>:</strong> | 6 | <strong><%= KalibroModule.human_attribute_name('granularity') %>:</strong> |
7 | - <%= @root_module_result.kalibro_module.granularity["type"] %> | 7 | + <%= @root_module_result.kalibro_module.granularity %> |
8 | </p> | 8 | </p> |
9 | <p> | 9 | <p> |
10 | <strong><%= KalibroModule.human_attribute_name('grade') %>:</strong> | 10 | <strong><%= KalibroModule.human_attribute_name('grade') %>:</strong> |
spec/factories/kalibro_modules.rb
1 | FactoryGirl.define do | 1 | FactoryGirl.define do |
2 | factory :kalibro_module, class: KalibroClient::Entities::Processor::KalibroModule do | 2 | factory :kalibro_module, class: KalibroClient::Entities::Processor::KalibroModule do |
3 | name 'Qt-Calculator' | 3 | name 'Qt-Calculator' |
4 | - granularity 'SOFTWARE' | 4 | + granularity { {'type' => 'SOFTWARE'} } |
5 | 5 | ||
6 | trait :package do | 6 | trait :package do |
7 | - granularity 'PACKAGE' | 7 | + granularity { {'type' => 'PACKAGE'} } |
8 | end | 8 | end |
9 | 9 | ||
10 | trait :class do | 10 | trait :class do |
11 | - granularity 'CLASS' | 11 | + granularity { {'type' => 'CLASS'} } |
12 | end | 12 | end |
13 | 13 | ||
14 | trait :function do | 14 | trait :function do |
15 | - granularity 'FUNCTION' | 15 | + granularity { {'type' => 'FUNCTION'} } |
16 | end | 16 | end |
17 | 17 | ||
18 | trait :method do | 18 | trait :method do |
19 | - granularity 'METHOD' | 19 | + granularity { {'type' => 'METHOD'} } |
20 | end | 20 | end |
21 | 21 | ||
22 | factory :kalibro_module_package, traits: [:package] | 22 | factory :kalibro_module_package, traits: [:package] |
23 | factory :kalibro_module_class, traits: [:class] | 23 | factory :kalibro_module_class, traits: [:class] |
24 | factory :kalibro_module_function, traits: [:function] | 24 | factory :kalibro_module_function, traits: [:function] |
25 | factory :kalibro_module_method, traits: [:method] | 25 | factory :kalibro_module_method, traits: [:method] |
26 | + | ||
27 | + initialize_with { KalibroClient::Entities::Processor::KalibroModule.new({granularity: granularity, name: name}.stringify_keys) } | ||
26 | end | 28 | end |
27 | end | 29 | end |