Crystal Stdio
A small Crystal library for capturing standard I/O streams.
Installation
Add this to your application's shard.yml
:
dependencies:
stdio:
github: mosop/stdio
Usage
require "stdio"
out, err, in = Stdio.capture do |io|
STDOUT.puts ":)"
STDERR.puts ":("
io.in.puts ":P"
[io.out.gets, io.err.gets, STDIN.gets]
end
puts out # prints ":)"
puts err # prints ":("
puts in # prints ":P"
Release Notes
- v0.1.2
- STDIN
Contributing
- Fork it ( https://github.com/mosop/stdio/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- mosop - creator, maintainer