raggi / exception_string

A clean ruby exception formatter that resembles the interpreters native output

This URL has Read+Write access

name age message
file .gitignore Fri Jan 16 07:49:00 -0800 2009 Move to new template layout [raggi]
file History.txt Mon Dec 29 14:54:29 -0800 2008 Initial commit, and probably first release [raggi]
file Manifest.txt Fri Jan 16 07:49:38 -0800 2009 new manifest [raggi]
file README.rdoc Fri Jan 16 07:49:20 -0800 2009 Fix doc header [raggi]
file Rakefile Mon Dec 29 17:59:04 -0800 2008 Bump version, change project name [raggi]
file exception_string.gemspec Fri Jan 16 07:50:29 -0800 2009 Bump version [raggi]
directory lib/ Fri Jan 16 07:50:29 -0800 2009 Bump version [raggi]
directory spec/ Mon Dec 29 14:54:29 -0800 2008 Initial commit, and probably first release [raggi]
directory tasks/ Fri Jan 16 07:49:00 -0800 2009 Move to new template layout [raggi]
README.rdoc

exception_string

    by James Tucker
    http://ra66i.org
    http://github.com/raggi/exception_string

DESCRIPTION:

Provides clean exception formatting as a string, which resembles native output formats for back-traces that kill the interpreter. Whilst there are shorter, simpler ways to format ruby exceptions, this format is almost as short, but provides the format that young ruby programmers will be familiar with, and can be used to keep logs and output data consistent with other areas of the platform.

At present the only provided format is that which is generated by MRI 1.8.x.

FEATURES/PROBLEMS:

  • Supports MRI (ruby 1.8.x) style exception formats
  • Kinda a big package, for 3 LoC.
  • Should probably be part of the platform.

SYNOPSIS:

Something like:

  ...

  begin
    raise "boom"
  rescue => e
    puts e.to_s_mri
  end

  ...

Outputs something like:

  boomtest.rb:18:in `go': boom (RuntimeError)
    from boomtest.rb:34:in `foo'
    from boomtest.rb:36

REQUIREMENTS:

  • Ruby!
  • bacon for the spec suite

INSTALL:

  • gem install exception_string

TODO:

  • Add other interpreter exception formats, if there are any variances.

LICENSE:

(The MIT License)

Copyright © 2008 James Tucker

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.