svutil 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -0
- data/lib/svutil.rb +1 -1
- data/lib/svutil/config.rb +4 -4
- data/lib/svutil/process_manager.rb +6 -6
- metadata +4 -4
data/Rakefile
CHANGED
@@ -18,6 +18,7 @@ $hoe = Hoe.spec('svutil') do |p|
|
|
18
18
|
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
|
19
19
|
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
|
20
20
|
p.rsync_args = '-av --delete --ignore-errors'
|
21
|
+
p.readme_file = "README.rdoc"
|
21
22
|
end
|
22
23
|
|
23
24
|
require 'newgem/tasks' # load /tasks/*.rake
|
data/lib/svutil.rb
CHANGED
data/lib/svutil/config.rb
CHANGED
@@ -4,7 +4,7 @@ require 'ostruct'
|
|
4
4
|
require 'pp'
|
5
5
|
|
6
6
|
module SVUtil
|
7
|
-
def config
|
7
|
+
def self.config
|
8
8
|
Config.config_class
|
9
9
|
end
|
10
10
|
|
@@ -62,13 +62,13 @@ module SVUtil
|
|
62
62
|
def parse_options
|
63
63
|
OptionParser.new do |opts|
|
64
64
|
opts.on("-f", "--config [filename]", "Config file to use (default 'settings')") do |filename|
|
65
|
-
|
65
|
+
self.config_file = filename
|
66
66
|
end
|
67
67
|
opts.on("-d", "--daemon", "Run in the background as a daemon") do
|
68
|
-
|
68
|
+
self.set(:daemon, true)
|
69
69
|
end
|
70
70
|
opts.on("-l", "--debug-log [log-file]", "Debug Log File") do |log|
|
71
|
-
|
71
|
+
self.set(log_file, log)
|
72
72
|
end
|
73
73
|
yield opts if block_given?
|
74
74
|
end.parse!
|
@@ -7,7 +7,7 @@ module SVUtil
|
|
7
7
|
STDERR.puts "There is already a '#{$0}' process running"
|
8
8
|
exit 1
|
9
9
|
end
|
10
|
-
daemonize if config.daemon
|
10
|
+
daemonize if SVUtil::config.daemon
|
11
11
|
write_pid_file
|
12
12
|
@klass = klass
|
13
13
|
end
|
@@ -31,20 +31,20 @@ module SVUtil
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def running?
|
34
|
-
pid_file = config.pid_file
|
34
|
+
pid_file = SVUtil::config.pid_file
|
35
35
|
return false unless pid_file
|
36
36
|
File.exist?(pid_file)
|
37
37
|
end
|
38
38
|
|
39
39
|
def write_pid_file
|
40
|
-
pid_file = config.pid_file
|
40
|
+
pid_file = SVUtil::config.pid_file
|
41
41
|
return unless pid_file
|
42
42
|
File.open(pid_file, "w") { |f| f.write(Process.pid) }
|
43
43
|
File.chmod(0644, pid_file)
|
44
44
|
end
|
45
45
|
|
46
46
|
def remove_pid_file
|
47
|
-
pid_file = config.pid_file
|
47
|
+
pid_file = SVUtil::config.pid_file
|
48
48
|
return unless pid_file
|
49
49
|
File.unlink(pid_file) if File.exists?(pid_file)
|
50
50
|
end
|
@@ -56,9 +56,9 @@ module SVUtil
|
|
56
56
|
|
57
57
|
def redirect_io
|
58
58
|
begin; STDIN.reopen('/dev/null'); rescue Exception; end
|
59
|
-
if config.log_file
|
59
|
+
if SVUtil::config.log_file
|
60
60
|
begin
|
61
|
-
STDOUT.reopen(config.log_file, "a")
|
61
|
+
STDOUT.reopen(SVUtil::config.log_file, "a")
|
62
62
|
STDOUT.sync = true
|
63
63
|
rescue Exception
|
64
64
|
begin; STDOUT.reopen('/dev/null'); rescue Exception; end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: svutil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Draper
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.3.3
|
34
34
|
version:
|
35
|
-
description:
|
35
|
+
description: A simple managed process builder for Ruby projects
|
36
36
|
email:
|
37
37
|
- daniel@netfox.com
|
38
38
|
executables: []
|
@@ -56,13 +56,13 @@ files:
|
|
56
56
|
- test/test_helper.rb
|
57
57
|
- test/test_svutil.rb
|
58
58
|
has_rdoc: true
|
59
|
-
homepage:
|
59
|
+
homepage: http://svutil.rubyforge.org
|
60
60
|
licenses: []
|
61
61
|
|
62
62
|
post_install_message: PostInstall.txt
|
63
63
|
rdoc_options:
|
64
64
|
- --main
|
65
|
-
- README.
|
65
|
+
- README.rdoc
|
66
66
|
require_paths:
|
67
67
|
- lib
|
68
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|