daemon-ogre 1.3.4 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -13
- data/README.rdoc +11 -13
- data/VERSION +1 -1
- data/lib/daemon-ogre.rb +8 -4
- metadata +2 -2
data/README.md
CHANGED
@@ -29,11 +29,11 @@ Installation
|
|
29
29
|
|
30
30
|
### [RubyGems](http://rubygems.org/)
|
31
31
|
|
32
|
-
$ gem install 'daemon-ogre'
|
32
|
+
$ gem install 'daemon-ogre'
|
33
33
|
|
34
34
|
|
35
|
-
require 'daemon-ogre'
|
36
|
-
DaemonOgre.start
|
35
|
+
require 'daemon-ogre'
|
36
|
+
DaemonOgre.start
|
37
37
|
|
38
38
|
|
39
39
|
but we love config our beloved App!
|
@@ -47,6 +47,7 @@ but we love config our beloved App!
|
|
47
47
|
# with "start" arguments like :
|
48
48
|
# ruby my_awsome_app.rb start
|
49
49
|
|
50
|
+
|
50
51
|
In use?
|
51
52
|
-------
|
52
53
|
|
@@ -134,6 +135,7 @@ example:
|
|
134
135
|
|
135
136
|
|
136
137
|
if you need get a free port in a range or from, you can use this:
|
138
|
+
|
137
139
|
get_port(from_nmb,to_nmb,host)
|
138
140
|
|
139
141
|
or by simply
|
@@ -141,20 +143,16 @@ or by simply
|
|
141
143
|
get_port(number)
|
142
144
|
|
143
145
|
|
144
|
-
and if you hate find all the bugs... you can use error_logger at your command like this
|
146
|
+
and if you hate find all the bugs... you can use error_logger at your command like this if you running your process on
|
147
|
+
background and cannot puts on the terminal:
|
145
148
|
|
146
149
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
+
exlogger msg, #anything after this is optionable
|
151
|
+
:path => "./per_relative-absoluth_path",
|
152
|
+
:prefix => "it's something..."
|
150
153
|
|
151
|
-
rescue xyexception => ex
|
152
|
-
exlogger ex, #error_msg
|
153
|
-
prefix, #this is optionable! but i usualy use: "#{__FILE__}/#{__LINE__}"
|
154
|
-
log_file #this is optionable!
|
155
|
-
end
|
156
154
|
|
157
|
-
|
155
|
+
or with less fuss at the exception handle:
|
158
156
|
|
159
157
|
|
160
158
|
begin
|
data/README.rdoc
CHANGED
@@ -29,11 +29,11 @@ Installation
|
|
29
29
|
|
30
30
|
### [RubyGems](http://rubygems.org/)
|
31
31
|
|
32
|
-
$ gem install 'daemon-ogre'
|
32
|
+
$ gem install 'daemon-ogre'
|
33
33
|
|
34
34
|
|
35
|
-
require 'daemon-ogre'
|
36
|
-
DaemonOgre.start
|
35
|
+
require 'daemon-ogre'
|
36
|
+
DaemonOgre.start
|
37
37
|
|
38
38
|
|
39
39
|
but we love config our beloved App!
|
@@ -47,6 +47,7 @@ but we love config our beloved App!
|
|
47
47
|
# with "start" arguments like :
|
48
48
|
# ruby my_awsome_app.rb start
|
49
49
|
|
50
|
+
|
50
51
|
In use?
|
51
52
|
-------
|
52
53
|
|
@@ -134,6 +135,7 @@ example:
|
|
134
135
|
|
135
136
|
|
136
137
|
if you need get a free port in a range or from, you can use this:
|
138
|
+
|
137
139
|
get_port(from_nmb,to_nmb,host)
|
138
140
|
|
139
141
|
or by simply
|
@@ -141,20 +143,16 @@ or by simply
|
|
141
143
|
get_port(number)
|
142
144
|
|
143
145
|
|
144
|
-
and if you hate find all the bugs... you can use error_logger at your command like this
|
146
|
+
and if you hate find all the bugs... you can use error_logger at your command like this if you running your process on
|
147
|
+
background and cannot puts on the terminal:
|
145
148
|
|
146
149
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
+
exlogger msg, #anything after this is optionable
|
151
|
+
:path => "./per_relative-absoluth_path",
|
152
|
+
:prefix => "it's something..."
|
150
153
|
|
151
|
-
rescue xyexception => ex
|
152
|
-
exlogger ex, #error_msg
|
153
|
-
prefix, #this is optionable! but i usualy use: "#{__FILE__}/#{__LINE__}"
|
154
|
-
log_file #this is optionable!
|
155
|
-
end
|
156
154
|
|
157
|
-
|
155
|
+
or with less fuss at the exception handle:
|
158
156
|
|
159
157
|
|
160
158
|
begin
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.4.0
|
data/lib/daemon-ogre.rb
CHANGED
@@ -189,6 +189,7 @@ begin
|
|
189
189
|
:pid_path,
|
190
190
|
:daemon_stderr,
|
191
191
|
:exceptions,
|
192
|
+
:exlogger,
|
192
193
|
:app_name,
|
193
194
|
:port,
|
194
195
|
:terminate
|
@@ -205,7 +206,7 @@ begin
|
|
205
206
|
App.app_name = $0
|
206
207
|
|
207
208
|
begin
|
208
|
-
['daemon_stderr','exceptions'].each do |one_log|
|
209
|
+
['daemon_stderr','exceptions','exlogger'].each do |one_log|
|
209
210
|
|
210
211
|
App.__send__(one_log+"=",clone_mpath(App.log_path,one_log+".log"))
|
211
212
|
|
@@ -485,10 +486,13 @@ begin
|
|
485
486
|
def get_port(port,max_port=65535 ,host="0.0.0.0")
|
486
487
|
DaemonOgre.get_port(port,max_port,host)
|
487
488
|
end
|
488
|
-
def exlogger(error_msg
|
489
|
-
|
489
|
+
def exlogger(error_msg,*args)
|
490
|
+
arg=Hash[*args]
|
491
|
+
arg[:prefix] = String.new if arg[:prefix].nil?
|
492
|
+
arg[:path] = DaemonOgre::App.exlogger if arg[:path].nil?
|
493
|
+
DaemonOgre.create_on_filesystem arg[:path],
|
490
494
|
'a+'
|
491
|
-
DaemonOgre.error_logger(error_msg,prefix,
|
495
|
+
DaemonOgre.error_logger(error_msg,arg[:prefix],arg[:path])
|
492
496
|
end
|
493
497
|
class Exception
|
494
498
|
def logger
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daemon-ogre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -112,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
112
112
|
version: '0'
|
113
113
|
segments:
|
114
114
|
- 0
|
115
|
-
hash:
|
115
|
+
hash: 3688360315002378348
|
116
116
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
117
117
|
none: false
|
118
118
|
requirements:
|