README.md in daemon-ogre-1.2.0 vs README.md in daemon-ogre-1.2.1

- old
+ new

@@ -1,108 +1,117 @@ daemon-ogre =========== -= daemon-ogre +Installation +------------ +### [RubyGems](http://rubygems.org/) -gem install 'daemon-ogre' +$ gem install 'daemon-ogre' require 'daemon-ogre' DaemonOgre.start - but we love config our beloved App! --======================================================================================================================- -DaemonOgre.start :name => "MySuperAppName!", #this will be the name of the application - :log_path => "./var/log/log_file_name", #this will be the logfile place and name - :pid_path => "./var/pid/pid_file_name", #this will be the pidfile place and name - :terminate => true #this command not let start your code if it's not started - # with "start" arguments like : - # ruby my_awsome_app.rb start +but we love config our beloved App! +----------------------------------- --======================================================================================================================- - othere stuffs to use: - everybody love: require_relative... - so why should not try require_directory instead all the fuss - you can tell to it if you want some file to be excluded or just delayed loaded, - because you want them loaded in the last place - Example: + DaemonOgre.start :name => "MySuperAppName!", #this will be the name of the application + :log_path => "./var/log/log_file_name", #this will be the logfile place and name + :pid_path => "./var/pid/pid_file_name", #this will be the pidfile place and name + :terminate => true #this command not let start your code if it's not started + # with "start" arguments like : + # ruby my_awsome_app.rb start -require_directory "some_dir_name_from_here_where_are_multi_dir_levels" - or +othere stuffs to use: +--------------------- +everybody love: require_relative... +so why should not try require_directory instead all the fuss +you can tell to it if you want some file to be excluded or just delayed loaded, +because you want them loaded in the last place +Example: -require_directory "some_dir_name_from_here_where_are_multi_dir_levels", - :delayed => ["files","to","be","delayed","in","load"], - :exclude => ["files","to","be","exclude","in","load"] + require_directory "some_dir_name_from_here_where_are_multi_dir_levels" --======================================================================================================================- +or + + require_directory "some_dir_name_from_here_where_are_multi_dir_levels", + :delayed => ["files","to","be","delayed","in","load"], + :exclude => ["files","to","be","exclude","in","load"] + + + +Helpers +------- + and ofc what else what we love if not our beloved yml-s we should use a nice Config constant for this(or at least i love to do) -CONFIG = require_ymls "some_dir_name_from_here_where_are_the_yml_files_in_multi_dir_level" - the file names will be the hash-key and under that , there will be the yml file datas loaded in + CONFIG = require_ymls "some_dir_name_from_here_where_are_the_yml_files_in_multi_dir_level" +the file names will be the hash-key and under that , there will be the yml file datas loaded in - if you need get a free port in a range or from, you can use this: -get_port(from_nmb,to_nmb,host) +if you need get a free port in a range or from, you can use this: + get_port(from_nmb,to_nmb,host) - or by simply +or by simply -get_port(number) + get_port(number) - and if you hate find all the bugs... you can use error_logger at your command like this: +and if you hate find all the bugs... you can use error_logger at your command like this: -begin + begin - your awsome code! + your awsome code! -rescue xyexception => ex - logger ex, #error_msg - prefix, #this is optionable! but i usualy use: "#{__FILE__}/#{__LINE__}" - log_file #this is optionable! -end + rescue xyexception => ex + logger ex, #error_msg + prefix, #this is optionable! but i usualy use: "#{__FILE__}/#{__LINE__}" + log_file #this is optionable! + end if you need methods from any kind of class without the object methods, you should try this! -Xyclassname.class_methods + Xyclassname.class_methods you want make some test script with rnd numbers, strings, dates, bools etc? use the Rnd class at your command Rnd -string -number -boolean -date -example: Rnd.number(100) -or Rnd.string(15,2) #for rnd bla bla names +examples: + Rnd.number(100) + Rnd.string(15,2) #for rnd bla bla names You need get the index of an Array element? you can use: -array_variable.index_of("something) + array_variable.index_of("something) +Do you wanted to know , does that process running on that pid or not? + process_running?(nmbr) --=========================================================- in Short: -require 'daemon-ogre' -DaemonOgre.start +--------- + require 'daemon-ogre' + DaemonOgre.start #arguments if you want :) + your_Super_app_code! -for boot your files and ymls, helpers above :) -your_Super_app_code! - == Contributing to daemon-ogre * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet. * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it. * Fork the project. @@ -116,6 +125,6 @@ Copyright (c) 2013 adam.luzsi. See LICENSE.txt for further details. -daemon-ogre +daemon-ogre \ No newline at end of file