tutorials

Building A Well Formed Number Handling Class From Scratch

Over on the Ruby Best Practices blog, Robert Klemme walks through the process of building a new numeric class from scratch in Ruby - taking into account all the gotchas and considerations that pop up along the way. Robert's task is harder and more involved than you'd initially suspect.!

How Ruby Manages Memory and Garbage Collection

Garbage Collection and the Ruby Heap is a presentation given by Joe Damato and Aman Gupta at the recent LA Ruby Conference. You only get the slides for now (all 70 of them!), but they're very detailed and can almost work as a standalone concise e-book on Ruby's garbage collection system.

Joe and Aman take a look at C memory management vs Ruby and show the difference between the stack and the heap. As a garbage collected language, Ruby takes the easy route by putting everything on the heap and the presentation demonstrates how the MRI (Matz's Ruby 1.8) does this, as well as how objects are tracked within memory (right down to the underlying C structs).

Deploy A Free, Ruby Powered Blog In 5 Minutes with Toto and Heroku

Toto (GitHub repo) is a new lightweight Ruby and Rack-based blogging engine designed specifically for "hackers" by Alexis Sellier. Content is managed entirely through Git - so everything is version controlled - and articles are stored as text files with embedded YAML metadata. At only 300 lines, it's easy to hack to your own taste, too.

Rails 3.0’s ActiveModel: How To Give Ruby Classes Some ActiveRecord Magic

One of the biggest benefits of bringing Merb developer Yehuda Katz on board to work on Rails 3.0 has been his relentless pursuit of extracting out all of Rails' magical abilities from their monolithic encasings and into separate, manageable chunks. A case in point is ActiveModel, a new library that provides the model related parts of ActiveRecord but without the database requirements.

Building a Search Engine in 200ish Lines of Ruby

Sau Sheong Chang works for Yahoo! in their Sinagapore office. Yahoo! isn't implemented in Ruby, of course, but Sau's made an attempt at implementing a basic search engine in Ruby and has written a pretty interesting, indepth article about the whole process. Sau's search engine is formed of a crawler, indexer, and query system, and uses Hpricot, DataMapper, and Sinatra to get things done. Lots of code, lots of explanations - go read it.

TextMate Screencasts for Rubyists

Are you a OS X dwelling, TextMate wielding, Rubyist? I am, but I'm next to useless with all of the advanced features (and by advanced I mean anything beyond Cmd+R). Lucky, then, that Derek Neighbors has started a super-duper series of TextMate Tip screencasts!

So far there are three videos, but I suspect he has more on the way, so if you like the look of them, subscribe to his feed:

Ruby Techniques Revealed: Autoload

There's plenty of stuff in Ruby that I've either not noticed before, noticed but forgotten about, or otherwise failed to realize the utility of. Add to that all the awesome Ruby tricks and techniques I'm seeing in people's code over on Github lately and.. we need a new series here: Ruby Techniques Revealed!

Disclaimer: I'm not promising you won't already know about anything I "reveal." A lot of you are far better than me at knowing all of Ruby's dark corners. I'm just going to shine a spotlight in the direction of things I don't see used very often that I think are cool.

How to Get A Job at a Top Ruby Shop

Despite whatever’s going on in the bigger world, there doesn’t seem to be a shortage of jobs in the Ruby and Rails worlds - at least, not in certain cities. There also doesn’t seem to be a shortage of Ruby and Rails developers, but employers are still desperate to find people to fill positions. A few employers complained to me that the quality just wasn’t there and that there were a lot of tire kickers about.

How To Install A Ruby 1.8 Stack on Ubuntu 8.10 From Scratch

Want to install Ruby, RubyGems, and a collection of common gems on Ubuntu 8.10 (Intrepid Ibex) in just a few minutes? Here's the skinny.

If you want, you could use something like Passenger-Stack to do the legwork for you, but I prefer doing manual installations so I know the full score. There are several "how to install Ruby on Ubuntu Intrepid" guides out there but none of them got it totally right for me. I've just used these instructions twice in a row so I know they work. Another bonus is you get ImageMagick and rmagick installed which some people get really frustrated with..

Building a Ruby Gem (From Scratch) Using Behavior Driven Development

If you read a lot of Ruby blogs, you might see people talking about testing (or its behavior driven equivalent) as if it's the holy grail, yet most Ruby books and online tutorials fail to cover it in much detail at all. Last year, Jamie Van Dyke wrote an article for The Rubyist called Building A Gem Using BDD to put things right (the article was licensed exclusively to the magazine until recently).

Ruby + Graphviz == Automated Data Visualization

Mark McBride has written Automating Data Visualization with Ruby and Graphviz, a great introduction to using Ruby with the popular Graphviz tool to produce visualizations of data.

The article starts off with an example of the sort of data you might want to analyze then moves on to explaining GraphViz and its "DOT" notation. From there, Mark leaps straight into using the ruby-graphviz library and provides code to produce a graph for a sample data set.

Scaling Ruby - The Informative, 40 Minute Screencast

Earlier this month, Rails Envy's Gregg Pollack gave a talk at RubyConf08 called Scaling Ruby (without the Rails). He answered questions like "How do existing Ruby applications use Threads/Processes to scale?", "How do we implement an Event Driven application using Ruby EventMachine?", "What are the current bottlenecks with speeding up Ruby and how can they be fixed?", and "What does Ruby 1.9 bring to the table to speed things up?" From what I hear, it was a very well received and informative session.

Merb 1.0 Released So Here’s 44 Links and Resources To Get You Going

Merb - a much heralded, highly flexible Ruby-based Web application framework - has reached version 1.0 after two years of development. Congratulations to Merb's creator, Ezra Zygmuntowicz, and to the large group of associated developers (such as Yehuda Katz and Matt Aimonetti) who've kept adding features and pushed Merb forward to be a significant alternative to Rails.

How To Develop A Mac (Cocoa) Application With MacRuby And XCode

Over a year ago we had a post about how to build OS X GUI applications with Ruby and RubyCocoa. Since then, however, MacRuby has arrived on the scene. Not just the regular version of Ruby with some bindings to Cocoa, MacRuby is as native to OS X as JRuby is native to the JVM.

Syndicate content