Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

By Peter Cooper / June 23, 2010

Isolate, developed by John Barnette, seems to be a less opaque alternative to Bundler where gems are built and installed within a single Ruby project, in a “vendorized” fashion.

Steven’s adoption and advocacy of Isolate stems from a bitter and fundamental disagreement between Steven, BJ Clark, and an un-named Bundler developer. Ah, the intrigue! Read More

By Peter Cooper / June 22, 2010

At RailsConf 2010, Fabio Akita (of AkitaOnRails.com) went crazy with his camcorder and interviewed a wide selection of Rubyists, as well as famous C++ and Agile manifesto developer Bob Martin.

The interviews are divided up into groups:

  • Robert Martin – as well as an interview with Fabio, a video of his keynote at RailsConf 2010 is also included
  • David Heinemeier Hansson – 23 minutes of one-on-one with DHH – a refreshing change from his usual keynote/mass audience style
  • Miscellaneous interviews – covering Ryan Bates (Railscasts), Ben Scofield, James Golick, Carl Lerche, and Santiago Pastorino.
  • Ruby Heroes winner interviews – covering Aaron Patterson [Nokogiri], Gregory Brown [Prawn], Nick Quaranto [Gemcutter], and Wayne E Seguin [RVM]
  • Read More

By Peter Cooper / June 20, 2010

Some sample code will clear up any confusion:

class Product < ActiveRecord::Base
scope :untitled, where(attribute(:name) == nil)

def self.cheaper_than(price)
where attribute(:price) < price
end

def self.search(term)
where attribute(:name) =~ "%#{term}%"
end
end

sexy_scope reimplements Arel Read More attribute methods like lt, in, matches and not using regular Ruby operators.

By Peter Cooper / June 20, 2010

Earlier today, someone on Twitter linked up this fun “Ruby propaganda” poster by Paul Battley. I asked him if I could post a copy here for fun and he pointed out that it’s six years old! With Ruby sliding down the TIOBE index a couple of places, though, perhaps it’s time to revive it ;-)

Update: Since the flames have already begun, this is just a fun, tongue in cheek link to a poster I thought was cool. No language wars needed! Read More

By Peter Cooper / June 19, 2010

Glyph(GitHub repo) is an interesting looking “document authoring framework” built in Ruby by Fabio Cevasco. Glyph is both a tool chain and a macro language that’s parsed by Treetop into XHTML (which can then be transformed into PDF).

Fabio has clearly put a ton of work into this and has been eating a lot of his own dogfood, as this 72 page PDF manual for Glyph (produced by Glyph itself) demonstrates. In an e-mail to me, Fabio stressed that “he could really use some help” from people interested in document authoring and building in the form of code contributions and testing, and he’s ready to help people get started with that. Read More

By Peter Cooper / June 19, 2010

It’s been almost a year since Ric Roberts posted about using MongoDB and MongoMapper and I’ve seen an explosion in the number of people using these tools in the Ruby community since then (I use them heavily on coder.io too).

MongoMapper has become the de facto standard way to use MongoDB from Ruby, but it’s not the only game in town. Mongoid, by Durran Jordan, has recently been creeping up in popularity too, and with a stunning project site and robust documentation, it deserves some attention.

At first glance, Mongoid and MongoMapper seem to take similar approaches and have very similar APIs, so I got in touch with both Durran Jordan (Mongoid) and John Nunemaker (MongoMapper) to split some hairs and it turns out they have different motivations, aims, and, underneath it all, they target different use cases pretty well.  Read More

By Peter Cooper / June 18, 2010

In January 2008, I lamented that the lack of a true mod_ruby was damaging Ruby’s viability on the Web (which led to 100+ posts in the comments section!) but within a couple of months Phusion released Passenger (then known as mod_rails) and Ruby webapp deployment hasn’t been the same since.

Now, Phusion have built up a successful little consulting business (with some seriously big name clients) and are hard at work on Passenger 3. “Ease of use, stability, and robustness” are the keywords, and while performance is still being improved, Phusion seem keen to make Passenger the highest quality solution rather than merely the faster. Read More

By Peter Cooper / June 17, 2010

For the past couple of years, Hampton Catlin (best known as the inventor of Haml) has run an annual Ruby survey and you can take the 2010 survey now. There are 23 multiple choice questions, mostly about your library and coding preferences.

At the time of posting, 3619 people have taken the survey and, interestingly, you can check out the results of the survey as it goes on – the results page is automatically updated each day.

Things that stand out in the results are the significant growth in jQuery, Ruby 1.9 (up to 24% this year from 7.6% in 2009), and Haml usage, and that 10% of respondents list Sinatra as their webapp framework of choice (up from 2.8% in 2008). Read More

