daemonite 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/TODO +1 -2
- data/daemonite.gemspec +1 -1
- data/lib/daemonite.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65942d0e1766aaaefd265802b2da578889f1f23e
|
4
|
+
data.tar.gz: 621e08d9f66f3c7f771d442550ac528434916020
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b010e060ec3fcd4f45724f7a3104cf633be36b6a624b36f1d4ca57db198e8a433986e86e1890602e4444ac1b79095261bfc3da9c415e42a2be7384cc65cfbb74
|
7
|
+
data.tar.gz: 6d5ab3d54e5ff67d233c069094d7491245859a80b1256b4ecc48418f641e1c97d8874ca2dd8eb4cb19ac455c9953bc0c9ca2044032234f83ee05e59ddc7471c4
|
data/README.md
CHANGED
@@ -11,8 +11,8 @@ details.
|
|
11
11
|
## Introduction
|
12
12
|
|
13
13
|
Deamonite is just syntactic sugar around Process.daemon and argparse, which are
|
14
|
-
part of
|
15
|
-
*nix because it runs 'ps ax' (that rhymes). I know, thats clumsy and I'm a lazy
|
14
|
+
part of ruby. And it gives you a simple loop. And it only works on
|
15
|
+
*nix, because it runs 'ps ax' (that rhymes). I know, thats clumsy and I'm a lazy
|
16
16
|
git. Please contribute a better solution if you have to.
|
17
17
|
|
18
18
|
## Why
|
@@ -38,10 +38,10 @@ end.loop!
|
|
38
38
|
|
39
39
|
Everything inside the #new block is executed once. Everything inside the #run
|
40
40
|
block is executed periodically. So make sure to include sleep to not bog down
|
41
|
-
your CPU. Or not - listen to network connections. #loop! finally
|
42
|
-
contents of #run
|
41
|
+
your CPU. Or not - i.e. listen to network connections. #loop! finally invokes the
|
42
|
+
contents of #run continuously.
|
43
43
|
|
44
|
-
In order to override
|
44
|
+
In order to override or provide your own options:
|
45
45
|
|
46
46
|
```ruby
|
47
47
|
Daemonite.new(opts)
|
data/TODO
CHANGED
data/daemonite.gemspec
CHANGED
data/lib/daemonite.rb
CHANGED
@@ -124,8 +124,8 @@ class Daemonite
|
|
124
124
|
end
|
125
125
|
|
126
126
|
puts "Server started as PID:#{Process.pid}"
|
127
|
-
File.write(@opts[:basepath] + '/' + @opts[:pidfile],Process.pid)
|
128
127
|
Process.daemon(@opts[:basepath]) unless @opts[:verbose]
|
128
|
+
File.write(@opts[:basepath] + '/' + @opts[:pidfile],Process.pid) # after daemon, so that we get the forked pid
|
129
129
|
Dir.chdir(@opts[:basepath])
|
130
130
|
::Kernel::at_exit do
|
131
131
|
File.unlink(@opts[:basepath] + '/' + @opts[:pidfile])
|