class TaskJuggler::Tj3SheetAppBase

Public Class Methods

new() click to toggle source
Calls superclass method TaskJuggler::Tj3AppBase::new
# File lib/taskjuggler/Tj3SheetAppBase.rb, line 20
def initialize
  super

  @dryRun = false
  @workingDir = nil
end

Public Instance Methods

optsEndDate() click to toggle source
# File lib/taskjuggler/Tj3SheetAppBase.rb, line 42
def optsEndDate
  @opts.on('-e', '--enddate <DAY>', String,
           format("The end date of the reporting period. Either as " +
                  "YYYY-MM-DD or day of week. 0: Sunday, 1: Monday and " +
                  "so on. The default value is #{@date}.")) do |arg|
    ymdFilter = /([0-9]{4})-([0-9]{2})-([0-9]{2})/
    if ymdFilter.match(arg)
      @date = Time.mktime(*(ymdFilter.match(arg)[1..3]))
    else
      @date = TjTime.new.nextDayOfWeek(arg.to_i % 7)
    end
    @date = @date.strftime('%Y-%m-%d')
  end
end
processArguments(argv) { || ... } click to toggle source
# File lib/taskjuggler/Tj3SheetAppBase.rb, line 27
def processArguments(argv)
  super do
    @opts.on('-d', '--directory <DIR>', String,
             format('Use the specified directory as working ' +
                    'directory')) do |arg|
      @workingDir = arg
    end
    @opts.on('--dryrun',
             format("Don't send out any emails or do SCM commits")) do
      @dryRun = true
    end
    yield
  end
end