module Marginalia::Comment

def self.line

def self.line
  Marginalia::Comment.lines_to_ignore ||= DEFAULT_LINES_TO_IGNORE_REGEX
  last_line = caller.detect do |line|
    line !~ Marginalia::Comment.lines_to_ignore
  end
  if last_line
    root = if defined?(Rails) && Rails.respond_to?(:root)
      Rails.root.to_s
    elsif defined?(RAILS_ROOT)
      RAILS_ROOT
    else
      ""
    end
    if last_line.start_with? root
      last_line = last_line[root.length..-1]
    end
    last_line
  end
end