class Piggly::ReportTask

Attributes

accumulate[RW]
report_root[RW]
trace_file[RW]

Public Class Methods

new(name = :report) click to toggle source
Calls superclass method Piggly::AbstractTask::new
# File lib/piggly/task.rb, line 123
def initialize(name = :report)
  @accumulate  = false
  @trace_file  = nil
  @report_root = nil
  super(name)
end

Private Instance Methods

define() click to toggle source
# File lib/piggly/task.rb, line 132
def define
  desc 'Generate piggly report'
  task @name do
    RakeFileUtils.verbose(@verbose) do
    # opts  = @ruby_opts.clone
    # opts << (@piggly_path ? quote(@piggly_path) : "-S piggly")
      opts  = []
      opts << "report"
      opts << "--accumulate" if @accumulate
      opts.concat(["--trace-file",  @trace_file])
      opts.concat(["--cache-root",  @cache_root]) if @cache_root
      opts.concat(["--report-root", @report_root]) if @report_root

      case @procedures
      when String then opts.concat(["--name", @procedures])
      when Regexp then opts.concat(["--name", @procedures.inspect])
      when Array
        @procedures.each do |p|
          case p
          when String then opts.concat(["--name", p])
          when Regexp then opts.concat(["--name", p.inspect])
          end
        end
      end

      opts.concat(@piggly_opts)
    # ruby(opts.join(" "))
      Command.main(opts)
    end
  end
end