Class: Arsenicum::Configuration
- Inherits:
-
Object
- Object
- Arsenicum::Configuration
- Defined in:
- lib/arsenicum/configuration.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ConfigurationHash, InstanceConfiguration, LoggerConfiguration, QueueConfiguration, RailsConfiguration, TaskConfiguration
Instance Attribute Summary collapse
-
#daemon ⇒ Object
readonly
Returns the value of attribute daemon.
-
#logger_config ⇒ Object
readonly
Returns the value of attribute logger_config.
-
#pidfile_path ⇒ Object
readonly
Returns the value of attribute pidfile_path.
-
#stderr_path ⇒ Object
readonly
Returns the value of attribute stderr_path.
-
#stdout_path ⇒ Object
readonly
Returns the value of attribute stdout_path.
-
#working_directory ⇒ Object
readonly
Returns the value of attribute working_directory.
Instance Method Summary collapse
- #daemonize ⇒ Object
- #directory(path) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #logger(&block) ⇒ Object
- #pidfile(path) ⇒ Object
- #queue(name, &block) ⇒ Object
- #queue_configurations ⇒ Object
- #stderr(path) ⇒ Object
- #stdout(path) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 |
# File 'lib/arsenicum/configuration.rb', line 9 def initialize @pidfile_path = 'arsenicum.pid' @logger_config = LoggerConfiguration.new @working_directory = '.' end |
Instance Attribute Details
#daemon ⇒ Object (readonly)
Returns the value of attribute daemon.
7 8 9 |
# File 'lib/arsenicum/configuration.rb', line 7 def daemon @daemon end |
#logger_config ⇒ Object (readonly)
Returns the value of attribute logger_config.
7 8 9 |
# File 'lib/arsenicum/configuration.rb', line 7 def logger_config @logger_config end |
#pidfile_path ⇒ Object (readonly)
Returns the value of attribute pidfile_path.
7 8 9 |
# File 'lib/arsenicum/configuration.rb', line 7 def pidfile_path @pidfile_path end |
#stderr_path ⇒ Object (readonly)
Returns the value of attribute stderr_path.
7 8 9 |
# File 'lib/arsenicum/configuration.rb', line 7 def stderr_path @stderr_path end |
#stdout_path ⇒ Object (readonly)
Returns the value of attribute stdout_path.
7 8 9 |
# File 'lib/arsenicum/configuration.rb', line 7 def stdout_path @stdout_path end |
#working_directory ⇒ Object (readonly)
Returns the value of attribute working_directory.
7 8 9 |
# File 'lib/arsenicum/configuration.rb', line 7 def working_directory @working_directory end |
Instance Method Details
#daemonize ⇒ Object
19 20 21 |
# File 'lib/arsenicum/configuration.rb', line 19 def daemonize @daemon = true end |
#directory(path) ⇒ Object
45 46 47 |
# File 'lib/arsenicum/configuration.rb', line 45 def directory(path) @working_directory = path end |
#logger(&block) ⇒ Object
31 32 33 |
# File 'lib/arsenicum/configuration.rb', line 31 def logger(&block) logger_config.instance_eval &block end |
#pidfile(path) ⇒ Object
41 42 43 |
# File 'lib/arsenicum/configuration.rb', line 41 def pidfile(path) @pidfile_path = path end |
#queue(name, &block) ⇒ Object
35 36 37 38 39 |
# File 'lib/arsenicum/configuration.rb', line 35 def queue(name, &block) queue_config = QueueConfiguration.new name queue_config.instance_eval &block if block_given? queue_configurations << queue_config end |
#queue_configurations ⇒ Object
15 16 17 |
# File 'lib/arsenicum/configuration.rb', line 15 def queue_configurations @queue_configurations ||= [] end |
#stderr(path) ⇒ Object
27 28 29 |
# File 'lib/arsenicum/configuration.rb', line 27 def stderr(path) @stderr_path = path end |
#stdout(path) ⇒ Object
23 24 25 |
# File 'lib/arsenicum/configuration.rb', line 23 def stdout(path) @stdout_path = path end |