I'm trying to use Ruby's grep function in a way similar to how I would use the grep command in Linux.
For instance, normally I would use the following shell command to find a line in a file based on a key word, then print the following three lines.
How would I emulate this command in ruby? The Ruby API hasn't been very helpful in discussing the grep command.Code:cat filename | grep -A3 keyword
If not grep in Ruby, perhaps rak can do this?