diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2012-04-04 12:29:12 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2012-04-04 12:29:12 +0200 |
commit | 3f357f30e5b4a9a7b5092464a855cd5e09b9861e (patch) | |
tree | 0a153e500af8c41bec38b44c5d78b50ea294a8cf | |
parent | b0cd79dd4de85c6c7b2b1429a10c87b9ec457f3e (diff) | |
download | sonarqube-3f357f30e5b4a9a7b5092464a855cd5e09b9861e.tar.gz sonarqube-3f357f30e5b4a9a7b5092464a855cd5e09b9861e.zip |
Fix compatibility with Ruby 1.9
3 files changed, 16 insertions, 16 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb index 9e8741431e2..08795e95357 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb @@ -353,10 +353,10 @@ class ProfilesController < ApplicationController @sames=[] diffs_by_rule.values.sort.each do |diff| case diff.status - when DIFF_IN1: @in1<<diff - when DIFF_IN2: @in2<<diff - when DIFF_MODIFIED: @modified<<diff - when DIFF_SAME: @sames<<diff + when DIFF_IN1 then @in1<<diff + when DIFF_IN2 then @in2<<diff + when DIFF_MODIFIED then @modified<<diff + when DIFF_SAME then @sames<<diff end end end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/roles_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/roles_helper.rb index 0e805200f43..f714d49b910 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/roles_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/roles_helper.rb @@ -48,12 +48,12 @@ module RolesHelper def role_name(role) case(role.to_s) - when 'admin': 'Administrators' - when 'default-admin': 'Administrators' - when 'user': 'Users' - when 'default-user': 'Users' - when 'codeviewer': 'Code viewers' - when 'default-codeviewer': 'Code viewers' + when 'admin' then 'Administrators' + when 'default-admin' then 'Administrators' + when 'user' then 'Users' + when 'default-user' then 'Users' + when 'codeviewer' then 'Code viewers' + when 'default-codeviewer' then 'Code viewers' else role.to_s end end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/measure_color.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/measure_color.rb index 52e137b9ff4..9c7a21086a3 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/measure_color.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/measure_color.rb @@ -46,15 +46,15 @@ class MeasureColor else if (options[:check_alert_status]||true) && !measure.alert_status.blank? case(measure.alert_status) - when Metric::TYPE_LEVEL_OK : percent=100.0 - when Metric::TYPE_LEVEL_ERROR : percent=0.0 - when Metric::TYPE_LEVEL_WARN : percent=50.0 + when Metric::TYPE_LEVEL_OK then percent=100.0 + when Metric::TYPE_LEVEL_ERROR then percent=0.0 + when Metric::TYPE_LEVEL_WARN then percent=50.0 end elsif measure.metric.value_type==Metric::VALUE_TYPE_LEVEL case(measure.text_value) - when Metric::TYPE_LEVEL_OK : percent=100.0 - when Metric::TYPE_LEVEL_WARN : percent=50.0 - when Metric::TYPE_LEVEL_ERROR : percent=0.0 + when Metric::TYPE_LEVEL_OK then percent=100.0 + when Metric::TYPE_LEVEL_WARN then percent=50.0 + when Metric::TYPE_LEVEL_ERROR then percent=0.0 end elsif measure.value && max_value && min_value percent = value_to_percent(measure.value, min_value, max_value) |