Module: ElasticGraph::SchemaDefinition::JRubyPatches::BacktraceLocationAbsolutePathPatch

Defined in:
lib/elastic_graph/schema_definition/jruby_patches.rb

Overview

Bug: ‘Thread::Backtrace::Location#absolute_path` returns a relative path (same as `#path`) when the source file was loaded via `load` with a bare relative path (e.g. `load “schema.rb”`). On MRI, `absolute_path` correctly resolves to the full absolute path in this case. Workaround: override `absolute_path` to expand relative paths. Reported upstream: github.com/jruby/jruby/issues/9245 TODO: remove once JRuby fixes this upstream.

Instance Method Summary collapse

Instance Method Details

#absolute_pathObject



24
25
26
27
28
# File 'lib/elastic_graph/schema_definition/jruby_patches.rb', line 24

def absolute_path
  result = super
  return result if result.nil? || result.start_with?("/")
  ::File.expand_path(result)
end