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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d1282be3a00c0f093ff319e81fb3602b99fc0b5
4
- data.tar.gz: 4c4989f2ea833ea59092e0fd63ebee22b7043db5
3
+ metadata.gz: 3e400ceb398c0e8e7743eb1bb2212f52f4abd340
4
+ data.tar.gz: eafdce6239cbf60aad84e99ae619b980b800d30c
5
5
  SHA512:
6
- metadata.gz: 205c696cf78ea9dd179a8ce6dcbbb4de2ad1ae02eee282830f6ee2ba454f1c53bf3dd8a4f1171bb32bf1f4cd39ebe3089690c86cba4e2531bf08a01a98654747
7
- data.tar.gz: 159ba9356e19ecd4c5937143562b6f66ed33144c73df47e9bb90a0b7789d881900d40527e412ea83544a17314395f604c6ade6d5ad5753f6c0820179fa3c7fc7
6
+ metadata.gz: 132b3c0161b81c45a74da51c079bc5a99f356bebf5eb3aa5bd2b92528c84a097c8f8956f0aceab2b91b6aa8c7f78eaee7e046f754bf2cc2833f1b23d7876035b
7
+ data.tar.gz: ac2fa08e2c23a323e1a0a25d2a198bf4f3ce51af9e3d58bedd5aa27589a7c2f2835ba08c43af661f8320b109cc4edee1995c037f936f40e015479d166c12e4a6
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.3
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 "argv", ">= 2.1.0"
20
- spec.add_dependency "tmp", ">= 2.2.2"
19
+ spec.add_dependency 'argv', '>= 3.0.0'
20
+ spec.add_dependency 'tmp', '>= 2.2.2'
21
21
 
22
- spec.add_development_dependency "bundler"
23
- spec.add_development_dependency "rake"
22
+ spec.add_development_dependency 'bundler'
23
+ spec.add_development_dependency 'rake'
24
24
 
25
25
  end
26
26
 
@@ -1,14 +1,11 @@
1
- require 'daemon-ogre.rb'
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
- ARGVEXT.show_help
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`
@@ -3,15 +3,9 @@ module DaemonOgre
3
3
  module DARGV
4
4
  class << self
5
5
 
6
- def check_args_for *args
7
-
8
- ::ARGV.flag_syms.each do |element|
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
- ::ARGVEXT.add_help_msg(
29
- "Start with one of the following tags the app, and it will be daemonized",
30
- *@@daemon_keys
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
@@ -65,9 +65,11 @@ module DaemonOgre
65
65
  $stdout.sync = $stderr.sync = true
66
66
 
67
67
  rescue Errno::ENOENT => ex
68
+
68
69
  var -= 1
69
70
  retry if var > 0
70
71
  raise ex.class,ex
72
+
71
73
  end
72
74
 
73
75
  end
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.0.3
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-04-24 00:00:00.000000000 Z
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: 2.1.0
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: 2.1.0
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
- - test/test.rb
115
+ has_rdoc:
data/test/test.rb DELETED
@@ -1,3 +0,0 @@
1
-
2
- keys= [:d,:daemon,:daemonize]
3
- puts ( keys && [:d] ).inspect# == keys