dctl 1.0.1 → 1.0.2
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/CHANGELOG +4 -0
- data/Rakefile +1 -1
- data/lib/dctl/cmdparser.rb +1 -1
- data/lib/dctl/command.rb +8 -8
- data/lib/dctl/daemon.rb +1 -2
- data/lib/dctl/metainf.rb +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
*1.0.2* (18th April, 2005) Bruno Carnazzi <mailto:bcarnazzi@gmail.com>
|
2
|
+
* better gem dependency support for cmdparse (>=1.0.1 required)
|
3
|
+
* added a check for incomplete command
|
4
|
+
|
1
5
|
*1.0.1* (08th April, 2005) Bruno Carnazzi <mailto:bcarnazzi@gmail.com>
|
2
6
|
* updated Rakefile (and included gemspec)
|
3
7
|
* added a check on daemon for valid app_path (daemon_test.rb updated)
|
data/Rakefile
CHANGED
data/lib/dctl/cmdparser.rb
CHANGED
data/lib/dctl/command.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
begin
|
2
2
|
require 'rubygems'
|
3
|
-
|
3
|
+
require_gem 'cmdparse' '> 1.0.0'
|
4
4
|
rescue LoadError
|
5
5
|
require 'cmdparse'
|
6
6
|
end
|
7
7
|
|
8
|
+
# require 'optparse'
|
8
9
|
require 'dctl/defaults'
|
9
10
|
require 'dctl/daemon'
|
10
11
|
|
@@ -40,7 +41,7 @@ module Dctl
|
|
40
41
|
|
41
42
|
def execute(cmd_parser, args)
|
42
43
|
cmd_args = args.slice! 1, args.length
|
43
|
-
cmd = args[0]
|
44
|
+
cmd = args[0] || raise(OptionParser::MissingArgument)
|
44
45
|
Dctl::Daemon.new(cmd, $DIR).start(cmd_args, @stdin, @stdout, @stderr)
|
45
46
|
end
|
46
47
|
end
|
@@ -59,7 +60,7 @@ module Dctl
|
|
59
60
|
|
60
61
|
def execute(cmd_parser, args)
|
61
62
|
cmd_args = args.slice! 1, args.length
|
62
|
-
cmd = args[0]
|
63
|
+
cmd = args[0] || raise(OptionParser::MissingArgument)
|
63
64
|
Dctl::Daemon.new(cmd, $DIR).restart(cmd_args, @stdin, @stdout, @stderr)
|
64
65
|
end
|
65
66
|
end
|
@@ -75,7 +76,7 @@ module Dctl
|
|
75
76
|
end
|
76
77
|
|
77
78
|
def execute(cmd_parser, args)
|
78
|
-
cmd = args[0]
|
79
|
+
cmd = args[0] || raise(OptionParser::MissingArgument)
|
79
80
|
Dctl::Daemon.new(cmd, $DIR).stop
|
80
81
|
end
|
81
82
|
end
|
@@ -91,7 +92,7 @@ module Dctl
|
|
91
92
|
end
|
92
93
|
|
93
94
|
def execute(cmd_parser, args)
|
94
|
-
cmd = args[0]
|
95
|
+
cmd = args[0] || raise(OptionParser::MissingArgument)
|
95
96
|
Dctl::Daemon.new(cmd, $DIR).zap
|
96
97
|
end
|
97
98
|
end
|
@@ -108,7 +109,7 @@ module Dctl
|
|
108
109
|
|
109
110
|
def execute(cmd_parser, args)
|
110
111
|
cmd_args = args.slice! 1, args.length
|
111
|
-
cmd = args[0]
|
112
|
+
cmd = args[0] || raise(OptionParser::MissingArgument)
|
112
113
|
Dctl::Daemon.new(cmd, $DIR).run(cmd_args)
|
113
114
|
end
|
114
115
|
end
|
@@ -124,11 +125,10 @@ module Dctl
|
|
124
125
|
end
|
125
126
|
|
126
127
|
def execute(cmd_parser, args)
|
127
|
-
cmd = args[0]
|
128
|
+
cmd = args[0] || raise(OptionParser::MissingArgument)
|
128
129
|
puts "#{File.basename cmd}: #{Dctl::Daemon.new(cmd, $DIR).status}"
|
129
130
|
end
|
130
131
|
end
|
131
|
-
|
132
132
|
|
133
133
|
end
|
134
134
|
|
data/lib/dctl/daemon.rb
CHANGED
@@ -8,8 +8,7 @@ module Dctl
|
|
8
8
|
include Daemonize
|
9
9
|
|
10
10
|
def initialize(cmd, pidpath)
|
11
|
-
@app_path = Daemon::which cmd
|
12
|
-
@app_path = File.expand_path cmd if not @app_path
|
11
|
+
@app_path = Daemon::which(cmd) || File.expand_path(cmd)
|
13
12
|
raise Errno::EISDIR, @app_path if File.directory? @app_path
|
14
13
|
raise Errno::ENOENT, @app_path until File.file? @app_path
|
15
14
|
raise Errno::EACCES, @app_path until File.executable? @app_path
|
data/lib/dctl/metainf.rb
CHANGED
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.10
|
|
3
3
|
specification_version: 1
|
4
4
|
name: dctl
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.0.
|
7
|
-
date: 2005-04-
|
6
|
+
version: 1.0.2
|
7
|
+
date: 2005-04-18
|
8
8
|
summary: "dctl - a daemon controller written in Ruby"
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -68,7 +68,7 @@ dependencies:
|
|
68
68
|
version_requirements: !ruby/object:Gem::Version::Requirement
|
69
69
|
requirements:
|
70
70
|
-
|
71
|
-
- "
|
71
|
+
- ">"
|
72
72
|
- !ruby/object:Gem::Version
|
73
73
|
version: 1.0.0
|
74
74
|
version:
|