Module: Loops
- Includes:
- Errors
- Defined in:
- lib/loops/version.rb,
lib/loops.rb,
lib/loops/cli.rb,
lib/loops/queue.rb,
lib/loops/worker.rb,
lib/loops/autoload.rb,
lib/loops/daemonize.rb,
lib/loops/cli/options.rb,
lib/loops/worker_pool.rb,
lib/loops/cli/commands.rb,
lib/loops/process_manager.rb
Overview
Contains information about currently used Loops version.
Defined Under Namespace
Modules: Commands, Daemonize, Errors Classes: Base, CLI, Command, Engine, Logger, ProcessManager, Queue, Worker, WorkerPool
Constant Summary collapse
- LIB_ROOT =
Returns a full path to the loops “lib” directory.
File.(File.dirname(__FILE__))
- BINARY =
Returns a full path to the loops binary file.
File.(File.join(LIB_ROOT, '../bin/loops'))
- VERSION =
'2.0.6'
Constants included from Errors
Errors::Error, Errors::InvalidCommandError, Errors::InvalidFrameworkError
Class Method Summary collapse
- .__p(*path) ⇒ Object
-
.config_file ⇒ Pathname
Get loops config file full path.
-
.config_file=(config_file) ⇒ Pathname
Set loops config file path.
-
.default_logger ⇒ Logger
Get the current framework’s default logger.
-
.default_logger=(logger) ⇒ Logger
Set the current framework’s default logger.
-
.logger ⇒ Loops::Logger
Get the current loops logger.
-
.logger=(logger) ⇒ Object
Set the current loops logger.
-
.loops_root ⇒ Pathname
Get directory containing loops classes.
-
.loops_root=(loops_root) ⇒ Pathname
Set loops classes directory path.
-
.pid_file ⇒ Pathname
Get the loops monitor process pid file path.
-
.pid_file=(pid_file) ⇒ Pathname
Set the loops monitor pid file path.
-
.root ⇒ Pathname?
Loops root directory.
-
.root=(path) ⇒ Pathname
Set loops root directory.
Class Method Details
.__p(*path) ⇒ Object
3 |
# File 'lib/loops/autoload.rb', line 3 def self.__p(*path) File.join(Loops::LIB_ROOT, 'loops', *path) end |
.config_file ⇒ Pathname
Get loops config file full path.
47 48 49 |
# File 'lib/loops.rb', line 47 def self.config_file @@config_file ||= root.join('config/loops.yml') end |
.config_file=(config_file) ⇒ Pathname
Set loops config file path.
This is internal method used to set the loops config file path.
63 64 65 |
# File 'lib/loops.rb', line 63 def self.config_file=(config_file) @@config_file = root.join(config_file) if config_file end |
.default_logger ⇒ Logger
Get the current framework’s default logger.
149 150 151 |
# File 'lib/loops.rb', line 149 def self.default_logger @@default_logger end |
.default_logger=(logger) ⇒ Logger
Set the current framework’s default logger.
162 163 164 |
# File 'lib/loops.rb', line 162 def self.default_logger=(logger) @@default_logger = logger end |
.logger ⇒ Loops::Logger
Get the current loops logger.
There are two contexts where different devices (usually) will be configured for this logger instance:
-
In context of loops monitor logger device will be retrieved from the global section of the loops config file, or STDOUT when it was not configured.
-
In context of loop proccess logger device will be configured based on logger value of the particular loop section in the config file.
134 135 136 |
# File 'lib/loops.rb', line 134 def self.logger @@logger ||= ::Loops::Logger.new($stdout) end |
.logger=(logger) ⇒ Object
Set the current loops logger.
140 141 142 |
# File 'lib/loops.rb', line 140 def self.logger=(logger) @@logger = logger end |
.loops_root ⇒ Pathname
Get directory containing loops classes.
72 73 74 |
# File 'lib/loops.rb', line 72 def self.loops_root @@loops_root ||= root.join('app/loops') end |
.loops_root=(loops_root) ⇒ Pathname
Set loops classes directory path.
This is internal method used to set directory where loops classes will be searched.
88 89 90 |
# File 'lib/loops.rb', line 88 def self.loops_root=(loops_root) @@loops_root = root.join(loops_root) if loops_root end |
.pid_file ⇒ Pathname
Get the loops monitor process pid file path.
97 98 99 |
# File 'lib/loops.rb', line 97 def self.pid_file @@pid_file ||= root.join('loops.pid') end |
.pid_file=(pid_file) ⇒ Pathname
Set the loops monitor pid file path.
This is internal method used to set the loops monitor pid file path.
112 113 114 |
# File 'lib/loops.rb', line 112 def self.pid_file=(pid_file) @@pid_file = root.join(pid_file) if pid_file end |
.root ⇒ Pathname?
Loops root directory.
Usually it is initialized with framework’s root dir (RAILS_ROOT or MERB_ROOT), but you can specify another directory using command line arguments.
Loops current directory will is set to this value (chdir).
23 24 25 |
# File 'lib/loops.rb', line 23 def self.root @@root end |
.root=(path) ⇒ Pathname
Set loops root directory.
This is internal method used to set the loops root directory.
38 39 40 |
# File 'lib/loops.rb', line 38 def self.root=(path) @@root = Pathname.new(path).realpath end |