In Files

Files

Class Index [+]

Quicksearch

TaskJuggler::Tj3Daemon

Public Class Methods

new() click to toggle source
    # File lib/tj3d.rb, line 25
25:     def initialize
26:       super
27:       @mandatoryArgs = '[<tjp file> [<tji file> ...] ...]'
28: 
29:       @log = LogFile.instance
30:       @log.logFile = Dir.getwd + "/#{AppConfig.appName}.log"
31:       @log.appName = AppConfig.appName
32:       @daemonize = true
33:       @port = nil
34:     end

Public Instance Methods

error(message) click to toggle source
     # File lib/tj3d.rb, line 100
100:     def error(message)
101:       $stderr.puts "ERROR: #{message}"
102:       exit 1
103:     end
main() click to toggle source
    # File lib/tj3d.rb, line 55
55:     def main
56:       files = super
57:       broker = ProjectBroker.new
58:       @rc.configure(self, 'global')
59:       @rc.configure(@log, 'global.log')
60:       @rc.configure(broker, 'global')
61:       @rc.configure(broker, 'daemon')
62:       broker.port = @port if @port
63: 
64:       projects = []
65:       project = nil
66:       files.each do |file|
67:         if file[4..1] == '.tjp'
68:           # The project master file determines the working directory. If it's
69:           # an absolute file name, that directory will become the working
70:           # directory. If it's a relative file name, the current working
71:           # directory will be kept.
72:           if file[0] == '/'
73:             # Absolute file name
74:             workingDir = File.dirname(file)
75:             fileName = File.basename(file)
76:           else
77:             # Relative file name
78:             workingDir = Dir.getwd
79:             fileName = file
80:           end
81:           project = [ workingDir, fileName ]
82:           projects << project
83:         elsif file[4..1] == '.tji'
84:           # .tji files are optional. But if they are specified, they must
85:           # always follow the master file in the list.
86:           if project.nil?
87:             error("You must specify a '.tjp' file before the '.tji' files")
88:           end
89:           project << file
90:         else
91:           error("Project files must have a '.tjp' or '.tji' extension")
92:         end
93:       end
94: 
95:       broker.daemonize = @daemonize
96: 
97:       broker.start(projects)
98:     end
processArguments(argv) click to toggle source
    # File lib/tj3d.rb, line 36
36:     def processArguments(argv)
37:       super do
38:         @opts.banner += The TaskJuggler daemon can be used to quickly generate reports for a numberof scheduled projects that are resident in memory. Once the daemon has beenstarted tj3client can be used to control it.
39:         @opts.on('-d', '--dont-daemonize',
40:                  format("Don't put program into daemon mode. Keep it " +
41:                         'connected to the terminal and show debug output.')) do
42:           @daemonize = false
43:         end
44:         @opts.on('-p', '--port <NUMBER>', Integer,
45:                  format('Use the specified TCP/IP port')) do |arg|
46:            @port = arg
47:         end
48:       end
49:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.