From 5370fb14089ecab4d45fb78584faa7a31b0aa01d Mon Sep 17 00:00:00 2001 From: Moncef Belyamani Date: Sun, 2 Apr 2017 15:39:59 -0400 Subject: [PATCH] Fix Rubocop offenses --- .rubocop.yml | 4 ++-- Gemfile | 1 - Gemfile.lock | 4 ---- app/helpers/detail_format_helper.rb | 2 +- app/helpers/result_summary_helper.rb | 2 +- config/application.rb | 2 +- spec/rails_helper.rb | 2 +- 7 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index d7deeb00e..9d1a7b036 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -195,7 +195,7 @@ Style/TrailingCommaInArguments: # If `consistent_comma`, the cop requires a comma after the last argument, # for all parenthesized method calls with arguments. EnforcedStyleForMultiline: no_comma - SupportedStyles: + SupportedStylesForMultiline: - comma - consistent_comma - no_comma @@ -206,7 +206,7 @@ Style/TrailingCommaInLiteral: # If `consistent_comma`, the cop requires a comma after the last item of all # non-empty array and hash literals. EnforcedStyleForMultiline: no_comma - SupportedStyles: + SupportedStylesForMultiline: - comma - consistent_comma - no_comma diff --git a/Gemfile b/Gemfile index 3006851ba..b330ed5b0 100644 --- a/Gemfile +++ b/Gemfile @@ -29,7 +29,6 @@ end # dev and debugging tools group :development do gem 'better_errors' - gem 'binding_of_caller', '~> 0.7.2', platforms: [:mri_19, :rbx] gem 'bummr' gem 'derailed' gem 'flamegraph' diff --git a/Gemfile.lock b/Gemfile.lock index 3ae88e148..6675941c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,8 +57,6 @@ GEM coderay (>= 1.0.0) erubis (>= 2.6.6) rack (>= 0.9.0) - binding_of_caller (0.7.2) - debug_inspector (>= 0.0.1) builder (3.2.3) bummr (0.2.0) rainbow @@ -102,7 +100,6 @@ GEM tins (~> 1.6) crack (0.4.3) safe_yaml (~> 1.0.0) - debug_inspector (0.0.2) declarative (0.0.9) declarative-option (0.1.0) derailed (0.1.0) @@ -387,7 +384,6 @@ PLATFORMS DEPENDENCIES actionmailer better_errors - binding_of_caller (~> 0.7.2) bummr capybara compass-rails diff --git a/app/helpers/detail_format_helper.rb b/app/helpers/detail_format_helper.rb index 1925addc7..f50c4af7d 100644 --- a/app/helpers/detail_format_helper.rb +++ b/app/helpers/detail_format_helper.rb @@ -2,7 +2,7 @@ module DetailFormatHelper # List of fields that determine whether or not to show the # Contact section in the details view def location_contact_fields - [:website, :email, :phones] + %i(website email phones) end # Strips http:// or https:// from URL diff --git a/app/helpers/result_summary_helper.rb b/app/helpers/result_summary_helper.rb index a891cb69d..1c01563e8 100644 --- a/app/helpers/result_summary_helper.rb +++ b/app/helpers/result_summary_helper.rb @@ -21,7 +21,7 @@ def map_summary def search_results_page_title search_terms = request.query_parameters. except(:utf8, :service_area). - map { |k, v| "#{k}: #{v}" unless v.blank? }. + map { |k, v| "#{k}: #{v}" if v.present? }. compact.join(', ') "Search results for: #{search_terms}" end diff --git a/config/application.rb b/config/application.rb index 53f9546b0..a0192fcdc 100644 --- a/config/application.rb +++ b/config/application.rb @@ -5,7 +5,7 @@ require 'action_mailer/railtie' require 'sprockets/railtie' -SETTINGS ||= YAML.load(File.read(File.expand_path('../settings.yml', __FILE__))) +SETTINGS ||= YAML.safe_load(File.read(File.expand_path('../settings.yml', __FILE__))) SETTINGS.merge! SETTINGS.fetch(Rails.env, {}) SETTINGS.symbolize_keys! diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index b2eaa39eb..e70eccad7 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -18,7 +18,7 @@ # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. -Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f } +Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f } RSpec.configure do |config| # Helper methods for use with Capybara feature specs.