By Giles Bowkett / June 17, 2010

Hi – this is a guest post by Giles Bowkett. I made at least $10,000 in the last few months selling videos on my personal blog (including at least $5,000 selling a video about how to have a terrific programming career, and at least $5,000 selling a video about how to sell videos on your blog).

As crazy and hucksterish as this might seem, I’m not the only one. PeepCode, the Pragmatic Programmers, RailsEnvy, ThinkCode.tv, and Codeulate all sell Ruby-related screencasts; Rubyists selling Ruby-related ebooks include Jeremy McAnally, former Rails Activist Mike Gunderloy, Marc-André Cournoyer, the husband-and-wife team of Thomas Fuchs and Amy Hoy, and, if you go back as far as 2006, DHH himself, and 37Signals as a whole (who made $120,000 in one month selling a PDF off their blog, and in the process sparked a debate with Tim O’Reilly about whether traditional publishers still had any value at all – a debate somewhat ironic in the context of this year’s new, traditionally-published 37Signals book, Rework). Read More

By Peter Cooper / June 17, 2010

I received this e-mail today:

Who could refuse such a short, pleasant e-mail? Not me, which is why if you’re looking to soothe your soul and do some Rails work, you should check out their job listing. You need to be near to Seattle as you need to be on-site at least a day or two each week, but full-time and half-time arrangements will be considered. Read More

By Peter Cooper / June 16, 2010

If you’re using the MongoDB document oriented “NoSQL” database from Ruby at all, you owe it to yourself to try John Nunemaker’s MongoMapper – it’s practically the ActiveRecord of the MongoDB world.

The latest version is a strong step forward. ActiveRecord-esque scoping has been added, and a smart new querying DSL has been implemented that lets you do things like:

User.where(:age.gt =27).sort(:age).skip(1).limit(1).all

If you’re not using MongoDB at all and aren’t sure what all the hoopla is about, John’s Why I Think Mongo Is To Databases What Rails Was To Frameworks from December 2009 is a great high-level introduction to the concepts involved. Read More

By Peter Cooper / June 16, 2010

In Rethinking PDF Creation in Ruby, Jared takes a playful swipe at Gregory Brown’s much loved Prawn PDF generation library. He expresses a preference for converting HTML and CSS documents to PDF, rather than using the more PDF-level conventions Prawn adopts. To do this, he and some colleagues built PDFKit, a Ruby HTML-to-PDF library powered by wkhtmltopdf.

Given the “Prawn is a bit meh” tone of Jared’s article, though, Gregory Brown is not impressed and points out that Prawn gives you stronger and more precise under-the-hood control, useful particularly for building complex forms, tables and doing point-perfect positioning of on-page elements. Read More

By Peter Cooper / June 14, 2010

Developers hankering for more performance from their Rack and Rails applications are using Ruby 1.9 fibers and event-based EventMachine-driven libraries as a way to boost the performance of their applications – in opposition to scaling by merely running multiple processes or using threads.

It’s no secret that thread-based development can be Hard™, even if you didn’t have to deal with Ruby quirks like autoloading not working properly and the GIL (Global Interpreter Lock). Luckily, Ruby 1.9 provides fibers, light-weight “execution units” that are manually scheduled by their parent application.

Back in April, Mike Perham introduced Phat, an asynchronous Rails 2.3.5 app running on Ruby 1.9 and supporting “many concurrent requests in a single Ruby process.” In his explanation, he referred back to Scalable Ruby Processing with EventMachine, a talk he gave at Austin On Rails that’s worth checking out. Read More

By Peter Cooper / June 14, 2010

This is a simpler, open source equivalent to systems like New Bamboo’s Pusher, but using the Comet-like Bayeux protocol with AJAX rather than WebSockets. Start a server (based on node.js or Ruby/Rack) and then push and pull messages between clients and apps in JavaScript and Ruby. Read More

By Peter Cooper / June 12, 2010

fog is a Ruby gem by Wesley Beary to control a variety of cloud services through a unified API. It deals with both server cloud and storage based services and supports Amazon S3 and Rackspace Files; as well as servers and on Amazon EC2, Rackspace Servers, Terremark vCloud and Slicehost. Support is also available for Amazon ELB and SimpleDB.

The beauty of fog is how the same code interacts with different cloud services. It uses models, an idea familiar to anyone who has used an object mapper (like ActiveRecord), to abstract the common parts between cloud services. That leads to code that you can switch between cloud services easily. Read More

Recently Popular Posts