module RSpec::Core::Metadata

def self.backtrace_from(block)

Other tags:
    Private: -
def self.backtrace_from(block)
  return caller unless block.respond_to?(:source_location)
  [block.source_location.join(':')]
end

def self.build_hash_from(args)

Other tags:
    Private: -
def self.build_hash_from(args)
  hash = args.last.is_a?(Hash) ? args.pop : {}
  while args.last.is_a?(Symbol)
    hash[args.pop] = true
  end
  hash
end

def self.relative_path(line)

Returns:
  • (String) - relative path to line

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

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