mirror of
https://github.com/jbranchaud/til
synced 2026-01-12 19:48:01 +00:00
12 lines
361 B
Markdown
12 lines
361 B
Markdown
# Evaluating One-Off Commands
|
|
|
|
When I need to quickly test something out in Ruby, I will often reach for
|
|
`irb`. There is an even quicker way to send a line of code to ruby for
|
|
evaluation. Use the `ruby` binary with the `-e` flag followed by your line
|
|
of ruby. For instance,
|
|
|
|
```
|
|
$ ruby -e 'puts Class.ancestors'
|
|
[Class, Module, Object, Kernel, BasicObject]
|
|
```
|