From 42e997bb34c23334da2bbb974643117ee8d0caaf Mon Sep 17 00:00:00 2001 From: Ben Sheldon Date: Thu, 21 Jan 2021 19:41:18 -0800 Subject: [PATCH] Fix YARD attr_ declarations for documentation --- lib/good_job/configuration.rb | 19 +++++++++---------- lib/good_job/lockable.rb | 4 ++-- lib/good_job/scheduler.rb | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/good_job/configuration.rb b/lib/good_job/configuration.rb index e4ee9971b..ee0065bec 100644 --- a/lib/good_job/configuration.rb +++ b/lib/good_job/configuration.rb @@ -12,16 +12,15 @@ class Configuration # Default number of seconds to preserve jobs for {CLI#cleanup_preserved_jobs} DEFAULT_CLEANUP_PRESERVED_JOBS_BEFORE_SECONDS_AGO = 24 * 60 * 60 - # @!attribute [r] options - # The options that were explicitly set when initializing +Configuration+. - # @return [Hash] - # - # @!attribute [r] env - # The environment from which to read GoodJob's environment variables. By - # default, this is the current process's environment, but it can be set - # to something else in {#initialize}. - # @return [Hash] - attr_reader :options, :env + # The options that were explicitly set when initializing +Configuration+. + # @return [Hash] + attr_reader :options + + # The environment from which to read GoodJob's environment variables. By + # default, this is the current process's environment, but it can be set + # to something else in {#initialize}. + # @return [Hash] + attr_reader :env # @param options [Hash] Any explicitly specified configuration options to # use. Keys are symbols that match the various methods on this class. diff --git a/lib/good_job/lockable.rb b/lib/good_job/lockable.rb index 7db085346..6cb2a2a13 100644 --- a/lib/good_job/lockable.rb +++ b/lib/good_job/lockable.rb @@ -92,8 +92,6 @@ module Lockable # @return [ActiveRecord::Relation] scope :owns_advisory_locked, -> { joins_advisory_locks.where('"pg_locks"."pid" = pg_backend_pid()') } - # @!attribute [r] create_with_advisory_lock - # @return [Boolean] # Whether an advisory lock should be acquired in the same transaction # that created the record. # @@ -107,6 +105,8 @@ module Lockable # record = MyLockableRecord.create(create_with_advisory_lock: true) # record.advisory_locked? # => true + # + # @return [Boolean] attr_accessor :create_with_advisory_lock after_create -> { advisory_lock }, if: :create_with_advisory_lock diff --git a/lib/good_job/scheduler.rb b/lib/good_job/scheduler.rb index 38706d20d..8a826a46a 100644 --- a/lib/good_job/scheduler.rb +++ b/lib/good_job/scheduler.rb @@ -8,7 +8,7 @@ module GoodJob # :nodoc: # periodically checking for available tasks, executing tasks within a thread, # and efficiently scaling active threads. # - # Every scheduler has a single {Performer} that will execute tasks. + # Every scheduler has a single {JobPerformer} that will execute tasks. # The scheduler is responsible for calling its performer efficiently across threads managed by an instance of +Concurrent::ThreadPoolExecutor+. # If a performer does not have work, the thread will go to sleep. # The scheduler maintains an instance of +Concurrent::TimerTask+, which wakes sleeping threads and causes them to check whether the performer has new work.