From 14ece5e4292053e7a40e9bd80c447745f721e217 Mon Sep 17 00:00:00 2001 From: Kir Shatrov Date: Sun, 9 Jul 2017 20:49:52 +0300 Subject: [PATCH] Use frozen-string-literal in ActiveJob --- .rubocop.yml | 1 + activejob/Rakefile | 1 + activejob/activejob.gemspec | 1 + activejob/bin/test | 1 + activejob/lib/active_job.rb | 1 + activejob/lib/active_job/arguments.rb | 1 + activejob/lib/active_job/base.rb | 1 + activejob/lib/active_job/callbacks.rb | 1 + activejob/lib/active_job/configured_job.rb | 1 + activejob/lib/active_job/core.rb | 1 + activejob/lib/active_job/enqueuing.rb | 1 + activejob/lib/active_job/exceptions.rb | 1 + activejob/lib/active_job/execution.rb | 1 + activejob/lib/active_job/gem_version.rb | 1 + activejob/lib/active_job/logging.rb | 1 + activejob/lib/active_job/queue_adapter.rb | 1 + activejob/lib/active_job/queue_adapters.rb | 1 + activejob/lib/active_job/queue_adapters/async_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/backburner_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/inline_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/qu_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/que_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/resque_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/sneakers_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/sucker_punch_adapter.rb | 1 + activejob/lib/active_job/queue_adapters/test_adapter.rb | 1 + activejob/lib/active_job/queue_name.rb | 1 + activejob/lib/active_job/queue_priority.rb | 1 + activejob/lib/active_job/railtie.rb | 1 + activejob/lib/active_job/test_case.rb | 1 + activejob/lib/active_job/test_helper.rb | 1 + activejob/lib/active_job/translation.rb | 1 + activejob/lib/active_job/version.rb | 1 + activejob/lib/rails/generators/job/job_generator.rb | 1 + activejob/test/adapters/async.rb | 1 + activejob/test/adapters/backburner.rb | 1 + activejob/test/adapters/delayed_job.rb | 1 + activejob/test/adapters/inline.rb | 1 + activejob/test/adapters/qu.rb | 1 + activejob/test/adapters/que.rb | 1 + activejob/test/adapters/queue_classic.rb | 1 + activejob/test/adapters/resque.rb | 1 + activejob/test/adapters/sidekiq.rb | 1 + activejob/test/adapters/sneakers.rb | 1 + activejob/test/adapters/sucker_punch.rb | 1 + activejob/test/adapters/test.rb | 1 + activejob/test/cases/adapter_test.rb | 1 + activejob/test/cases/argument_serialization_test.rb | 1 + activejob/test/cases/callbacks_test.rb | 1 + activejob/test/cases/exceptions_test.rb | 1 + activejob/test/cases/job_serialization_test.rb | 1 + activejob/test/cases/logging_test.rb | 1 + activejob/test/cases/queue_adapter_test.rb | 1 + activejob/test/cases/queue_naming_test.rb | 1 + activejob/test/cases/queue_priority_test.rb | 1 + activejob/test/cases/queuing_test.rb | 1 + activejob/test/cases/rescue_test.rb | 1 + activejob/test/cases/test_case_test.rb | 1 + activejob/test/cases/test_helper_test.rb | 1 + activejob/test/cases/translation_test.rb | 1 + activejob/test/helper.rb | 1 + activejob/test/integration/queuing_test.rb | 1 + activejob/test/jobs/application_job.rb | 1 + activejob/test/jobs/callback_job.rb | 1 + activejob/test/jobs/gid_job.rb | 1 + activejob/test/jobs/hello_job.rb | 1 + activejob/test/jobs/inherited_job.rb | 1 + activejob/test/jobs/kwargs_job.rb | 1 + activejob/test/jobs/logging_job.rb | 1 + activejob/test/jobs/nested_job.rb | 1 + activejob/test/jobs/overridden_logging_job.rb | 1 + activejob/test/jobs/provider_jid_job.rb | 1 + activejob/test/jobs/queue_adapter_job.rb | 1 + activejob/test/jobs/queue_as_job.rb | 1 + activejob/test/jobs/rescue_job.rb | 1 + activejob/test/jobs/retry_job.rb | 1 + activejob/test/jobs/translated_hello_job.rb | 1 + activejob/test/models/person.rb | 1 + activejob/test/support/backburner/inline.rb | 1 + activejob/test/support/delayed_job/delayed/backend/test.rb | 1 + activejob/test/support/integration/adapters/async.rb | 1 + activejob/test/support/integration/adapters/backburner.rb | 1 + activejob/test/support/integration/adapters/delayed_job.rb | 1 + activejob/test/support/integration/adapters/inline.rb | 1 + activejob/test/support/integration/adapters/qu.rb | 1 + activejob/test/support/integration/adapters/que.rb | 1 + activejob/test/support/integration/adapters/queue_classic.rb | 1 + activejob/test/support/integration/adapters/resque.rb | 1 + activejob/test/support/integration/adapters/sidekiq.rb | 1 + activejob/test/support/integration/adapters/sneakers.rb | 1 + activejob/test/support/integration/adapters/sucker_punch.rb | 1 + activejob/test/support/integration/dummy_app_template.rb | 1 + activejob/test/support/integration/helper.rb | 1 + activejob/test/support/integration/jobs_manager.rb | 1 + activejob/test/support/integration/test_case_helpers.rb | 1 + activejob/test/support/job_buffer.rb | 1 + activejob/test/support/que/inline.rb | 1 + activejob/test/support/queue_classic/inline.rb | 1 + activejob/test/support/sneakers/inline.rb | 1 + 102 files changed, 102 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 9b5044a6fc..b8b3eb8eea 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -82,6 +82,7 @@ Style/FrozenStringLiteralComment: EnforcedStyle: always Include: - 'activesupport/**/*' + - 'activejob/**/*' # Use `foo {}` not `foo{}`. Layout/SpaceBeforeBlockBraces: diff --git a/activejob/Rakefile b/activejob/Rakefile index dd03ab0b8f..5d0d22e88b 100644 --- a/activejob/Rakefile +++ b/activejob/Rakefile @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rake/testtask" #TODO: add qu back to the list after it support Rails 5.1 diff --git a/activejob/activejob.gemspec b/activejob/activejob.gemspec index bdf23223d1..d3fe7b45e7 100644 --- a/activejob/activejob.gemspec +++ b/activejob/activejob.gemspec @@ -1,3 +1,4 @@ +# frozen_string_literal: true version = File.read(File.expand_path("../RAILS_VERSION", __dir__)).strip Gem::Specification.new do |s| diff --git a/activejob/bin/test b/activejob/bin/test index 470ce93f10..c53377cc97 100755 --- a/activejob/bin/test +++ b/activejob/bin/test @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +# frozen_string_literal: true COMPONENT_ROOT = File.expand_path("..", __dir__) require_relative "../../tools/test" diff --git a/activejob/lib/active_job.rb b/activejob/lib/active_job.rb index 79cad9457d..d6e21bf372 100644 --- a/activejob/lib/active_job.rb +++ b/activejob/lib/active_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true #-- # Copyright (c) 2014-2017 David Heinemeier Hansson # diff --git a/activejob/lib/active_job/arguments.rb b/activejob/lib/active_job/arguments.rb index 523a0e7f33..dde7d7afa6 100644 --- a/activejob/lib/active_job/arguments.rb +++ b/activejob/lib/active_job/arguments.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_support/core_ext/hash" module ActiveJob diff --git a/activejob/lib/active_job/base.rb b/activejob/lib/active_job/base.rb index af76d019c4..96d47ac19f 100644 --- a/activejob/lib/active_job/base.rb +++ b/activejob/lib/active_job/base.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "core" require_relative "queue_adapter" require_relative "queue_name" diff --git a/activejob/lib/active_job/callbacks.rb b/activejob/lib/active_job/callbacks.rb index 9aebc880a5..ab225a93d3 100644 --- a/activejob/lib/active_job/callbacks.rb +++ b/activejob/lib/active_job/callbacks.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_support/callbacks" module ActiveJob diff --git a/activejob/lib/active_job/configured_job.rb b/activejob/lib/active_job/configured_job.rb index 2ff31f2dae..79c197d531 100644 --- a/activejob/lib/active_job/configured_job.rb +++ b/activejob/lib/active_job/configured_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ActiveJob class ConfiguredJob #:nodoc: def initialize(job_class, options = {}) diff --git a/activejob/lib/active_job/core.rb b/activejob/lib/active_job/core.rb index e3e63f227e..7f1d4efc65 100644 --- a/activejob/lib/active_job/core.rb +++ b/activejob/lib/active_job/core.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ActiveJob # Provides general behavior that will be included into every Active Job # object that inherits from ActiveJob::Base. diff --git a/activejob/lib/active_job/enqueuing.rb b/activejob/lib/active_job/enqueuing.rb index 994645c62a..0c38200b76 100644 --- a/activejob/lib/active_job/enqueuing.rb +++ b/activejob/lib/active_job/enqueuing.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "arguments" module ActiveJob diff --git a/activejob/lib/active_job/exceptions.rb b/activejob/lib/active_job/exceptions.rb index c1b5d35313..3a91cbc0b6 100644 --- a/activejob/lib/active_job/exceptions.rb +++ b/activejob/lib/active_job/exceptions.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_support/core_ext/numeric/time" module ActiveJob diff --git a/activejob/lib/active_job/execution.rb b/activejob/lib/active_job/execution.rb index 69486676d1..d4e068d6ec 100644 --- a/activejob/lib/active_job/execution.rb +++ b/activejob/lib/active_job/execution.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_support/rescuable" require_relative "arguments" diff --git a/activejob/lib/active_job/gem_version.rb b/activejob/lib/active_job/gem_version.rb index bf81f37e81..0e414f1b11 100644 --- a/activejob/lib/active_job/gem_version.rb +++ b/activejob/lib/active_job/gem_version.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ActiveJob # Returns the version of the currently loaded Active Job as a Gem::Version def self.gem_version diff --git a/activejob/lib/active_job/logging.rb b/activejob/lib/active_job/logging.rb index ddc4915fd3..8f8f4cb244 100644 --- a/activejob/lib/active_job/logging.rb +++ b/activejob/lib/active_job/logging.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_support/core_ext/hash/transform_values" require "active_support/core_ext/string/filters" require "active_support/tagged_logging" diff --git a/activejob/lib/active_job/queue_adapter.rb b/activejob/lib/active_job/queue_adapter.rb index b22d8b8347..8f4d40de19 100644 --- a/activejob/lib/active_job/queue_adapter.rb +++ b/activejob/lib/active_job/queue_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_support/core_ext/string/inflections" module ActiveJob diff --git a/activejob/lib/active_job/queue_adapters.rb b/activejob/lib/active_job/queue_adapters.rb index c8eedb6156..b89a62319a 100644 --- a/activejob/lib/active_job/queue_adapters.rb +++ b/activejob/lib/active_job/queue_adapters.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ActiveJob # == Active Job adapters # diff --git a/activejob/lib/active_job/queue_adapters/async_adapter.rb b/activejob/lib/active_job/queue_adapters/async_adapter.rb index e2bff9e646..d2fc686339 100644 --- a/activejob/lib/active_job/queue_adapters/async_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/async_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "securerandom" require "concurrent/scheduled_task" require "concurrent/executor/thread_pool_executor" diff --git a/activejob/lib/active_job/queue_adapters/backburner_adapter.rb b/activejob/lib/active_job/queue_adapters/backburner_adapter.rb index e3eccce62b..63519df551 100644 --- a/activejob/lib/active_job/queue_adapters/backburner_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/backburner_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "backburner" module ActiveJob diff --git a/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb b/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb index 83ad2e767d..54a5af2ae6 100644 --- a/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/delayed_job_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "delayed_job" module ActiveJob diff --git a/activejob/lib/active_job/queue_adapters/inline_adapter.rb b/activejob/lib/active_job/queue_adapters/inline_adapter.rb index 0496f8449e..e793fff89d 100644 --- a/activejob/lib/active_job/queue_adapters/inline_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/inline_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ActiveJob module QueueAdapters # == Active Job Inline adapter diff --git a/activejob/lib/active_job/queue_adapters/qu_adapter.rb b/activejob/lib/active_job/queue_adapters/qu_adapter.rb index e8994533e4..9b2072f611 100644 --- a/activejob/lib/active_job/queue_adapters/qu_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/qu_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "qu" module ActiveJob diff --git a/activejob/lib/active_job/queue_adapters/que_adapter.rb b/activejob/lib/active_job/queue_adapters/que_adapter.rb index 0e698f0d79..e72899a1cb 100644 --- a/activejob/lib/active_job/queue_adapters/que_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/que_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "que" module ActiveJob diff --git a/activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb b/activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb index 1115eb88ae..53fb0d83b4 100644 --- a/activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/queue_classic_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "queue_classic" module ActiveJob diff --git a/activejob/lib/active_job/queue_adapters/resque_adapter.rb b/activejob/lib/active_job/queue_adapters/resque_adapter.rb index 2df157ef89..f9cefd3c33 100644 --- a/activejob/lib/active_job/queue_adapters/resque_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/resque_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "resque" require "active_support/core_ext/enumerable" require "active_support/core_ext/array/access" diff --git a/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb b/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb index 895cc1f981..35f399b0f0 100644 --- a/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/sidekiq_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "sidekiq" module ActiveJob diff --git a/activejob/lib/active_job/queue_adapters/sneakers_adapter.rb b/activejob/lib/active_job/queue_adapters/sneakers_adapter.rb index f00acfc04a..972ff5af0f 100644 --- a/activejob/lib/active_job/queue_adapters/sneakers_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/sneakers_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "sneakers" require "monitor" diff --git a/activejob/lib/active_job/queue_adapters/sucker_punch_adapter.rb b/activejob/lib/active_job/queue_adapters/sucker_punch_adapter.rb index dd59a79813..2ba9372f4f 100644 --- a/activejob/lib/active_job/queue_adapters/sucker_punch_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/sucker_punch_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "sucker_punch" module ActiveJob diff --git a/activejob/lib/active_job/queue_adapters/test_adapter.rb b/activejob/lib/active_job/queue_adapters/test_adapter.rb index 1b633b210e..5972b28156 100644 --- a/activejob/lib/active_job/queue_adapters/test_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/test_adapter.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ActiveJob module QueueAdapters # == Test adapter for Active Job diff --git a/activejob/lib/active_job/queue_name.rb b/activejob/lib/active_job/queue_name.rb index 6f521a1c1a..22ebd5e3fc 100644 --- a/activejob/lib/active_job/queue_name.rb +++ b/activejob/lib/active_job/queue_name.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ActiveJob module QueueName extend ActiveSupport::Concern diff --git a/activejob/lib/active_job/queue_priority.rb b/activejob/lib/active_job/queue_priority.rb index 399d7a135a..fd1c0f6286 100644 --- a/activejob/lib/active_job/queue_priority.rb +++ b/activejob/lib/active_job/queue_priority.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ActiveJob module QueuePriority extend ActiveSupport::Concern diff --git a/activejob/lib/active_job/railtie.rb b/activejob/lib/active_job/railtie.rb index 4a8bf04d70..8adbd3473c 100644 --- a/activejob/lib/active_job/railtie.rb +++ b/activejob/lib/active_job/railtie.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "global_id/railtie" require "active_job" diff --git a/activejob/lib/active_job/test_case.rb b/activejob/lib/active_job/test_case.rb index a5ec45e4a7..028ff552bf 100644 --- a/activejob/lib/active_job/test_case.rb +++ b/activejob/lib/active_job/test_case.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_support/test_case" module ActiveJob diff --git a/activejob/lib/active_job/test_helper.rb b/activejob/lib/active_job/test_helper.rb index a61e4f59a5..60ca1b5f1b 100644 --- a/activejob/lib/active_job/test_helper.rb +++ b/activejob/lib/active_job/test_helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_support/core_ext/class/subclasses" require "active_support/core_ext/hash/keys" diff --git a/activejob/lib/active_job/translation.rb b/activejob/lib/active_job/translation.rb index 67e4cf4ab9..71c4cb24af 100644 --- a/activejob/lib/active_job/translation.rb +++ b/activejob/lib/active_job/translation.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ActiveJob module Translation #:nodoc: extend ActiveSupport::Concern diff --git a/activejob/lib/active_job/version.rb b/activejob/lib/active_job/version.rb index 60b463817f..afff4271d4 100644 --- a/activejob/lib/active_job/version.rb +++ b/activejob/lib/active_job/version.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "gem_version" module ActiveJob diff --git a/activejob/lib/rails/generators/job/job_generator.rb b/activejob/lib/rails/generators/job/job_generator.rb index 474f181f65..dce4e3a3fe 100644 --- a/activejob/lib/rails/generators/job/job_generator.rb +++ b/activejob/lib/rails/generators/job/job_generator.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "rails/generators/named_base" module Rails # :nodoc: diff --git a/activejob/test/adapters/async.rb b/activejob/test/adapters/async.rb index 08eb9658cd..d5a61d7684 100644 --- a/activejob/test/adapters/async.rb +++ b/activejob/test/adapters/async.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true ActiveJob::Base.queue_adapter = :async ActiveJob::Base.queue_adapter.immediate = true diff --git a/activejob/test/adapters/backburner.rb b/activejob/test/adapters/backburner.rb index 17ba07b802..cfc97432f2 100644 --- a/activejob/test/adapters/backburner.rb +++ b/activejob/test/adapters/backburner.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "support/backburner/inline" ActiveJob::Base.queue_adapter = :backburner diff --git a/activejob/test/adapters/delayed_job.rb b/activejob/test/adapters/delayed_job.rb index 98e41c0c36..3aa646555a 100644 --- a/activejob/test/adapters/delayed_job.rb +++ b/activejob/test/adapters/delayed_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true ActiveJob::Base.queue_adapter = :delayed_job $LOAD_PATH << File.expand_path("../support/delayed_job", __dir__) diff --git a/activejob/test/adapters/inline.rb b/activejob/test/adapters/inline.rb index 24113dfa5a..ec3f0940e6 100644 --- a/activejob/test/adapters/inline.rb +++ b/activejob/test/adapters/inline.rb @@ -1 +1,2 @@ +# frozen_string_literal: true ActiveJob::Base.queue_adapter = :inline diff --git a/activejob/test/adapters/qu.rb b/activejob/test/adapters/qu.rb index b89c504091..f8e7eb624d 100644 --- a/activejob/test/adapters/qu.rb +++ b/activejob/test/adapters/qu.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "qu-immediate" ActiveJob::Base.queue_adapter = :qu diff --git a/activejob/test/adapters/que.rb b/activejob/test/adapters/que.rb index 0c49274a4e..0d27bb8fc9 100644 --- a/activejob/test/adapters/que.rb +++ b/activejob/test/adapters/que.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "support/que/inline" ActiveJob::Base.queue_adapter = :que diff --git a/activejob/test/adapters/queue_classic.rb b/activejob/test/adapters/queue_classic.rb index e301a7ca96..f57057c914 100644 --- a/activejob/test/adapters/queue_classic.rb +++ b/activejob/test/adapters/queue_classic.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true require "support/queue_classic/inline" ActiveJob::Base.queue_adapter = :queue_classic diff --git a/activejob/test/adapters/resque.rb b/activejob/test/adapters/resque.rb index af7080358d..6c732c1e33 100644 --- a/activejob/test/adapters/resque.rb +++ b/activejob/test/adapters/resque.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true ActiveJob::Base.queue_adapter = :resque Resque.inline = true diff --git a/activejob/test/adapters/sidekiq.rb b/activejob/test/adapters/sidekiq.rb index 8036331ef1..6cc64e7684 100644 --- a/activejob/test/adapters/sidekiq.rb +++ b/activejob/test/adapters/sidekiq.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true require "sidekiq/testing/inline" ActiveJob::Base.queue_adapter = :sidekiq diff --git a/activejob/test/adapters/sneakers.rb b/activejob/test/adapters/sneakers.rb index 159c0d1906..85f6b74144 100644 --- a/activejob/test/adapters/sneakers.rb +++ b/activejob/test/adapters/sneakers.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true require "support/sneakers/inline" ActiveJob::Base.queue_adapter = :sneakers diff --git a/activejob/test/adapters/sucker_punch.rb b/activejob/test/adapters/sucker_punch.rb index 5661b6ee92..45b5fa1db2 100644 --- a/activejob/test/adapters/sucker_punch.rb +++ b/activejob/test/adapters/sucker_punch.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true require "sucker_punch/testing/inline" ActiveJob::Base.queue_adapter = :sucker_punch diff --git a/activejob/test/adapters/test.rb b/activejob/test/adapters/test.rb index 7180b38a57..965f7e91a2 100644 --- a/activejob/test/adapters/test.rb +++ b/activejob/test/adapters/test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true ActiveJob::Base.queue_adapter = :test ActiveJob::Base.queue_adapter.perform_enqueued_jobs = true ActiveJob::Base.queue_adapter.perform_enqueued_at_jobs = true diff --git a/activejob/test/cases/adapter_test.rb b/activejob/test/cases/adapter_test.rb index caf5d44a5e..764ce3ccbc 100644 --- a/activejob/test/cases/adapter_test.rb +++ b/activejob/test/cases/adapter_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" class AdapterTest < ActiveSupport::TestCase diff --git a/activejob/test/cases/argument_serialization_test.rb b/activejob/test/cases/argument_serialization_test.rb index 7934d8e556..ebd9a4fe41 100644 --- a/activejob/test/cases/argument_serialization_test.rb +++ b/activejob/test/cases/argument_serialization_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "active_job/arguments" require "models/person" diff --git a/activejob/test/cases/callbacks_test.rb b/activejob/test/cases/callbacks_test.rb index 8d1c9c3058..fbca367ae9 100644 --- a/activejob/test/cases/callbacks_test.rb +++ b/activejob/test/cases/callbacks_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "jobs/callback_job" diff --git a/activejob/test/cases/exceptions_test.rb b/activejob/test/cases/exceptions_test.rb index dbe55f7430..5f56d47e8e 100644 --- a/activejob/test/cases/exceptions_test.rb +++ b/activejob/test/cases/exceptions_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "jobs/retry_job" diff --git a/activejob/test/cases/job_serialization_test.rb b/activejob/test/cases/job_serialization_test.rb index c737557ece..fa8d98ddca 100644 --- a/activejob/test/cases/job_serialization_test.rb +++ b/activejob/test/cases/job_serialization_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "jobs/gid_job" require "jobs/hello_job" diff --git a/activejob/test/cases/logging_test.rb b/activejob/test/cases/logging_test.rb index d5ca0f385c..117d9b23a3 100644 --- a/activejob/test/cases/logging_test.rb +++ b/activejob/test/cases/logging_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "active_support/log_subscriber/test_helper" require "active_support/core_ext/numeric/time" diff --git a/activejob/test/cases/queue_adapter_test.rb b/activejob/test/cases/queue_adapter_test.rb index 8368107bdf..6061fb2127 100644 --- a/activejob/test/cases/queue_adapter_test.rb +++ b/activejob/test/cases/queue_adapter_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" module ActiveJob diff --git a/activejob/test/cases/queue_naming_test.rb b/activejob/test/cases/queue_naming_test.rb index 0247bc111e..8ba4324c46 100644 --- a/activejob/test/cases/queue_naming_test.rb +++ b/activejob/test/cases/queue_naming_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "jobs/hello_job" require "jobs/logging_job" diff --git a/activejob/test/cases/queue_priority_test.rb b/activejob/test/cases/queue_priority_test.rb index 171fb1e593..416498c270 100644 --- a/activejob/test/cases/queue_priority_test.rb +++ b/activejob/test/cases/queue_priority_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "jobs/hello_job" diff --git a/activejob/test/cases/queuing_test.rb b/activejob/test/cases/queuing_test.rb index a3ecb15c31..44f674a2ee 100644 --- a/activejob/test/cases/queuing_test.rb +++ b/activejob/test/cases/queuing_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "jobs/hello_job" require "active_support/core_ext/numeric/time" diff --git a/activejob/test/cases/rescue_test.rb b/activejob/test/cases/rescue_test.rb index afb1b48831..c2a991cb2d 100644 --- a/activejob/test/cases/rescue_test.rb +++ b/activejob/test/cases/rescue_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "jobs/rescue_job" require "models/person" diff --git a/activejob/test/cases/test_case_test.rb b/activejob/test/cases/test_case_test.rb index 3db2d9dec7..eb320a98d1 100644 --- a/activejob/test/cases/test_case_test.rb +++ b/activejob/test/cases/test_case_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "jobs/hello_job" require "jobs/logging_job" diff --git a/activejob/test/cases/test_helper_test.rb b/activejob/test/cases/test_helper_test.rb index 81e75b4374..0f8174663e 100644 --- a/activejob/test/cases/test_helper_test.rb +++ b/activejob/test/cases/test_helper_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "active_support/core_ext/time" require "active_support/core_ext/date" diff --git a/activejob/test/cases/translation_test.rb b/activejob/test/cases/translation_test.rb index 27bfd50985..d6782a38bd 100644 --- a/activejob/test/cases/translation_test.rb +++ b/activejob/test/cases/translation_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "jobs/translated_hello_job" diff --git a/activejob/test/helper.rb b/activejob/test/helper.rb index db07ecab7a..edcf159056 100644 --- a/activejob/test/helper.rb +++ b/activejob/test/helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_job" require "support/job_buffer" diff --git a/activejob/test/integration/queuing_test.rb b/activejob/test/integration/queuing_test.rb index 2669c52a1c..72c66d111f 100644 --- a/activejob/test/integration/queuing_test.rb +++ b/activejob/test/integration/queuing_test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "helper" require "jobs/logging_job" require "jobs/hello_job" diff --git a/activejob/test/jobs/application_job.rb b/activejob/test/jobs/application_job.rb index a009ace51c..32fe70b8e4 100644 --- a/activejob/test/jobs/application_job.rb +++ b/activejob/test/jobs/application_job.rb @@ -1,2 +1,3 @@ +# frozen_string_literal: true class ApplicationJob < ActiveJob::Base end diff --git a/activejob/test/jobs/callback_job.rb b/activejob/test/jobs/callback_job.rb index ca2a8e031a..7c5b161437 100644 --- a/activejob/test/jobs/callback_job.rb +++ b/activejob/test/jobs/callback_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class CallbackJob < ActiveJob::Base before_perform ->(job) { job.history << "CallbackJob ran before_perform" } after_perform ->(job) { job.history << "CallbackJob ran after_perform" } diff --git a/activejob/test/jobs/gid_job.rb b/activejob/test/jobs/gid_job.rb index c7cfa6e7a2..c43e25a796 100644 --- a/activejob/test/jobs/gid_job.rb +++ b/activejob/test/jobs/gid_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "../support/job_buffer" class GidJob < ActiveJob::Base diff --git a/activejob/test/jobs/hello_job.rb b/activejob/test/jobs/hello_job.rb index 126fefae00..79e1d6a6f4 100644 --- a/activejob/test/jobs/hello_job.rb +++ b/activejob/test/jobs/hello_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "../support/job_buffer" class HelloJob < ActiveJob::Base diff --git a/activejob/test/jobs/inherited_job.rb b/activejob/test/jobs/inherited_job.rb index 60fca66f88..58b6582154 100644 --- a/activejob/test/jobs/inherited_job.rb +++ b/activejob/test/jobs/inherited_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "application_job" class InheritedJob < ApplicationJob diff --git a/activejob/test/jobs/kwargs_job.rb b/activejob/test/jobs/kwargs_job.rb index 9f9d809673..ccd9811595 100644 --- a/activejob/test/jobs/kwargs_job.rb +++ b/activejob/test/jobs/kwargs_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "../support/job_buffer" class KwargsJob < ActiveJob::Base diff --git a/activejob/test/jobs/logging_job.rb b/activejob/test/jobs/logging_job.rb index 119b32fa67..1a47601fde 100644 --- a/activejob/test/jobs/logging_job.rb +++ b/activejob/test/jobs/logging_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class LoggingJob < ActiveJob::Base def perform(dummy) logger.info "Dummy, here is it: #{dummy}" diff --git a/activejob/test/jobs/nested_job.rb b/activejob/test/jobs/nested_job.rb index 21b7692cd1..891a2f952e 100644 --- a/activejob/test/jobs/nested_job.rb +++ b/activejob/test/jobs/nested_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class NestedJob < ActiveJob::Base def perform LoggingJob.perform_later "NestedJob" diff --git a/activejob/test/jobs/overridden_logging_job.rb b/activejob/test/jobs/overridden_logging_job.rb index 2b17a65142..808d6e30e6 100644 --- a/activejob/test/jobs/overridden_logging_job.rb +++ b/activejob/test/jobs/overridden_logging_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class OverriddenLoggingJob < ActiveJob::Base def perform(dummy) logger.info "Dummy, here is it: #{dummy}" diff --git a/activejob/test/jobs/provider_jid_job.rb b/activejob/test/jobs/provider_jid_job.rb index 0c8ba040f5..71ed23e9bb 100644 --- a/activejob/test/jobs/provider_jid_job.rb +++ b/activejob/test/jobs/provider_jid_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "../support/job_buffer" class ProviderJidJob < ActiveJob::Base diff --git a/activejob/test/jobs/queue_adapter_job.rb b/activejob/test/jobs/queue_adapter_job.rb index 160dfd74ec..7058ab2087 100644 --- a/activejob/test/jobs/queue_adapter_job.rb +++ b/activejob/test/jobs/queue_adapter_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class QueueAdapterJob < ActiveJob::Base self.queue_adapter = :inline end diff --git a/activejob/test/jobs/queue_as_job.rb b/activejob/test/jobs/queue_as_job.rb index 7dc318e736..ab3075aa77 100644 --- a/activejob/test/jobs/queue_as_job.rb +++ b/activejob/test/jobs/queue_as_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "../support/job_buffer" class QueueAsJob < ActiveJob::Base diff --git a/activejob/test/jobs/rescue_job.rb b/activejob/test/jobs/rescue_job.rb index 62add4271a..fd78820bfe 100644 --- a/activejob/test/jobs/rescue_job.rb +++ b/activejob/test/jobs/rescue_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "../support/job_buffer" class RescueJob < ActiveJob::Base diff --git a/activejob/test/jobs/retry_job.rb b/activejob/test/jobs/retry_job.rb index c02febc50c..b121296441 100644 --- a/activejob/test/jobs/retry_job.rb +++ b/activejob/test/jobs/retry_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "../support/job_buffer" require "active_support/core_ext/integer/inflections" diff --git a/activejob/test/jobs/translated_hello_job.rb b/activejob/test/jobs/translated_hello_job.rb index 56e9f147b9..67ddca2f41 100644 --- a/activejob/test/jobs/translated_hello_job.rb +++ b/activejob/test/jobs/translated_hello_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require_relative "../support/job_buffer" class TranslatedHelloJob < ActiveJob::Base diff --git a/activejob/test/models/person.rb b/activejob/test/models/person.rb index b5d68ad9c1..bcd1018782 100644 --- a/activejob/test/models/person.rb +++ b/activejob/test/models/person.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class Person class RecordNotFound < StandardError; end diff --git a/activejob/test/support/backburner/inline.rb b/activejob/test/support/backburner/inline.rb index 9758332b6f..304f9c781c 100644 --- a/activejob/test/support/backburner/inline.rb +++ b/activejob/test/support/backburner/inline.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "backburner" Backburner::Worker.class_eval do diff --git a/activejob/test/support/delayed_job/delayed/backend/test.rb b/activejob/test/support/delayed_job/delayed/backend/test.rb index 68288c062b..ed3b252042 100644 --- a/activejob/test/support/delayed_job/delayed/backend/test.rb +++ b/activejob/test/support/delayed_job/delayed/backend/test.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true #copied from https://github.com/collectiveidea/delayed_job/blob/master/spec/delayed/backend/test.rb require "ostruct" diff --git a/activejob/test/support/integration/adapters/async.rb b/activejob/test/support/integration/adapters/async.rb index 44ab98437a..19aea8472e 100644 --- a/activejob/test/support/integration/adapters/async.rb +++ b/activejob/test/support/integration/adapters/async.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module AsyncJobsManager def setup ActiveJob::Base.queue_adapter = :async diff --git a/activejob/test/support/integration/adapters/backburner.rb b/activejob/test/support/integration/adapters/backburner.rb index 2e194933a1..fd1e7697c5 100644 --- a/activejob/test/support/integration/adapters/backburner.rb +++ b/activejob/test/support/integration/adapters/backburner.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module BackburnerJobsManager def setup ActiveJob::Base.queue_adapter = :backburner diff --git a/activejob/test/support/integration/adapters/delayed_job.rb b/activejob/test/support/integration/adapters/delayed_job.rb index 2adbbcd88f..73e1a04e45 100644 --- a/activejob/test/support/integration/adapters/delayed_job.rb +++ b/activejob/test/support/integration/adapters/delayed_job.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "delayed_job" require "delayed_job_active_record" diff --git a/activejob/test/support/integration/adapters/inline.rb b/activejob/test/support/integration/adapters/inline.rb index e06b34c976..c669793dba 100644 --- a/activejob/test/support/integration/adapters/inline.rb +++ b/activejob/test/support/integration/adapters/inline.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module InlineJobsManager def setup ActiveJob::Base.queue_adapter = :inline diff --git a/activejob/test/support/integration/adapters/qu.rb b/activejob/test/support/integration/adapters/qu.rb index 71819f5a55..b2f63d8f94 100644 --- a/activejob/test/support/integration/adapters/qu.rb +++ b/activejob/test/support/integration/adapters/qu.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module QuJobsManager def setup require "qu-rails" diff --git a/activejob/test/support/integration/adapters/que.rb b/activejob/test/support/integration/adapters/que.rb index 20faee3427..cf1160d2bc 100644 --- a/activejob/test/support/integration/adapters/que.rb +++ b/activejob/test/support/integration/adapters/que.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module QueJobsManager def setup require "sequel" diff --git a/activejob/test/support/integration/adapters/queue_classic.rb b/activejob/test/support/integration/adapters/queue_classic.rb index 369693e947..7f1308c5d3 100644 --- a/activejob/test/support/integration/adapters/queue_classic.rb +++ b/activejob/test/support/integration/adapters/queue_classic.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module QueueClassicJobsManager def setup ENV["QC_DATABASE_URL"] ||= "postgres:///active_jobs_qc_int_test" diff --git a/activejob/test/support/integration/adapters/resque.rb b/activejob/test/support/integration/adapters/resque.rb index a21a1786c9..ef2dd75687 100644 --- a/activejob/test/support/integration/adapters/resque.rb +++ b/activejob/test/support/integration/adapters/resque.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module ResqueJobsManager def setup ActiveJob::Base.queue_adapter = :resque diff --git a/activejob/test/support/integration/adapters/sidekiq.rb b/activejob/test/support/integration/adapters/sidekiq.rb index bbb575f6da..8c90410e76 100644 --- a/activejob/test/support/integration/adapters/sidekiq.rb +++ b/activejob/test/support/integration/adapters/sidekiq.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "sidekiq/api" require "sidekiq/testing" diff --git a/activejob/test/support/integration/adapters/sneakers.rb b/activejob/test/support/integration/adapters/sneakers.rb index 1c8dfaca59..dc42501ff3 100644 --- a/activejob/test/support/integration/adapters/sneakers.rb +++ b/activejob/test/support/integration/adapters/sneakers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "sneakers/runner" require "sneakers/publisher" require "timeout" diff --git a/activejob/test/support/integration/adapters/sucker_punch.rb b/activejob/test/support/integration/adapters/sucker_punch.rb index 9c0d66b469..e528f24261 100644 --- a/activejob/test/support/integration/adapters/sucker_punch.rb +++ b/activejob/test/support/integration/adapters/sucker_punch.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module SuckerPunchJobsManager def setup ActiveJob::Base.queue_adapter = :sucker_punch diff --git a/activejob/test/support/integration/dummy_app_template.rb b/activejob/test/support/integration/dummy_app_template.rb index 14fe3c9adc..a054ecea08 100644 --- a/activejob/test/support/integration/dummy_app_template.rb +++ b/activejob/test/support/integration/dummy_app_template.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true if ENV["AJ_ADAPTER"] == "delayed_job" generate "delayed_job:active_record", "--quiet" end diff --git a/activejob/test/support/integration/helper.rb b/activejob/test/support/integration/helper.rb index 545b62752e..c0aa14c4c2 100644 --- a/activejob/test/support/integration/helper.rb +++ b/activejob/test/support/integration/helper.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true puts "\n\n*** rake aj:integration:#{ENV['AJ_ADAPTER']} ***\n" ENV["RAILS_ENV"] = "test" diff --git a/activejob/test/support/integration/jobs_manager.rb b/activejob/test/support/integration/jobs_manager.rb index 488756437b..1cfbd60dc4 100644 --- a/activejob/test/support/integration/jobs_manager.rb +++ b/activejob/test/support/integration/jobs_manager.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true class JobsManager @@managers = {} attr :adapter_name diff --git a/activejob/test/support/integration/test_case_helpers.rb b/activejob/test/support/integration/test_case_helpers.rb index 41bf9c89d1..add719187c 100644 --- a/activejob/test/support/integration/test_case_helpers.rb +++ b/activejob/test/support/integration/test_case_helpers.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "active_support/core_ext/string/inflections" require "support/integration/jobs_manager" diff --git a/activejob/test/support/job_buffer.rb b/activejob/test/support/job_buffer.rb index 620cb5288d..3146d06d54 100644 --- a/activejob/test/support/job_buffer.rb +++ b/activejob/test/support/job_buffer.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true module JobBuffer class << self def clear diff --git a/activejob/test/support/que/inline.rb b/activejob/test/support/que/inline.rb index 55eb0d01ef..e204f8154a 100644 --- a/activejob/test/support/que/inline.rb +++ b/activejob/test/support/que/inline.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "que" Que::Job.class_eval do diff --git a/activejob/test/support/queue_classic/inline.rb b/activejob/test/support/queue_classic/inline.rb index dcd834ecce..955469e5a8 100644 --- a/activejob/test/support/queue_classic/inline.rb +++ b/activejob/test/support/queue_classic/inline.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "queue_classic" module QC diff --git a/activejob/test/support/sneakers/inline.rb b/activejob/test/support/sneakers/inline.rb index cf102ae5c2..46882870d5 100644 --- a/activejob/test/support/sneakers/inline.rb +++ b/activejob/test/support/sneakers/inline.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true require "sneakers" module Sneakers