1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-05 16: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

@@ -62,6 +62,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
- [Are They All True?](ruby/are-they-all-true.md)
- [Create an Array of Stringed Numbers](ruby/create-an-array-of-stringed-numbers.md)
- [Destructuring Arrays In Blocks](ruby/destructuring-arrays-in-blocks.md)
- [Evaluating One-Off Commands](ruby/evaluating-one-off-commands.md)
- [Finding The Source of Ruby Methods](ruby/finding-the-source-of-ruby-methods.md)
- [Limit Split](ruby/limit-split.md)
- [Parallel Bundle Install](ruby/parallel-bundle-install.md)

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]
```