README.markdown in daemons-rails-1.1.0 vs README.markdown in daemons-rails-1.1.1
- old
+ new
@@ -3,11 +3,11 @@
To get it work just add dependency to this gem in your Gemfile.
## NOTES ##
-If you switching from version before 1.1 you may need to move script/daemons file to lib/daemons directory.
+**If you are switching from earlier version to 1.1 you may need to move script/daemons file to lib/daemons directory.**
## GENERATOR ##
rails generate daemon <name>
@@ -27,11 +27,11 @@
rake daemon:test:stop - stop daemon using lib/daemons/test_ctl stop
rake daemon:test:status - show running status for daemon using lib/daemons/test_ctl status
App-wide control script:
- ./script/daemons [start|stop|restart]
+ ./lib/daemons/daemons [start|stop|restart|status]
rake daemons:(start|stop|status)
## MONITORING API ##
Daemons::Rails::Monitoring.statuses - hash with all daemons and corresponding statuses
@@ -43,11 +43,11 @@
controller = Daemons::Rails::Monitoring.controller("test.rb")
controller.path # => lib/daemons/test_ctl
controller.app_name # => test.rb
controller.start # => starts daemon
controller.stop # => stops daemon
- controller.status # => :not_exists or :running
+ controller.status # => :not_exists or :running
## CONFIGURATION ##
You can set default settings for your daemons into config/daemons.yml file. Full list of options you can get from documentation to Daemons.daemonize method (http://daemons.rubyforge.org/classes/Daemons.html#M000007). Also it possible to set individual daemon options using file config/\<daemon_name\>-daemon.yml.
If you want to use directory other than default lib/daemons then you should add to application initialization block following lines:
@@ -61,10 +61,24 @@
end
If you change your mind, you can easily move content of this directory to other place and change config.
Notice: this feature available only from version 1.1 and old generated daemons can't be free moved, because uses hard-coded path to lib/daemons. So, you can generate daemons with same names and then move client code to generated templates.
+## USING MULTIPLE DAEMON SETS ##
+
+At this moment it is not supported at generators and rake tasks levels, but you can generate daemon to default location and move to different folder (you should also copy *daemons* script to same directory). Then you will be able to operate with them using following scripts:
+
+ other/daemons/location/daemons [start|stop|restart|status]
+ other/daemons/location/<daemon_name>_ctl [start|stop|restart|status]
+
+To access the daemons with Monitoring API you can use configured instance of *Daemons::Rails::Monitoring*:
+
+ Daemons::Rails::Monitoring.new("other/daemons/location")
+
+and same set of methods. Effectively, *Daemons::Rails::Monitoring* just delegates all method calls to *Daemons::Rails::Monitoring.default* initialized with configured daemons path.
+
## CHANGES ##
+* 1.1.1 - fix dependencies, clean-up specs
* 1.1.0 - supported custom directory for daemons, support multiple daemons directories
* 1.0.0 - changed api for Daemons::Rails::Monitoring, fixed path in template for script, improved documentation, added RSpec
* 0.0.3 - added rake for running script without daemonization (rake daemon:\<name\>)
\ No newline at end of file