mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use frozen-string-literal in ActiveJob
This commit is contained in:
parent
0b6309d6bc
commit
14ece5e429
102 changed files with 102 additions and 0 deletions
|
@ -82,6 +82,7 @@ Style/FrozenStringLiteralComment:
|
|||
EnforcedStyle: always
|
||||
Include:
|
||||
- 'activesupport/**/*'
|
||||
- 'activejob/**/*'
|
||||
|
||||
# Use `foo {}` not `foo{}`.
|
||||
Layout/SpaceBeforeBlockBraces:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "rake/testtask"
|
||||
|
||||
#TODO: add qu back to the list after it support Rails 5.1
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
version = File.read(File.expand_path("../RAILS_VERSION", __dir__)).strip
|
||||
|
||||
Gem::Specification.new do |s|
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
|
||||
COMPONENT_ROOT = File.expand_path("..", __dir__)
|
||||
require_relative "../../tools/test"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
#--
|
||||
# Copyright (c) 2014-2017 David Heinemeier Hansson
|
||||
#
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "active_support/core_ext/hash"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "core"
|
||||
require_relative "queue_adapter"
|
||||
require_relative "queue_name"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "active_support/callbacks"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module ActiveJob
|
||||
class ConfiguredJob #:nodoc:
|
||||
def initialize(job_class, options = {})
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "arguments"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "active_support/core_ext/numeric/time"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "active_support/rescuable"
|
||||
require_relative "arguments"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module ActiveJob
|
||||
# Returns the version of the currently loaded Active Job as a <tt>Gem::Version</tt>
|
||||
def self.gem_version
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "active_support/core_ext/string/inflections"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module ActiveJob
|
||||
# == Active Job adapters
|
||||
#
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "securerandom"
|
||||
require "concurrent/scheduled_task"
|
||||
require "concurrent/executor/thread_pool_executor"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "backburner"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "delayed_job"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module ActiveJob
|
||||
module QueueAdapters
|
||||
# == Active Job Inline adapter
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "qu"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "que"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "queue_classic"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "resque"
|
||||
require "active_support/core_ext/enumerable"
|
||||
require "active_support/core_ext/array/access"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "sidekiq"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "sneakers"
|
||||
require "monitor"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "sucker_punch"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module ActiveJob
|
||||
module QueueAdapters
|
||||
# == Test adapter for Active Job
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module ActiveJob
|
||||
module QueueName
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module ActiveJob
|
||||
module QueuePriority
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "global_id/railtie"
|
||||
require "active_job"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "active_support/test_case"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "active_support/core_ext/class/subclasses"
|
||||
require "active_support/core_ext/hash/keys"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module ActiveJob
|
||||
module Translation #:nodoc:
|
||||
extend ActiveSupport::Concern
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "gem_version"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "rails/generators/named_base"
|
||||
|
||||
module Rails # :nodoc:
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
# frozen_string_literal: true
|
||||
ActiveJob::Base.queue_adapter = :async
|
||||
ActiveJob::Base.queue_adapter.immediate = true
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "support/backburner/inline"
|
||||
|
||||
ActiveJob::Base.queue_adapter = :backburner
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
ActiveJob::Base.queue_adapter = :delayed_job
|
||||
|
||||
$LOAD_PATH << File.expand_path("../support/delayed_job", __dir__)
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
# frozen_string_literal: true
|
||||
ActiveJob::Base.queue_adapter = :inline
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "qu-immediate"
|
||||
|
||||
ActiveJob::Base.queue_adapter = :qu
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "support/que/inline"
|
||||
|
||||
ActiveJob::Base.queue_adapter = :que
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
# frozen_string_literal: true
|
||||
require "support/queue_classic/inline"
|
||||
ActiveJob::Base.queue_adapter = :queue_classic
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
# frozen_string_literal: true
|
||||
ActiveJob::Base.queue_adapter = :resque
|
||||
Resque.inline = true
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
# frozen_string_literal: true
|
||||
require "sidekiq/testing/inline"
|
||||
ActiveJob::Base.queue_adapter = :sidekiq
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
# frozen_string_literal: true
|
||||
require "support/sneakers/inline"
|
||||
ActiveJob::Base.queue_adapter = :sneakers
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
# frozen_string_literal: true
|
||||
require "sucker_punch/testing/inline"
|
||||
ActiveJob::Base.queue_adapter = :sucker_punch
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
|
||||
class AdapterTest < ActiveSupport::TestCase
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "active_job/arguments"
|
||||
require "models/person"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "jobs/callback_job"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "jobs/retry_job"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "jobs/gid_job"
|
||||
require "jobs/hello_job"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "active_support/log_subscriber/test_helper"
|
||||
require "active_support/core_ext/numeric/time"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
|
||||
module ActiveJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "jobs/hello_job"
|
||||
require "jobs/logging_job"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "jobs/hello_job"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "jobs/hello_job"
|
||||
require "active_support/core_ext/numeric/time"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "jobs/rescue_job"
|
||||
require "models/person"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "jobs/hello_job"
|
||||
require "jobs/logging_job"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "active_support/core_ext/time"
|
||||
require "active_support/core_ext/date"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "jobs/translated_hello_job"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "active_job"
|
||||
require "support/job_buffer"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "helper"
|
||||
require "jobs/logging_job"
|
||||
require "jobs/hello_job"
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
# frozen_string_literal: true
|
||||
class ApplicationJob < ActiveJob::Base
|
||||
end
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "../support/job_buffer"
|
||||
|
||||
class GidJob < ActiveJob::Base
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "../support/job_buffer"
|
||||
|
||||
class HelloJob < ActiveJob::Base
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "application_job"
|
||||
|
||||
class InheritedJob < ApplicationJob
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "../support/job_buffer"
|
||||
|
||||
class KwargsJob < ActiveJob::Base
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
class LoggingJob < ActiveJob::Base
|
||||
def perform(dummy)
|
||||
logger.info "Dummy, here is it: #{dummy}"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
class NestedJob < ActiveJob::Base
|
||||
def perform
|
||||
LoggingJob.perform_later "NestedJob"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
class OverriddenLoggingJob < ActiveJob::Base
|
||||
def perform(dummy)
|
||||
logger.info "Dummy, here is it: #{dummy}"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "../support/job_buffer"
|
||||
|
||||
class ProviderJidJob < ActiveJob::Base
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
class QueueAdapterJob < ActiveJob::Base
|
||||
self.queue_adapter = :inline
|
||||
end
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "../support/job_buffer"
|
||||
|
||||
class QueueAsJob < ActiveJob::Base
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "../support/job_buffer"
|
||||
|
||||
class RescueJob < ActiveJob::Base
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "../support/job_buffer"
|
||||
require "active_support/core_ext/integer/inflections"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require_relative "../support/job_buffer"
|
||||
|
||||
class TranslatedHelloJob < ActiveJob::Base
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
class Person
|
||||
class RecordNotFound < StandardError; end
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "backburner"
|
||||
|
||||
Backburner::Worker.class_eval do
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module AsyncJobsManager
|
||||
def setup
|
||||
ActiveJob::Base.queue_adapter = :async
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module BackburnerJobsManager
|
||||
def setup
|
||||
ActiveJob::Base.queue_adapter = :backburner
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "delayed_job"
|
||||
require "delayed_job_active_record"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module InlineJobsManager
|
||||
def setup
|
||||
ActiveJob::Base.queue_adapter = :inline
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module QuJobsManager
|
||||
def setup
|
||||
require "qu-rails"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module QueJobsManager
|
||||
def setup
|
||||
require "sequel"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module QueueClassicJobsManager
|
||||
def setup
|
||||
ENV["QC_DATABASE_URL"] ||= "postgres:///active_jobs_qc_int_test"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module ResqueJobsManager
|
||||
def setup
|
||||
ActiveJob::Base.queue_adapter = :resque
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "sidekiq/api"
|
||||
|
||||
require "sidekiq/testing"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "sneakers/runner"
|
||||
require "sneakers/publisher"
|
||||
require "timeout"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module SuckerPunchJobsManager
|
||||
def setup
|
||||
ActiveJob::Base.queue_adapter = :sucker_punch
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
if ENV["AJ_ADAPTER"] == "delayed_job"
|
||||
generate "delayed_job:active_record", "--quiet"
|
||||
end
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
puts "\n\n*** rake aj:integration:#{ENV['AJ_ADAPTER']} ***\n"
|
||||
|
||||
ENV["RAILS_ENV"] = "test"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
class JobsManager
|
||||
@@managers = {}
|
||||
attr :adapter_name
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "active_support/core_ext/string/inflections"
|
||||
require "support/integration/jobs_manager"
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
module JobBuffer
|
||||
class << self
|
||||
def clear
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
require "que"
|
||||
|
||||
Que::Job.class_eval do
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue