lib/tj3client.rb in taskjuggler-0.0.5 vs lib/tj3client.rb in taskjuggler-0.0.6
- old
+ new
@@ -204,11 +204,11 @@
error('Authentication failed. Please check your authentication ' +
'key to match the server key.')
end
rescue
error("TaskJuggler server on host '#{@host}' port " +
- "#{@port} is not responding: #{$!}")
+ "#{@port} is not responding")
end
end
def disconnectDaemon
@broker = nil
@@ -220,10 +220,11 @@
case command
when 'status'
$stdout.puts callDaemon(:status, [])
when 'terminate'
callDaemon(:stop, [])
+ info('Daemon terminated')
when 'add'
# Ask the daemon to create a new ProjectServer process and return a
# DRbObject to access it.
connectToProjectServer
# Ask the server to load the files in _args_ into the ProjectServer.
@@ -238,10 +239,11 @@
args.each do |arg|
unless callDaemon(:removeProject, arg)
error("Project '#{arg}' not found in list")
end
end
+ info('Project removed')
when 'report'
# The first value of args is the project ID. The following values
# could be either report IDs or TJI file # names ('.' or '*.tji').
projectId = args.shift
# Ask the ProjectServer to launch a new ReportServer process and
@@ -257,11 +259,11 @@
failed = !addFiles(tjiFiles)
# Ask the ReportServer to generate the reports with the provided IDs.
unless failed
reportIds.each do |reportId|
unless @reportServer.generateReport(@rs_authKey, reportId,
- @regExpMode)
+ @regExpMode, nil)
failed = true
break
end
end
end
@@ -371,15 +373,10 @@
@reportServer.terminate(@rs_authKey)
rescue
error("Report server termination failed: #{$!}")
end
@reportServer = nil
- begin
- @projectServer.dropReportServer(@ps_authKey, @rs_uri)
- rescue
- error("Cannot drop report server: #{$!}")
- end
@rs_uri = nil
@rs_authKey = nil
@projectServer = nil
@ps_uri = nil
@ps_authKey = nil
@@ -427,9 +424,14 @@
rescue
error("Cannot add file #{file} to ReportServer")
end
end
true
+ end
+
+ def info(message)
+ return if @silent
+ $stdout.puts "#{message}"
end
def error(message)
$stderr.puts "ERROR: #{message}"
exit 1