module RSpec::Core::Metadata

def self.relative_path(line)

Experimental RBS support (using type sampling data from the type_fusion project).

def self.relative_path: (String line) -> String

This signature was generated using 3 samples from 1 application.

Returns:
  • (String) - relative path to line

Parameters:
  • line (String) -- current code line

Other tags:
    Api: - private
def self.relative_path(line)
  line = line.sub(relative_path_regex, "\\1.\\2".freeze)
  line = line.sub(/\A([^:]+:\d+)$/, '\\1'.freeze)
  return nil if line == '-e:1'.freeze
  line
rescue SecurityError
  # :nocov:
  nil
  # :nocov:
end