Commit 4bdcb547b851b5efe1b50e83ac67e26e5574385b
1 parent
d272b2e2
Exists in
master
and in
1 other branch
Rubocop: use "when then" instead "when;"
Showing
3 changed files
with
6 additions
and
13 deletions
Show diff stats
.rubocop_todo.yml
@@ -577,13 +577,6 @@ Style/UnneededPercentQ: | @@ -577,13 +577,6 @@ Style/UnneededPercentQ: | ||
577 | Exclude: | 577 | Exclude: |
578 | - 'spec/models/notice_spec.rb' | 578 | - 'spec/models/notice_spec.rb' |
579 | 579 | ||
580 | -# Offense count: 6 | ||
581 | -# Cop supports --auto-correct. | ||
582 | -Style/WhenThen: | ||
583 | - Exclude: | ||
584 | - - 'app/models/problem.rb' | ||
585 | - - 'lib/hoptoad.rb' | ||
586 | - | ||
587 | # Offense count: 10 | 580 | # Offense count: 10 |
588 | # Cop supports --auto-correct. | 581 | # Cop supports --auto-correct. |
589 | # Configuration parameters: WordRegex. | 582 | # Configuration parameters: WordRegex. |
app/models/problem.rb
@@ -216,11 +216,11 @@ class Problem | @@ -216,11 +216,11 @@ class Problem | ||
216 | 216 | ||
217 | def self.ordered_by(sort, order) | 217 | def self.ordered_by(sort, order) |
218 | case sort | 218 | case sort |
219 | - when "app"; order_by(["app_name", order]) | ||
220 | - when "message"; order_by(["message", order]) | ||
221 | - when "last_notice_at"; order_by(["last_notice_at", order]) | ||
222 | - when "last_deploy_at"; order_by(["last_deploy_at", order]) | ||
223 | - when "count"; order_by(["notices_count", order]) | 219 | + when "app" then order_by(["app_name", order]) |
220 | + when "message" then order_by(["message", order]) | ||
221 | + when "last_notice_at" then order_by(["last_notice_at", order]) | ||
222 | + when "last_deploy_at" then order_by(["last_deploy_at", order]) | ||
223 | + when "count" then order_by(["notices_count", order]) | ||
224 | else raise("\"#{sort}\" is not a recognized sort") | 224 | else raise("\"#{sort}\" is not a recognized sort") |
225 | end | 225 | end |
226 | end | 226 | end |
lib/hoptoad.rb
@@ -17,7 +17,7 @@ module Hoptoad | @@ -17,7 +17,7 @@ module Hoptoad | ||
17 | 17 | ||
18 | def self.get_version_processor(version) | 18 | def self.get_version_processor(version) |
19 | case version | 19 | case version |
20 | - when /2\.[01234]/; Hoptoad::V2 | 20 | + when /2\.[01234]/ then Hoptoad::V2 |
21 | else; raise ApiVersionError | 21 | else; raise ApiVersionError |
22 | end | 22 | end |
23 | end | 23 | end |