Module: BuildNotifiers::ProgressNotifier

Defined in:
lib/build_notifiers/progress_notifier.rb

Defined Under Namespace

Modules: TrackPhase

Class Method Summary collapse

Class Method Details

.call(_, filter) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/build_notifiers/progress_notifier.rb', line 23

def self.call(_,filter)
  if TrackPhase.last_phase?(filter)
    notify(TrackPhase.lookup_phase(filter))
  end
  if filter.class == Rake::Pipeline::PipelineFinalizingFilter
    ProgressNotifier.finalizing = true
  end
end

.finalizing=(value) ⇒ Object



19
20
21
# File 'lib/build_notifiers/progress_notifier.rb', line 19

def self.finalizing=(value)
  @finalizing = true
end

.finalizing?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/build_notifiers/progress_notifier.rb', line 15

def self.finalizing?
  @finalizing
end

.notify(phase) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/build_notifiers/progress_notifier.rb', line 32

def self.notify(phase)
  if Benoit.config.output_mode == :app
    $stdout.puts({ type: "progress", name: phase}.to_json)
  else
    puts "Phase complete: #{phase}"
  end
  $stdout.flush
end