warnings

Description

Warnings provides a searchable and more readable Warning Message facility for Ruby. With Warnings, one can save all warning messages generated by your code, search through them and print them upon exit.

Features

  • Respects $VERBOSE (ruby -w) and $DEBUG (ruby -d)
  • Search Warning Messages by:
    • Message
    • Source File
    • Source Method
  • Prints unique Warning messages upon exit.
  • ANSI Coloring.

Examples

require 'warnings'

def danger!
  warn "Fire in the disco!"
end

danger!
danger!

Warnings.grep(/fire/)
# => [...]

Warnings.from('foo/bar.rb')
# => [...]

Warnings.from_method('danger!')
# => [...]

exit
#
# Warnings:
#
#   fire in the disco!
#      lib/foo/bar.rb:42

Install

$ gem install warnings

Copyright (c) 2011 Hal Brodigan

See LICENSE for details.