Articles Index
Setting up a Rails Development Environment
Before you can dive into Rails development, you need a few things. Things like a competent editor, a web browser with a dom inspector, and the git version control utility. Get these things out of the way before you go full steam ahead.
What is Ruby on Rails?
Ruby on Rails is most likely the only reason most people have heard of Ruby. It is Ruby's "killer app," but what is it? Most know it's something to do with web sites or web applications, but what exactly is it?
Worked Example: Tabular Data
Much is made of the two base data structures in Ruby: the Array and the Hash. However, it's also quite easy to use two dimensional arrays in Ruby.
Worked Example: Number Guessing Game
A number guessing game is written, and each of its features explored.
Weak References
In order to observe an object in Ruby, you normally need to keep a reference to that object. Since keeping a reference to the object keeps it in memory, it cannot be deallocated. Using weak references solves this.
What is Ruby?
New to Ruby? Or even to programming? Find out what Ruby really is (and isn't) and why you should (and shouldn't) use it.
Getting Information About a File in Ruby Using File::Stat
Sometimes blindly opening files just won't cut it, sometimes you need to know more information about a file before opening it.
References to Methods in Ruby
While it may not make sense to do so at first, it is possible to take a reference to a method in Ruby.
Generating Random Numbers in Ruby
It's often useful in games, simulation and unit testing to generate random numbers, Ruby provides easy access to a pseudo-random number generator.
Cryptographic Hashes in Ruby
Generating cryptographic hashes in Ruby is quite easy. Ruby provides both a built in method and gives access to OpenSSL's hashing algorithms in most installations.
Password Security Primer
Anyone writing a web application or any web site requiring authentication needs to understand certain things about password security. If you fail to understand these things and plan for them, it's your users that will suffer should your site be compromised.
Base64 in Ruby
Base64 is a way to represent any data as ASCII data. Ruby provides a few handy functions to encode and decode Base64.
Installing RVM on Linux
Installing the Ruby Version Manager (RVM) on Linux
Calculating Abbreviations
Abbreviations are used commonly in command-line programs, REPLs and with autocomplete features. Ruby provides a way to generate them automatically as part of its standard library.
Garbage Collection
Garbage collection is the process of freeing unused objects. It's a hallmark of many high level languages, including Ruby.
Deploying Applications with Bundler
Bundler works hard to make things easy. One of the things it does is allow you to "vendor" all your gems so a single application directory can be copied to multiple computers and deployed very quickly.
Getting Started with Bundler
The basics of using Bundler are very trivial, you can be up and running in just a few minutes.
What is Bundler?
Bundler is a gem dependency manager for Ruby.
Iterating Over Strings
It's not a very common thing in Ruby. You have more sophisticated string tools (such as split or scan), but there are times when you'd want to iterate over the characters in a string. Unicode complicates this matter, but Ruby makes it simple.
Method Visibility
Method visibility is crucial to implement proper encapsulation. Ruby provides ways to not only hide instance variables, but to hide instance methods as well.
Overloading Operators
What does a + b mean? That all depends on what 'a' is. Ruby allows you to define a number of arithmetic operators and they're called on the left-hand side of any such expression.
Partitioning Strings
When processing strings in Ruby, you probably reach for the 'split' method most often. However, there are other options.
The Curious Case of the Flip-Flop
The flip-flop operator is a strange case indeed: part range, part conditional.
Ranges
Most programming languages don't have any way to represent a range of objects. Ruby has Ranges out of the box, and they work in a number of intuitive ways.
Using the Enumerable Module
By using the Enumerable module, you can make any of your classes act like Ruby standard collections. All you need to do is implement the 'each' method.
