Class: DisqueJockey::Configuration
- Inherits:
-
Object
- Object
- DisqueJockey::Configuration
- Defined in:
- lib/disque_jockey/configuration.rb
Instance Attribute Summary collapse
-
#env ⇒ Object
Returns the value of attribute env.
-
#log_path ⇒ Object
Returns the value of attribute log_path.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#worker_groups ⇒ Object
Returns the value of attribute worker_groups.
Instance Method Summary collapse
- #daemonize? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #log_path_for_environment ⇒ Object
-
#worker_groups_for_environment ⇒ Object
TODO: just read this from a config file.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
4 5 6 7 8 |
# File 'lib/disque_jockey/configuration.rb', line 4 def initialize # set defaults @worker_groups = worker_groups_for_environment @log_path = log_path_for_environment end |
Instance Attribute Details
#env ⇒ Object
Returns the value of attribute env.
3 4 5 |
# File 'lib/disque_jockey/configuration.rb', line 3 def env @env end |
#log_path ⇒ Object
Returns the value of attribute log_path.
3 4 5 |
# File 'lib/disque_jockey/configuration.rb', line 3 def log_path @log_path end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/disque_jockey/configuration.rb', line 3 def logger @logger end |
#worker_groups ⇒ Object
Returns the value of attribute worker_groups.
3 4 5 |
# File 'lib/disque_jockey/configuration.rb', line 3 def worker_groups @worker_groups end |
Instance Method Details
#daemonize? ⇒ Boolean
14 15 16 |
# File 'lib/disque_jockey/configuration.rb', line 14 def daemonize? env != 'development' end |
#log_path_for_environment ⇒ Object
18 19 20 |
# File 'lib/disque_jockey/configuration.rb', line 18 def log_path_for_environment env == 'test' ? 'spec/log' : 'log' end |
#worker_groups_for_environment ⇒ Object
TODO: just read this from a config file
23 24 25 |
# File 'lib/disque_jockey/configuration.rb', line 23 def worker_groups_for_environment env == 'development' ? 2 : 4 end |