def frame_details(line)
if (match = line.match(/^(.+):(\d+):(.+)$/))
filename = match[1]
lineno = match[2]
location = match[3]
if filename.index(Merb.framework_root) == 0
type = "framework"
shortname = Pathname.new(filename).relative_path_from(Pathname.new(Merb.framework_root))
elsif filename.index(Merb.root) == 0
type = "app"
shortname = Pathname.new(filename).relative_path_from(Pathname.new(Merb.root))
elsif Module.const_defined?(:Gem) && Gem.respond_to?(:path) && path = Gem.path.find {|p| filename.index(p) == 0}
type = "gem"
shortname = Pathname.new(filename).relative_path_from(Pathname.new(path))
else
type = "other"
shortname = filename
end
[type, shortname, filename, lineno, location]
else
['', '', '', nil, nil]
end
end