Class: QuickUtils::RakeDaemon
- Inherits:
-
RailsDaemon
- Object
- RailsDaemon
- QuickUtils::RakeDaemon
- Defined in:
- lib/quick_utils/rake_daemon.rb
Constant Summary collapse
- @@rake_task =
''
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from RailsDaemon
#daemonize, #initialize, set_process_name, set_rails_root
Constructor Details
This class inherits a constructor from QuickUtils::RailsDaemon
Class Method Details
.set_rake_task(task) ⇒ Object
6 7 8 |
# File 'lib/quick_utils/rake_daemon.rb', line 6 def self.set_rake_task(task) @@rake_task = task end |
Instance Method Details
#run(worker_name = nil) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/quick_utils/rake_daemon.rb', line 10 def run(worker_name = nil) ENV['RAILS_ENV'] = @options[:environment].to_s ENV['LOG_FILE'] = @@log_file exec "cd #{@@rails_root}; exec rake RAILS_ENV='#{@options[:environment].to_s}' LOG_FILE='#{@@log_file}' #{@@rake_task}" end |