class TaskJuggler::SheetSender

A base class for sheet senders.

Attributes

force[RW]
intervalDuration[RW]

Public Class Methods

new(appName, type) click to toggle source
Calls superclass method TaskJuggler::SheetHandlerBase.new
# File lib/taskjuggler/SheetSender.rb, line 29
def initialize(appName, type)
  super(appName)

  @sheetType = type
  # The following settings must be provided by the deriving class.
  # This is a LogicalExpression string that controls what resources should
  # not be getting a report sheet template.
  @hideResource = nil
  # This file contains the signature (date or interval) that the
  # SheetReceiver will accept as a valid signature.
  @signatureFile = nil
  # The base directory of the sheet templates.
  @templateDir = nil
  # When true, existing templates will be regenerated and send out again.
  # Otherwise the existing template will not be send out again.
  @force = false

  @signatureFilter = nil
  # The subject of the template email.
  @mailSubject = nil
  # The into text of the template email.
  @introText = nil

  # The end date of the reported interval.
  @date = Time.new.strftime('%Y-%m-%d')
  # Determines the length of the reported interval.
  @intervalDuration = '1w'
  # We need this to determine if we already sent out a report.
  @timeStamp = Time.new
end

Public Instance Methods

sendTemplates(resourceList) click to toggle source

Send out report templates to a list of project resources. The resources are selected by the @hideResource filter expression and can be further limited with a list of resource IDs passed by resourceList.

# File lib/taskjuggler/SheetSender.rb, line 63
def sendTemplates(resourceList)
  setWorkingDir
  createDirectories

  resources = genResourceList(resourceList)
  genTemplates(resources)
  sendReportTemplates(resources)
end