Class: GoodJob::CLI
- Inherits:
-
Thor
- Object
- Thor
- GoodJob::CLI
- Defined in:
- lib/good_job/cli.rb
Overview
Implements the good_job
command-line tool, which executes jobs and provides other utilities. The actual entry point is in exe/good_job
, but it just sets up and calls this class.
The good_job
command-line tool is based on Thor, a CLI framework for Ruby. For more on general usage, see whatisthor.com/ and github.com/erikhuda/thor/wiki.
Constant Summary collapse
- RAILS_ENVIRONMENT_RB =
Path to the local Rails application’s environment configuration. Requiring this loads the application’s configuration and classes.
File.("config/environment.rb")
- SHUTDOWN_EVENT_TIMEOUT =
Number of seconds between checking shutdown conditions
10
- SHUTDOWN_EVENT_TIMEOUT_FOR_IDLE_TIMEOUT =
Number of seconds between checking shutdown conditions when idle-timeout is enabled
1
Class Attribute Summary collapse
-
.log_to_stdout ⇒ Boolean?
(also: log_to_stdout?)
Whether to log to STDOUT.
-
.within_exe ⇒ Boolean?
(also: within_exe?)
Whether the CLI is running from the executable.
Instance Method Summary collapse
-
#cleanup_preserved_jobs ⇒ void
The good_job cleanup_preserved_jobs command.
-
#start ⇒ void
The good_job start command.
Class Attribute Details
.log_to_stdout ⇒ Boolean? Also known as: log_to_stdout?
Whether to log to STDOUT
34 35 36 |
# File 'lib/good_job/cli.rb', line 34 def log_to_stdout @log_to_stdout end |
.within_exe ⇒ Boolean? Also known as: within_exe?
Whether the CLI is running from the executable
29 30 31 |
# File 'lib/good_job/cli.rb', line 29 def within_exe @within_exe end |
Instance Method Details
#cleanup_preserved_jobs ⇒ void
This method returns an undefined value.
The good_job cleanup_preserved_jobs command. Destroys preserved job records.
143 |
# File 'lib/good_job/cli.rb', line 143 desc :cleanup_preserved_jobs, "Destroys preserved job records." |
#start ⇒ void
This method returns an undefined value.
The good_job start command. Executes queued jobs.
47 |
# File 'lib/good_job/cli.rb', line 47 desc :start, "Executes queued jobs." |