Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.1 KB

README.md

File metadata and controls

59 lines (40 loc) · 1.1 KB

warnings

Description

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

Features

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

Examples

require 'warnings'

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

danger!

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

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

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

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

Requirements

Install

$ gem install warnings

Copyright

Copyright (c) 2011 Hal Brodigan

See {file:LICENSE.txt} for details.