Advanced Ruby
These pages deal with some of the more advanced concepts of Ruby and are geared toward intermediate and advanced programmers. The covered concepts will build upon the more basic features of Ruby, a discussion of which can be found in Beginning Ruby.
Making Deep Copies in Ruby
It's often necessary to make a copy of a value in Ruby. While this may seem simple, and it is for simple objects, as soon as you have to make a copy of a data structure with multiple array or hashes on the same object, you will quickly find there are many pitfalls.
It's often necessary to make a copy of a value in Ruby. While this may seem simple, and it is for simple objects, as soon as you have to make a copy of a data structure with multiple array or hashes on the same object, you will quickly find there are many pitfalls.
Installing Gems from Git
How to install gems from git repositories.
How to install gems from git repositories.
Optional Method Parameters with Hashes
Using hashes to simulate optional named parameters in methods.
Using hashes to simulate optional named parameters in methods.
Long Form and Short Form Command-line Options
There are two forms of command-line options: long form and short form. Both long and short form options take arguments, each a little differently.
There are two forms of command-line options: long form and short form. Both long and short form options take arguments, each a little differently.
OptionParser--Parsing Command-line Options the Ruby Way
Ruby comes equipped with a powerful and flexible tool to parse command-line options, OptionParser. The class is an alternative to GetoptLong for analyzing command line options.
Ruby comes equipped with a powerful and flexible tool to parse command-line options, OptionParser. The class is an alternative to GetoptLong for analyzing command line options.
Using OptionParser to Parse Commands in Ruby
Using OptionParser to parse command line options is a preferable alternative to GetoptLong or looking through ARGV manually. But how do you use it?
Using OptionParser to parse command line options is a preferable alternative to GetoptLong or looking through ARGV manually. But how do you use it?
Ruby Best Practices--Making Quick Exceptions
Knowing how to make quick exceptions to catch and tell the difference between several conditions is a Ruby best practice you can't afford not to know.
Knowing how to make quick exceptions to catch and tell the difference between several conditions is a Ruby best practice you can't afford not to know.
Ruby's Bignum Library
Computers are quite good at math or, more precisely, at arithmetic. In fact, technically, that's all a computer can do. However, the numbers computers typically work with are quite limited. On a typical computer, an integer number is represented by a 32-bit binary number. A 32-bit integer can only represent the numbers from about negative 2 billion to positive 2 billion.
Computers are quite good at math or, more precisely, at arithmetic. In fact, technically, that's all a computer can do. However, the numbers computers typically work with are quite limited. On a typical computer, an integer number is represented by a 32-bit binary number. A 32-bit integer can only represent the numbers from about negative 2 billion to positive 2 billion.
String Substitution in Ruby
Splitting a string is only one way to manipulate string data. You can also make substitutions to replace one part of a string with another string. For instance, in an example string "foo,bar,baz", replacing "foo" with "boo" in "foo,bar,baz" would yield "boo,bar,baz". You can do this and many more things using the sub and gsub method in the String class.
Splitting a string is only one way to manipulate string data. You can also make substitutions to replace one part of a string with another string. For instance, in an example string "foo,bar,baz", replacing "foo" with "boo" in "foo,bar,baz" would yield "boo,bar,baz". You can do this and many more things using the sub and gsub method in the String class.
Using the 'split' Method
String manipulation using the split method in Ruby. Split strings into a list of substrings.
String manipulation using the split method in Ruby. Split strings into a list of substrings.
Debugging Ruby
Debugging Ruby programs using the Ruby debugger.
Debugging Ruby programs using the Ruby debugger.
Running the Ruby Profiler
Running the Ruby profiler to determine which methods are most expensive and which need to be optimized.
Running the Ruby profiler to determine which methods are most expensive and which need to be optimized.
An Introduction to Distributed Ruby
Distributed Ruby, or DRb, is a library that allows you to communicate with remote Ruby objects and programs, using TCP/IP network protocols.
Distributed Ruby, or DRb, is a library that allows you to communicate with remote Ruby objects and programs, using TCP/IP network protocols.
Writing Domain Specific Languages
A short guide on writing Domain Specific Languages in Ruby.
A short guide on writing Domain Specific Languages in Ruby.
RubyQuiz
Challenges to test your Ruby programming skills.
Challenges to test your Ruby programming skills.
Ruby @ PLEAC
Ruby recipes at PLEAC (Programming Language Examples Alike Cookbook), the example programs from the Perl Cookbook re-written in Ruby.
Ruby recipes at PLEAC (Programming Language Examples Alike Cookbook), the example programs from the Perl Cookbook re-written in Ruby.
21 Ruby Tricks
A few tips and tricks to make things a little easier.
A few tips and tricks to make things a little easier.
Ruby Core
Information on installing, running and contributing to the development of the latest release of Ruby.
Information on installing, running and contributing to the development of the latest release of Ruby.
