1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2025-06-16 07:07:37 +02:00
cheatsheets/ruby.md
Rico Sta. Cruz 511de900ba
Formatting updates (#2133)
- Update some sheets which have very long sections
- Remove `layout: 2017/sheet` (everything has the same layout now)
- Remove outdated sheets
2024-04-03 18:30:24 +11:00

30 lines
1.7 KiB
Markdown

---
title: Ruby
category: Ruby
tags: [WIP]
intro: |
Quick reference to some features of the Ruby programming language.
---
### Reference
{:.-one-column}
| Code | Description |
| ----------------------- | --------------------------------------------------------- |
| `$!` | latest error message |
| `$@` | location of error |
| `$_` | string last read by gets |
| `$.` | line number last read by interpreter |
| `$&` | string last matched by regexp |
| `$~` | the last regexp match, as an array of subexpressions |
| `$n` | the nth subexpression in the last match (same as `$~[n]`) |
| `$=` | case-insensitivity flag |
| `$/` | input record separator |
| `$\` | output record separator |
| `$0` | the name of the ruby script file |
| `$*` (or `ARGV`) | the command line arguments |
| `$$` | interpreter's process ID |
| `$?` | exit status of last executed child process |
| `$-i` `$-l` `$-p` `$-v` | Command line switches |
| `$-v` (or `$VERBOSE`) | verbose mode |