jobmanager 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/FAQ.txt CHANGED
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  === Does +jobmanager+ rotate its own log file?
2
4
 
3
5
  No. If +jobmanager+ is configured to log directly to a file
@@ -1,2 +1,4 @@
1
+ === 1.0.1 / 2007-08-27
2
+ Remove the dependency on the sys-host gem.
1
3
  === 1.0.0 / 2008-07-18
2
4
  Initial release of jobmanager. This package is unit tested fully.
data/README.txt CHANGED
@@ -1,6 +1,4 @@
1
- = jobmanager
2
- * Project Page: http://rubyforge.org/projects/jobmanager/
3
- * Documentation: http://jobmanager.rubyforge.org/
1
+ Object
4
2
 
5
3
  == DESCRIPTION:
6
4
 
@@ -309,14 +307,13 @@ will be sent to the terminal.
309
307
  == REQUIREMENTS:
310
308
 
311
309
  The +jobmanager+ application requires a number of gems: hoe,
312
- SyslogLogger, sys-host, configtoolkit, simpleemail, logrotate,
310
+ SyslogLogger, configtoolkit, simpleemail, logrotate,
313
311
  assertions, and relative.
314
312
 
315
313
  Hoe and assertions are required only for running the tests. Relative is
316
314
  required for running the tests and the examples. The rest of the gems
317
315
  listed above are required for the proper functioning of the
318
- +jobmanager+ application. The sys-host gem is required only for the
319
- purpose of including the hostname in the email subject line.
316
+ +jobmanager+ application.
320
317
 
321
318
  == INSTALL:
322
319
 
data/Rakefile CHANGED
@@ -2,7 +2,7 @@
2
2
  require 'rubygems'
3
3
  require 'hoe'
4
4
 
5
- Hoe.new('jobmanager', "1.0.0") do |p|
5
+ Hoe.new('jobmanager', "1.0.1") do |p|
6
6
  p.remote_rdoc_dir = ''
7
7
  p.developer('DesigningPatterns', 'technical.inquiries@designingpatterns.com')
8
8
 
@@ -11,7 +11,6 @@ Hoe.new('jobmanager', "1.0.0") do |p|
11
11
  p.extra_deps << ['relative']
12
12
  p.extra_deps << ['logrotate']
13
13
  p.extra_deps << ['SyslogLogger']
14
- p.extra_deps << ['sys-host']
15
14
  end
16
15
 
17
16
  # vim: syntax=Ruby
@@ -7,7 +7,6 @@ require 'stringio'
7
7
  require 'rubygems'
8
8
  require 'logrotate'
9
9
  require 'relative'
10
- require 'sys/host'
11
10
  require 'configtoolkit'
12
11
  require 'configtoolkit/yamlreader'
13
12
  require 'configtoolkit/hashreader'
@@ -404,7 +403,7 @@ module JobManager
404
403
  # ERB. Resolve the following variables to their values listed
405
404
  # below.
406
405
  result = success ? "Success" : "Failure"
407
- host_name = Sys::Host.hostname
406
+ host_name = JobManager.exec_or_raise("hostname").chomp()
408
407
  job_name = @config.job_name
409
408
  command = @config.command
410
409
  user_name = @user_name
@@ -20,6 +20,35 @@ module JobManager
20
20
  $-w = save
21
21
  end
22
22
  end
23
+
24
+ # ====Description:
25
+ # Execute the given command. Raise an error on failure.
26
+ #
27
+ # ====Parameters:
28
+ # [command]
29
+ # The command to be executed.
30
+ # [options]
31
+ # The following list of options is allowed.
32
+ # +verbose+:: Print the command as well as the output of the executed command.
33
+ #
34
+ # ====Returns:
35
+ # The command's output.
36
+ #
37
+ def self.exec_or_raise(command, options = {})
38
+ if options[:verbose] then print "#{command}\n" end
39
+
40
+ result = %x[ #{command} ]
41
+
42
+ if options[:verbose] then
43
+ result.split("\n").each { |line| print "+ #{line}\n" }
44
+ end
45
+
46
+ if ($CHILD_STATUS != 0)
47
+ raise "+ Command (#{command}) Failed! Exit Status: #{$CHILD_STATUS.inspect}"
48
+ end
49
+
50
+ return result
51
+ end
23
52
 
24
53
  end
25
54
 
@@ -37,7 +37,7 @@ class TestJobManager < Test::Unit::TestCase
37
37
 
38
38
  PROGRAM_NAME = $0
39
39
  USER_NAME = Etc.getpwuid(Process::Sys.getuid()).name()
40
- HOST_NAME = Sys::Host.hostname
40
+ HOST_NAME = JobManager.exec_or_raise("hostname").chomp()
41
41
 
42
42
  # override the interactive shell calculation, and set to false
43
43
  INTERACTIVE_SHELL_OVERRIDE = false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jobmanager
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DesigningPatterns
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-06 00:00:00 -04:00
12
+ date: 2008-08-27 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -62,16 +62,6 @@ dependencies:
62
62
  - !ruby/object:Gem::Version
63
63
  version: "0"
64
64
  version:
65
- - !ruby/object:Gem::Dependency
66
- name: sys-host
67
- type: :runtime
68
- version_requirement:
69
- version_requirements: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- version: "0"
74
- version:
75
65
  - !ruby/object:Gem::Dependency
76
66
  name: hoe
77
67
  type: :development
@@ -138,7 +128,7 @@ files:
138
128
  - test/configs/minimum_plus_email_settings.yaml
139
129
  - test/configs/minimum_required.yaml
140
130
  has_rdoc: true
141
- homepage: "Project Page: http://rubyforge.org/projects/jobmanager/"
131
+ homepage: This package makes managing cron jobs on unix systems a breeze! It is
142
132
  post_install_message:
143
133
  rdoc_options:
144
134
  - --main