Commit bf4b315efebc4609df8d3458956639a31d8b1e6d
1 parent
a0045dbc
Exists in
master
and in
1 other branch
Rubocop: strip out extra newlines around module body
Showing
6 changed files
with
0 additions
and
20 deletions
Show diff stats
.rubocop_todo.yml
| @@ -159,17 +159,6 @@ Style/EmptyLineBetweenDefs: | @@ -159,17 +159,6 @@ Style/EmptyLineBetweenDefs: | ||
| 159 | - 'spec/decorators/issue_tracker_type_decorator_spec.rb' | 159 | - 'spec/decorators/issue_tracker_type_decorator_spec.rb' |
| 160 | - 'spec/views/problems/show.html.haml_spec.rb' | 160 | - 'spec/views/problems/show.html.haml_spec.rb' |
| 161 | 161 | ||
| 162 | -# Offense count: 9 | ||
| 163 | -# Cop supports --auto-correct. | ||
| 164 | -# Configuration parameters: EnforcedStyle, SupportedStyles. | ||
| 165 | -Style/EmptyLinesAroundModuleBody: | ||
| 166 | - Exclude: | ||
| 167 | - - 'app/helpers/application_helper.rb' | ||
| 168 | - - 'app/helpers/form_helper.rb' | ||
| 169 | - - 'app/helpers/hash_helper.rb' | ||
| 170 | - - 'app/helpers/navigation_helper.rb' | ||
| 171 | - - 'app/helpers/sort_helper.rb' | ||
| 172 | - | ||
| 173 | # Offense count: 22 | 162 | # Offense count: 22 |
| 174 | # Cop supports --auto-correct. | 163 | # Cop supports --auto-correct. |
| 175 | # Configuration parameters: AllowForAlignment. | 164 | # Configuration parameters: AllowForAlignment. |
app/helpers/application_helper.rb
app/helpers/form_helper.rb
| 1 | module FormHelper | 1 | module FormHelper |
| 2 | - | ||
| 3 | def errors_for(document) | 2 | def errors_for(document) |
| 4 | return unless document.errors.any? | 3 | return unless document.errors.any? |
| 5 | 4 | ||
| @@ -14,5 +13,4 @@ module FormHelper | @@ -14,5 +13,4 @@ module FormHelper | ||
| 14 | def label_for_attr(builder, field) | 13 | def label_for_attr(builder, field) |
| 15 | (builder.object_name + field).gsub(/[\[\]]/,'_').squeeze('_') | 14 | (builder.object_name + field).gsub(/[\[\]]/,'_').squeeze('_') |
| 16 | end | 15 | end |
| 17 | - | ||
| 18 | end | 16 | end |
app/helpers/hash_helper.rb
| 1 | module HashHelper | 1 | module HashHelper |
| 2 | - | ||
| 3 | def pretty_hash(hash, nesting = 0) | 2 | def pretty_hash(hash, nesting = 0) |
| 4 | return '{}' if hash.empty? | 3 | return '{}' if hash.empty? |
| 5 | 4 | ||
| @@ -17,5 +16,4 @@ module HashHelper | @@ -17,5 +16,4 @@ module HashHelper | ||
| 17 | nesting -= 1 | 16 | nesting -= 1 |
| 18 | pretty += "\n#{' '*nesting*tab_size}}" | 17 | pretty += "\n#{' '*nesting*tab_size}}" |
| 19 | end | 18 | end |
| 20 | - | ||
| 21 | end | 19 | end |
app/helpers/navigation_helper.rb
| 1 | module NavigationHelper | 1 | module NavigationHelper |
| 2 | - | ||
| 3 | # Returns ' active' if you are on a given controller | 2 | # Returns ' active' if you are on a given controller |
| 4 | # - active_if_here(:users) => ' active' if users controller | 3 | # - active_if_here(:users) => ' active' if users controller |
| 5 | # Or on one of a list of controllers | 4 | # Or on one of a list of controllers |
| @@ -44,5 +43,4 @@ module NavigationHelper | @@ -44,5 +43,4 @@ module NavigationHelper | ||
| 44 | def page_count_from_end(current_page, total_pages) | 43 | def page_count_from_end(current_page, total_pages) |
| 45 | (total_pages.to_i - current_page.to_i) + 1 | 44 | (total_pages.to_i - current_page.to_i) + 1 |
| 46 | end | 45 | end |
| 47 | - | ||
| 48 | end | 46 | end |
app/helpers/sort_helper.rb
| 1 | # encoding: utf-8 | 1 | # encoding: utf-8 |
| 2 | module SortHelper | 2 | module SortHelper |
| 3 | - | ||
| 4 | def link_for_sort(name, field=nil) | 3 | def link_for_sort(name, field=nil) |
| 5 | field ||= name.underscore | 4 | field ||= name.underscore |
| 6 | current = (params_sort == field) | 5 | current = (params_sort == field) |
| @@ -10,5 +9,4 @@ module SortHelper | @@ -10,5 +9,4 @@ module SortHelper | ||
| 10 | options.merge!(:class => "current #{order}") if current | 9 | options.merge!(:class => "current #{order}") if current |
| 11 | link_to(name, url, options) | 10 | link_to(name, url, options) |
| 12 | end | 11 | end |
| 13 | - | ||
| 14 | end | 12 | end |