Ruby2
Ruby is an object-oriented interpreted language. Several interpreters exist, the main one being written in C. It natively supports threads, fibers and has an impressive amount of third-party libraries that enable it to cover a broad spectrum of requirements, from basic file processing to complex distributed computing servers.
Contents
Basics
Development environment
Your first program
Code
Analysis
Variables & Data Types
Scalars
Non-scalars
A bit of magic: Blocks & Lambdas
Object-oriented programming
Classes
Defining a class
Inheritance
Scope
Objects
Operations and control structures
Assignation, mathematical operations
String & Array manipulation
Boolean operations
AND & OR
NOT
Control structures
if, unless
while, until
loop control
1 Basics 1.1 Development Environment 1.1.1 Linux & Unix 1.1.2 Windows 1.1.3 CPAN 1.2 Your first program 1.2.1 Code 1.2.2 Analysis 1.3 Variables & Data Types 1.3.1 Scalars 1.3.2 Arrays 1.3.2.1 Helper Functions 1.3.2.1.1 join() 1.3.2.1.2 split() 1.3.2.1.3 push() 1.3.2.1.4 pop() 1.3.2.1.5 unshift() 1.3.2.1.6 shift() 1.3.3 Hashes 1.3.3.1 Introduction 1.3.3.2 Helper Functions 1.3.3.2.1 each() 1.3.3.2.2 keys 1.3.4 References 1.3.4.1 Hash References 1.3.4.2 Callback References 1.3.5 Casting 1.4 Boolean Logic 1.4.1 Operators 1.4.1.1 Mathematical 1.4.1.2 Regular Expressions 1.4.2 Statements 1.4.2.1 if 1.4.2.2 unless 1.4.2.3 AND and OR 1.4.2.4 switch 1.4.2.5 Golfing 1.4.3 Helper Natives 1.4.3.1 exists 1.4.3.2 defined 1.4.3.3 undef 1.4.4 Bitwise Manipulations 1.4.4.1 AND 1.4.4.2 NOT 1.4.4.3 OR 1.4.4.4 XOR 1.4.4.5 Bit Shifting 1.4.4.6 Bit Rotation 1.5 Loops 1.5.1 While 1.5.2 Until 1.5.3 For 1.5.4 Foreach 1.6 User Input 1.6.1 Command Line Arguments 1.6.1.1 Getopt::Std 1.6.1.1.1 Code 1.6.1.1.2 Analysis 1.6.1.2 Getopt::Long 1.6.1.2.1 Code 1.6.1.2.2 Analysis 1.6.2 STDIN (Standard Input) 1.7 User-Defined Functions 2 Helpful Libraries 2.1 Throughput 2.1.1 Download 2.1.2 Usage 2.1.2.1 Config.pm 2.1.2.2 Log.pm 2.1.2.3 Server.pm