Plugins - OutputCatcher

StarAdd to favorites

OutputCatcher

by Matthias Hennemeyer <mhennemeyer@gmail.com>

Introduction

OutputCatcher is available as a Rails plugin. It provides a way to capture the standard out($stdout) or standard error($stderr) of your code without pain and suppresses the output of the ‘err’ or ‘out’ stream.

Usage

  OutputCatcher knows only two methods: .catch_err and .catch_out

  To capture the stderr of your code:

  err = OutputCatcher.catch_err do
    $stderr << "error error"
  end
  err #=> "error error"

  To capture the stdout of your code:

  out = OutputCatcher.catch_out do
    puts "Hello Hello"
  end
  out #=> "Hello Hello"

INSTALL:

  $ ruby script/plugin install git://github.com/mhennemeyer/output_catcher.git

Copyright © 2008 Matthias Hennemeyer, released under the MIT license

Matthias Hennemeyer

http://workunitgroup.com/2008/5/26/output-catcher-for-ruby-and-rails

git://github.com/mhennemeyer/output_catcher.git

Rails' (MIT)

  • Currently 0.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Testing

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?