1. Computing

Discuss in my forum

Michael Morin

Ruby

By , About.com Guide

Follow me on:

ARGF, a Shortcut for Scripts

Tuesday April 30, 2013

Many command line scripts simply read all the files mentioned to them as one long stream of data, the last file of one byte side by side with the first byte of the next file.  Ruby provides you with a very simple way to do this, by using the ARGF object combined with some simple option parsing.

TrueClass, FalseClass and NilClass Quick Reference

Tuesday April 30, 2013

What is truth?  No, not philosophically, in the (ironically imaginary) world of computer science, truth has a very well defined meaning.  But each high level language seems to interpret this a bit differently.  So what is truth in Ruby?  And how are they represented?

Exception Quick Reference

Tuesday April 30, 2013

Exceptions, like just about everything else in Ruby, are objects.  They're objects you typically don't deal with either, in fact when you catch an exception using a rescue clause, you're often only testing for the presence of the exception an ignoring the exception object itself.  But there is slightly more you can do with them.

Bignum Quick Reference

Monday April 29, 2013

While the Bignum is not a class you'll encounter directly, you've probably used it a few times without even noticing it.  This article tells you a bit about how Bignum works and what you can do with it.

IO Quick Reference

Sunday March 31, 2013

You use IO methods all the time:  gets and puts are prime examples.  However, there are a few more options available to you, should you need to use them.

String Quick Reference

Sunday March 31, 2013

The string class has over 100 methods.  It is by far one of the largest classes in Ruby, yet it's is arguably the most used class in many types of programs.  This can be outright intimidating if you're just starting out.  The following is an article that ignores most of the class, for the time being, and just shows you how to do some basic things with the String class.

Hash Quick Reference

Saturday March 30, 2013

While the Array class certainly has more methods, the Hash class is no lightweight.  And as you'll be using Hashes quite a lot, it's good to know how to do the basics before digging in and learning the multitude of hash methods at your disposal.  This article does just that, teaches you how to do the basic things with hashes.

Array Quick Reference

Saturday March 30, 2013

The official Ruby documentation can be intimidating if you're just starting out.  You just want to know how to do something simple to an Array and are greeted with a list of about 90 methods (plus those inherited from parent classes and brought in from the Enumerable module!).  This article cuts through all that complicated mess and just tells you how to do some basic things with Array objects.

Rails Blog Step 4: Cleaning up the Views

Tuesday February 19, 2013

The blog is now fully functional.  You can post blog posts, authentication is implemented and a theme is installed.  Now it's time to clean up those boring views generated by the scaffold generator and make this into something a bit more blog-like.  We'll also implement paging using the will_paginate gem and RedCloth formatting using the RedCloth gem.

Rails Blog Step 3: Authentication

Sunday February 17, 2013

So, you've scaffolded the posts model and installed an attractive WordPress theme, time to get down to it.  First thing we need to do is add some authentication.  Eventually, users will be able to log in and post comments, but you should also be able to log in and make blog posts.  For this, we'll generate a single User model with an is_blogger flag using the Devise plugin and then protect the actions we want protected using a before_filter.

©2013 About.com. All rights reserved.