-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathREADME
More file actions
41 lines (24 loc) · 886 Bytes
/
README
File metadata and controls
41 lines (24 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
= OutputCatcher
by Matthias Hennemeyer <mhennemeyer@gmail.com>
== Introduction
OutputCatcher is available as a Rails plugin and as a gem.
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:
Rails:
$ ruby script/plugin install git://github.com/mhennemeyer/output_catcher.git
Gem:
$ gem install mhennemeyer-output_catcher
Copyright (c) 2008 Matthias Hennemeyer, released under the MIT license