franzejr / best-ruby

Ruby Tricks, Idiomatic Ruby, Refactoring and Best Practices
http://franzejr.github.io/best-ruby/
2.39k stars 218 forks source link

Add expected outputs when running files. #1

Closed rafaelsales closed 9 years ago

rafaelsales commented 9 years ago

I used following command to help me with this task so I didn't have to run each file manually and append the append to the source:

find . -iname '*.rb' -exec sh -c 'echo "\n# Result:" >> {}; gtimeout 2 ruby {} 2>&1 | sed "s/^/# /" >> {}' \;