Module: HeapScope::Reproduction

Defined in:
lib/heapscope/paths.rb

Class Method Summary collapse

Class Method Details

.attach!(report, metadata = {}) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/heapscope/paths.rb', line 32

def attach!(report,  = {})
  report.instance_variable_set(
    :@reproduction,
    {
      command: command(),
      metadata: ,
      captured_at: Time.now.utc.iso8601
    }
  )
  report
end

.command(metadata = {}) ⇒ Object



26
27
28
29
30
# File 'lib/heapscope/paths.rb', line 26

def command( = {})
  mode = [:mode] || HeapScope.config.mode
  script = [:script] || "examples/import_leak.rb"
  "HEAPSCOPE_MODE=#{mode} bundle exec ruby #{script}"
end