From 5d122f292231d3a38e6e9c623a60721a8e0de3cc Mon Sep 17 00:00:00 2001 From: Wasif Hossain Date: Tue, 23 Apr 2019 02:06:12 +0600 Subject: [PATCH] Fix rubocop offenses --- Gemfile | 4 ++-- test/benchmark/config.ru | 2 ++ test/support/ruby_2_6_rails_4_2_patch.rb | 16 +++++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Gemfile b/Gemfile index dd3185b6..dc08274e 100644 --- a/Gemfile +++ b/Gemfile @@ -53,7 +53,7 @@ group :bench do end group :test do - platforms *(@windows_platforms + [:ruby]) do + platforms(*(@windows_platforms + [:ruby])) do if version == 'master' || version >= '6' gem 'sqlite3', '~> 1.4' else @@ -71,7 +71,7 @@ group :test do gem 'm', '~> 1.5' gem 'pry', '>= 0.10' gem 'byebug', '~> 8.2' if RUBY_VERSION < '2.2' - gem 'pry-byebug', platform: :ruby + gem 'pry-byebug', platforms: :ruby end group :development, :test do diff --git a/test/benchmark/config.ru b/test/benchmark/config.ru index 908eb28c..7b0654bb 100644 --- a/test/benchmark/config.ru +++ b/test/benchmark/config.ru @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require File.expand_path(['..', 'app'].join(File::SEPARATOR), __FILE__) run Rails.application diff --git a/test/support/ruby_2_6_rails_4_2_patch.rb b/test/support/ruby_2_6_rails_4_2_patch.rb index e4de2432..9e250339 100644 --- a/test/support/ruby_2_6_rails_4_2_patch.rb +++ b/test/support/ruby_2_6_rails_4_2_patch.rb @@ -2,15 +2,17 @@ if RUBY_VERSION >= '2.6.0' if Rails::VERSION::MAJOR < 5 - class ActionController::TestResponse < ActionDispatch::TestResponse - def recycle! - # hack to avoid MonitorMixin double-initialize error: - @mon_mutex_owner_object_id = nil - @mon_mutex = nil - initialize + module ActionController + class TestResponse < ActionDispatch::TestResponse + def recycle! + # HACK: to avoid MonitorMixin double-initialize error: + @mon_mutex_owner_object_id = nil + @mon_mutex = nil + initialize + end end end else - puts "Monkeypatch for ActionController::TestResponse no longer needed" + puts 'Monkeypatch for ActionController::TestResponse no longer needed' end end