Ruby one-liners cookbook
The book heavily leans on examples and exercises to help you get comfortable with using Ruby from the command line. It is recommended that you manually type each example and experiment with them.
Prerequisites
You should be comfortable with programming basics and have prior experience working with Ruby. You should know concepts like blocks, be familiar with string/array/hash/enumerable methods, regular expressions etc. You should also have prior experience working with command line and bash shell and be familiar with concepts like file redirection, command pipeline and so on.
Testimonials
This Ruby one-liners cookbook is incredible. Pretty mind boggling all the stuff you can do.
Sample chapters
For a preview of the book, see sample chapters at https://github.com/learnbyexample/learn_ruby_oneliners/blob/master/sample_chapters/ruby_oneliners_sample.pdf
GitHub repo
Visit https://github.com/learnbyexample/learn_ruby_oneliners for code snippets and exercise files. The repo also has solutions for exercises.
You'll get PDF and EPUB versions of the book.