Class: PmdTester::SimpleProgressLogger

Inherits:
Object
  • Object
show all
Includes:
PmdTester
Defined in:
lib/pmdtester/builders/simple_progress_logger.rb

Overview

Helper class that provides a simple progress logging

Constant Summary

Constants included from PmdTester

BASE, PATCH, PR_NUM_ENV_VAR, VERSION

Instance Method Summary collapse

Methods included from PmdTester

#logger, logger

Constructor Details

#initialize(task_name) ⇒ SimpleProgressLogger

Returns a new instance of SimpleProgressLogger.



9
10
11
# File 'lib/pmdtester/builders/simple_progress_logger.rb', line 9

def initialize(task_name)
  @task_name = task_name
end

Instance Method Details

#startObject



13
14
15
16
17
18
19
20
21
# File 'lib/pmdtester/builders/simple_progress_logger.rb', line 13

def start
  logger.info "Starting #{@task_name}"
  message_counter = 1
  @scheduler = Rufus::Scheduler.new
  @scheduler.every '2m' do
    logger.info "Still #{@task_name} (#{message_counter})..."
    message_counter += 1
  end
end

#stopObject



23
24
25
# File 'lib/pmdtester/builders/simple_progress_logger.rb', line 23

def stop
  @scheduler.shutdown
end