background preloader

Ruby

Facebook Twitter

Templates

Rubyonrails. Ruby Fibers: 8 Useful Reads On Ruby’s New Concurrency Feature. New to Ruby 1.9 is the concept of fibers. Fibers are light-weight (green) threads with manual, cooperative scheduling, rather than the preemptive scheduling of Ruby 1.8's threads. Since Ruby 1.9's threads exist at the system level, fibers are, in a way, Ruby 1.9's answer to Ruby 1.8's green threads, but lacking the pre-emptive scheduling. Now that Ruby 1.9 is becoming more important with each passing month, I've rounded up some of the best articles about Ruby 1.9's fiber functionality so that you can be up to speed with all of the major concepts in perhaps 10 to 15 minutes.

If you're getting interested in Ruby 1.9, you'll want to read on: Fibers & Cooperative Scheduling in Ruby - Ilya Grigorik hits it out of the ballpark with perhaps the best overview of fibers. Includes a snazzy diagram, a code example, and a look at how JRuby and Rubinius compare. Ruby 1.9 Fiber documentation - The actual Ruby 1.9 documentation for the Fiber class. Still new to the Ruby 1.9 bandwagon? Building a Mini-Google: High-Performance Computing in Ruby - Int. RubyRSS : Elegant as Ruby RSS parser and generator. RSS Parser::Tutorial.en. $Id: Tutorial.en 377 2009-05-16 02:07:58Z kou $ Sorry for my funny English :-( Note RSS Parser supports RSS 0.9x/1.0/2.0 excluding 0.90.

Sorry. If you want to handle Atom and/or Podcast module (itunes:XXX element), use 0.1.8 or later. If you want to handle Slash module (slash:XXX element), use 0.2.0 or later. require You only require "rss" if you're using RSS Parser 0.1.5 or later: require 'rss' Parsing Use RSS::Parser class to parse a feed. An example of parsing RSS 1.0 with validation is below, where the variable rss_source is String of RSS 1.0. require 'rss' rss = RSS::Parser.parse(rss_source, true) The second argument of RSS::Parser.parse is true by default, so it can be left out. Require 'rss' rss = RSS::Parser.parse(rss_source) First parse RSS with validation, and if it is not valid parse with non-validation. require 'rss' rss = nil begin rss = RSS::Parser.parse(rss_source) rescue RSS::InvalidRSSError rss = RSS::Parser.parse(rss_source, false) end Handling of unknown elements.

Parsed feed reader. O'Reilly Network -- Creating Games in Ruby (Part 1) By Andrea O. K. Wright 12/11/2007 Editor's Note: Read more about creating games in Ruby in Part 2 of this article. Because it is so expressive and flexible, Ruby can make some of the most mundane tasks not only easy, but fun. With game development frameworks handling the low-level details, something like writing game logic, that is inherently fun, can be especially enjoyable with Ruby. But can playing games written in Ruby be as much fun as writing them, or do they run too slowly, with too many breaks in the action at inopportune times? Is Ruby a legitimate player in the gaming space? The video clips and screenshots of Ruby-based games and special effects that are embedded within this two-part series provide a partial answer to these questions: you can have a lot of fun playing games written in Ruby!

The bulk of this series is a survey of resources for building 2D and 3D games with Ruby. Ruby/SDL - Lead Developer and Creator: Ohai SDL was developed in C. Uint32 SDL_GetTicks(void); Figure 1. Ruby Programming Language.