require 'ro_helpers' Out.say_status("set", " $root and $lib #{::File.basename __FILE__}, #{__LINE__}") require 'active_support/core_ext' module LinkableErrorsHandler class << self def link_to_code(text) text.scan(regexp).each do |part| path = part[0] line = part[1] text.gsub! "#{path}:#{line}", handle_part(path, line) end text end def regexp @regexp ||= %r{((?/.*?\.rb)\:(?\d+)\:in)} end def handle_part(path, line) href = File.join("/rodebug/start", path, line) anchor_text = "#{path}:#{line}" result = "#{anchor_text}" end def handle_path(path) path.gsub(%r{/}, "$").gsub(%r{^$}, "") end end end