1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-11 19:18:01 +00:00

Add Evaluating One-Off Commands as a ruby til.

This commit is contained in:
jbranchaud
2015-05-12 08:49:11 -05:00
parent eed68fdbaf
commit 34f39e2217
2 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
# 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]
```