Skip to content

Commit 6fce204

Browse files
authored
Merge pull request #664 from jgraichen/f/rubocop
2 parents 7dfe466 + 9f82c3f commit 6fce204

8 files changed

Lines changed: 13 additions & 13 deletions

File tree

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# vim: ft=yaml
22

3-
require:
3+
plugins:
44
- rubocop-performance
55
- rubocop-rails
66

Rakefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ namespace :i18n do
2424
# identifiers (e.g. pt_BR), but Redmine needs dashed identifiers
2525
# (pt-bR). We need convert each top-level key to use dashes.
2626
#
27-
# rubocop: We cannot modify a hash when iterating using
28-
# `#each_key`. Therefore, we must us `keys.each` here.
27+
# We cannot modify a hash while iterating using `#each_key`.
28+
# Therefore, we must us `keys.each` here.
2929
data.keys.each do |key|
3030
if key.include?('_')
3131
data[key.tr('_', '-')] = data.delete(key)
@@ -39,7 +39,7 @@ namespace :i18n do
3939
# export a `one` key when only an `other` key is needed, such as
4040
# for Japanese.
4141
#
42-
# This method searches the locale data for any nested dicitonary
42+
# This method searches the locale data for any nested dictionary
4343
# that looks like a pluralized section (contains only `one`,
4444
# `few`, `other` `many`, `zero` keys). If found, an `one` key
4545
# will be added with the `other` value.

app/controllers/rdb_taskboard_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def move
1919
end
2020

2121
# Show dialog if more than one status are available
22-
return render 'rdb_dashboard/taskboard/column_dialog' if @statuses.count > 1
22+
return render 'rdb_dashboard/taskboard/column_dialog' if @statuses.many?
2323

2424
params[:status] = @statuses.first.id
2525
update

app/helpers/rdb_dashboard_helper.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ def render_rdb_menu(id, title, options = {}, &container)
1919
concat link
2020
end
2121

22-
slim_tag :div, class: "rdb-container #{options[:right] ? 'rdb-container-right' : ''}" do
23-
slim_tag :div, class: "rdb-container-wrapper #{options[:icons] ? 'rdb-icons' : ''}" do
22+
slim_tag :div, class: "rdb-container #{'rdb-container-right' if options[:right]}" do
23+
slim_tag :div, class: "rdb-container-wrapper #{'rdb-icons' if options[:icons]}" do
2424
if options[:inlet]
2525
slim_tag(:div, class: 'rdb-container-inlet', &container)
2626
else
@@ -37,7 +37,7 @@ def render_rdb_menu_list(items = nil, options = {})
3737
items = nil
3838
end
3939

40-
slim_tag :div, class: "rdb-list #{options[:async] ? 'rdb-async' : ''} #{options[:class]}" do
40+
slim_tag :div, class: "rdb-list #{'rdb-async' if options[:async]} #{options[:class]}" do
4141
slim_tag :h3, options[:title] if options[:title]
4242
slim_tag options[:list_tag] || :ul, class: options[:list_class] do
4343
if items

app/models/rdb_category_filter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def update(params)
4343

4444
def title
4545
return I18n.t(:rdb_filter_category_all) if all?
46-
return I18n.t(:rdb_filter_category_multiple) if values.count > 1
46+
return I18n.t(:rdb_filter_category_multiple) if values.many?
4747

4848
board.issue_categories.find_by(id: value).try(:name)
4949
end

app/models/rdb_group.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def visible?
4343
board.columns.each_value do |column|
4444
next if !column.visible? || column.compact?
4545

46-
throw :visible, true if filter(column.issues).count > 0
46+
throw :visible, true if filter(column.issues).any?
4747
end
4848
false
4949
end

app/models/rdb_taskboard.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def build
5858
false
5959
end
6060

61-
if done_statuses.count == 1
61+
if done_statuses.one?
6262
status = done_statuses.first
6363
add_column RdbColumn.new(
6464
"s#{status.id}",
@@ -67,7 +67,7 @@ def build
6767
compact: options[:hide_done],
6868
hide: options[:hide_columns].include?("s#{status.id}"),
6969
)
70-
elsif done_statuses.count > 0
70+
elsif done_statuses.any?
7171
add_column RdbColumn.new(
7272
'sX',
7373
:rdb_column_done,

app/models/rdb_tracker_filter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def update(params)
4545

4646
def title
4747
return I18n.t(:rdb_filter_tracker_all) if all?
48-
return I18n.t(:rdb_filter_tracker_multiple) if values.count > 1
48+
return I18n.t(:rdb_filter_tracker_multiple) if values.many?
4949

5050
board.trackers.find(value).name
5151
end

0 commit comments

Comments
 (0)