Module: Kernel

Defined in:
lib/jax/core_ext/kernel.rb

Instance Method Summary collapse

Instance Method Details

#detect_callerObject



2
3
4
5
6
# File 'lib/jax/core_ext/kernel.rb', line 2

def detect_caller
  # Remove the line number from backtraces making sure we don't leave anything behind
  call_stack = caller.map { |p| p.sub(/:\d+.*/, '') }
  File.dirname(call_stack.detect { |p| p !~ %r[jax[\w.-]*/lib/jax] })
end