daemon-ogre 2.0.3 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/daemon-ogre.gemspec +4 -4
- data/example/daemonizable.rb +6 -5
- data/lib/daemon-ogre/argv.rb +16 -16
- data/lib/daemon-ogre/daemon.rb +2 -0
- metadata +5 -6
- data/test/test.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e400ceb398c0e8e7743eb1bb2212f52f4abd340
|
4
|
+
data.tar.gz: eafdce6239cbf60aad84e99ae619b980b800d30c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 132b3c0161b81c45a74da51c079bc5a99f356bebf5eb3aa5bd2b92528c84a097c8f8956f0aceab2b91b6aa8c7f78eaee7e046f754bf2cc2833f1b23d7876035b
|
7
|
+
data.tar.gz: ac2fa08e2c23a323e1a0a25d2a198bf4f3ce51af9e3d58bedd5aa27589a7c2f2835ba08c43af661f8320b109cc4edee1995c037f936f40e015479d166c12e4a6
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.1.1
|
data/daemon-ogre.gemspec
CHANGED
@@ -16,11 +16,11 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_dependency
|
20
|
-
spec.add_dependency
|
19
|
+
spec.add_dependency 'argv', '>= 3.0.0'
|
20
|
+
spec.add_dependency 'tmp', '>= 2.2.2'
|
21
21
|
|
22
|
-
spec.add_development_dependency
|
23
|
-
spec.add_development_dependency
|
22
|
+
spec.add_development_dependency 'bundler'
|
23
|
+
spec.add_development_dependency 'rake'
|
24
24
|
|
25
25
|
end
|
26
26
|
|
data/example/daemonizable.rb
CHANGED
@@ -1,14 +1,11 @@
|
|
1
|
-
require 'daemon-ogre
|
1
|
+
require 'daemon-ogre'
|
2
2
|
|
3
3
|
# start as
|
4
4
|
# ruby sample_daemon_app.rb --daemon
|
5
|
-
#
|
6
|
-
# to check it's running
|
7
|
-
# `ps aux | grep $0`
|
8
5
|
|
9
6
|
puts "app name: #{$0}"
|
10
7
|
|
11
|
-
|
8
|
+
ARGV.show_help
|
12
9
|
DaemonOgre.init
|
13
10
|
|
14
11
|
60.times do
|
@@ -17,3 +14,7 @@ DaemonOgre.init
|
|
17
14
|
sleep 1
|
18
15
|
|
19
16
|
end
|
17
|
+
|
18
|
+
sleep 1
|
19
|
+
# to check it's running
|
20
|
+
`ps aux | grep $0`
|
data/lib/daemon-ogre/argv.rb
CHANGED
@@ -3,15 +3,9 @@ module DaemonOgre
|
|
3
3
|
module DARGV
|
4
4
|
class << self
|
5
5
|
|
6
|
-
def check_args_for *args
|
7
|
-
|
8
|
-
|
9
|
-
if args.include?(element)
|
10
|
-
return true
|
11
|
-
end
|
12
|
-
end
|
13
|
-
return false
|
14
|
-
|
6
|
+
def check_args_for( *args )
|
7
|
+
args = args.map(&:to_s)
|
8
|
+
return ARGV.options.any?{|opt| args.include?(opt) }
|
15
9
|
end
|
16
10
|
|
17
11
|
@@daemon_keys= [:daemonize,:daemon,:d]
|
@@ -25,16 +19,22 @@ module DaemonOgre
|
|
25
19
|
check_args_for( *@@terminate_keys )
|
26
20
|
end
|
27
21
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
22
|
+
ARGV.add_help(
|
23
|
+
[
|
24
|
+
'Start with one of the following tags the app,',
|
25
|
+
'and it will be daemonized'
|
26
|
+
].join(' '),
|
27
|
+
*@@daemon_keys.map(&:to_s)
|
32
28
|
|
33
|
-
::ARGVEXT.add_help_msg(
|
34
|
-
"Start with one of the following tags the app, and it will be terminate the running app instance",
|
35
|
-
*@@terminate_keys
|
36
29
|
)
|
37
30
|
|
31
|
+
ARGV.add_help(
|
32
|
+
[
|
33
|
+
'Start with one of the following tags the app,',
|
34
|
+
'and it will be terminate the running app instance'
|
35
|
+
].join(' '),
|
36
|
+
*@@terminate_keys.map(&:to_s)
|
37
|
+
)
|
38
38
|
|
39
39
|
end
|
40
40
|
end
|
data/lib/daemon-ogre/daemon.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daemon-ogre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: argv
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: tmp
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,7 +87,6 @@ files:
|
|
87
87
|
- lib/daemon-ogre/daemon.rb
|
88
88
|
- lib/daemon-ogre/opts.rb
|
89
89
|
- test/example.rb
|
90
|
-
- test/test.rb
|
91
90
|
homepage: http://github.com/adamluzsi/daemon-ogre
|
92
91
|
licenses: []
|
93
92
|
metadata: {}
|
@@ -113,4 +112,4 @@ specification_version: 4
|
|
113
112
|
summary: Simple to use app ARGV based daemonizer
|
114
113
|
test_files:
|
115
114
|
- test/example.rb
|
116
|
-
|
115
|
+
has_rdoc:
|
data/test/test.rb
DELETED