Class TaskJuggler::Tj3SheetAppBase
In: lib/taskjuggler/Tj3SheetAppBase.rb
Parent: Tj3AppBase

Methods

Public Class methods

[Source]

# File lib/taskjuggler/Tj3SheetAppBase.rb, line 20
    def initialize
      super

      @dryRun = false
      @workingDir = nil
    end

Public Instance methods

[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

[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

[Validate]