Class: TaskJuggler::TimeSheetReceiver

Inherits:
SheetReceiver show all
Defined in:
lib/taskjuggler/TimeSheetReceiver.rb

Overview

This class specializes SheetReceiver to process time sheets.

Instance Attribute Summary

Attributes inherited from SheetHandlerBase

#dryRun, #workingDir

Instance Method Summary collapse

Methods inherited from SheetReceiver

#processEmail

Methods included from StdIoWrapper

#stdIoWrapper

Methods inherited from SheetHandlerBase

#addToScm, #cutOut, #error, #htmlMailBody, #info, #log, #sendEmail, #sendRichTextEmail, #setWorkingDir, #warning

Constructor Details

#initialize(appName) ⇒ TimeSheetReceiver

Returns a new instance of TimeSheetReceiver.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/taskjuggler/TimeSheetReceiver.rb', line 21

def initialize(appName)
  super(appName, 'time')

  @tj3clientOption = 'check-ts'

  # File name and directory settings.
  @sheetDir = 'TimeSheets'
  @templateDir = 'TimeSheetTemplates'
  @failedMailsDir = "#{@sheetDir}/FailedMails"
  @failedSheetsDir = "#{@sheetDir}/FailedSheets"
  @signatureFile = "#{@templateDir}/acceptable_intervals"
  @logFile = 'timesheets.log'

  # Regular expression to identify time sheets.
  @sheetHeader = /^[ ]*timesheet\s([a-z][a-z0-9_]*)\s[0-9\-:+]*\s-\s([0-9]*-[0-9]*-[0-9]*)/
  # Regular expression to extract the sheet signature (time period).
  @signatureFilter = /^[ ]*timesheet\s[a-z][a-z0-9_]*\s([0-9:\-+]*\s-\s[0-9:\-+]*)/
  @emailSubject = "Report from %s for %s"
end