Module: Jiminy::Recording::ProsopiteExt::SendNotificationsWithTmpFile

Included in:
RSpec
Defined in:
lib/jiminy/recording/prosopite_ext/send_notifications_with_tmp_file.rb

Instance Method Summary collapse

Instance Method Details

#prepare_results_file!Object



9
10
11
# File 'lib/jiminy/recording/prosopite_ext/send_notifications_with_tmp_file.rb', line 9

def prepare_results_file!
  TmpFileRecorder.prepare_results_file!
end

#send_notificationsObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/jiminy/recording/prosopite_ext/send_notifications_with_tmp_file.rb', line 21

def send_notifications
  super

  return unless Prosopite.tmp_file

  # https://github.com/charkost/prosopite/blob/main/lib/prosopite.rb#L157
  tc[:prosopite_notifications].each do |queries, backtrace|
    absolute_location = backtrace.detect { |path| path.exclude?(Bundler.bundle_path.to_s) }
    next unless absolute_location

    relative_location = absolute_location.gsub("#{Rails.root.realpath}/", "")
    tmp_file_recorder.record(location: relative_location, queries: queries)
  end
end

#tmp_fileObject



17
18
19
# File 'lib/jiminy/recording/prosopite_ext/send_notifications_with_tmp_file.rb', line 17

def tmp_file
  !!@tmp_file
end

#tmp_file=(value) ⇒ Object



13
14
15
# File 'lib/jiminy/recording/prosopite_ext/send_notifications_with_tmp_file.rb', line 13

def tmp_file=(value)
  @tmp_file = value
end