Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 1.25 KB

README.md

File metadata and controls

70 lines (48 loc) · 1.25 KB

Backtrace_Array

A Ruby gem to alter structure of a backtrace:

Original Backtrace:

[ String, String, String ]

New Array:

[
   [ unique file 1, [ [line, code], [line, code], ... ] ]
   [ unique file 2, [ [line, code], [line, code], ... ] ]
   [ unique file 3, [ [line, code], [line, code], ... ] ]
  
]

This lets you present it in your views as:

  unique file 1
  line: code
  line: code
  line: code

unique file 2 line: code line: code line: code

Installation

gem install Backtrace_Array

Usage

require "Backtrace_Array"

# Pass it an Array
Backtrace_Array my_exception.backtrace

# ... or a String
Backtrace_Array %~
  file1:1: in `new'
  file2:2: in `<main>'
  file3:3: in `eval'
~

Run Tests

git clone git@github.com:da99/Backtrace_Array.git
cd Backtrace_Array
bundle update
bundle exec bacon spec/lib/main.rb

"I hate writing."

If you know of existing software that makes the above redundant, please tell me. The last thing I want to do is maintain code.