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

Author Archives: Peter Cooper

By Peter Cooper / August 29, 2008

It has not gone unnoticed that random announcements of individual events do not work well here on Ruby Inside. With events taking more of a local focus these days, it makes more sense to pool the announcements together. This post, therefore, is a rather uncelebrated launch of a new series of event-related compilation posts. Please make sure to post in comments if you have other events you want to mention or visit our Contact page.

merbcamp.png MerbCamp – October 11 and 12, 2008 – San Diego, CA, USA

MerbCamp is an upcoming official gathering for the Merb community. Confirmed keynotes are by Ezra Zygmuntowicz and Yehuda Katz. Read More

By Peter Cooper / August 26, 2008

macklogo.png We first covered Mack in April, when I billed it as a “fast, best of the rest, Web app framework.” Mack, a Ruby-based Web application framework, developed by a team led by Mark Bates, has continued to grow over the past several months and today announced a significant release, Mack 0.7.0.

Mack is a unique Ruby Web app framework due to its heavy focus on reusability across multiple applications. Mack supports distributed objects – yes, between multiple applications, distributed views and layouts, and even distributed routing (all of your Mack apps can be aware of each other’s routing). Mack has a Google group for discussion purposes, and Mark has put together a great screencast demonstrating how to create a simple application with the framework. Read More

By Peter Cooper / August 25, 2008

neverblock.pngNeverBlock is a Ruby (1.9) library developed by eSpace – an Egyptian Web 2.0 development team – that could make your life a whole lot easier if you have to deal with blocking IO operations that hold up all your Ruby threads.

NeverBlock makes it easy to get the benefits of non-blocking IO (IO operations that aren’t held up by mutexes) in your Ruby apps without having to take the usual route of redesigning your app to be event-based. You get all the benefits of event-based code (lower CPU overhead, lower memory use, less hangups) but with the benefit of a normal program flow model. Read More

By Peter Cooper / August 22, 2008

difflanguages.png

WhatLanguage is a library by Peter Cooper (disclaimer: yes, that’s me) that makes it quick and easy to determine what language a supplied text is written in. It’s pretty accurate on anything from a short sentence up to several paragraphs in all of the languages supplied with the library (Dutch, English, Farsi, Russian, French, German, Portuguese, Spanish, Pinyin) and adding languages of your own choosing isn’t difficult.

The library works by checking for the presence of words with bloom filters built from dictionaries based on each source language. We’ve covered bloom filters on Ruby Inside before, but essentially they’re probabilistic data structures based on hashing a large set of content. Read More

By Peter Cooper / August 21, 2008

rinredesign.png

New Design

Till yesterday, Ruby Inside had been sporting the same tired design it had since launch in May 2006, but no more! Ruby Inside now has a more up to date design that focuses more on getting access to great Ruby (and some Rails) content from both Ruby Inside itself and other sites (like Ruby Flow).

If you only read Ruby Inside through the full text feed, please visit the site directly just to give it a look – pretty please? :)

Follow RubyInside on Twitter

The new design you see today is only step one of a longer-term process to make RubyInside.com more useful for all Ruby and Rails developers. Read More

By Peter Cooper / August 20, 2008

yahooboss.gifRecently, Yahoo! launched BOSS – the “Build Your Own Search Service.” In all but name, it appears very similar to their older Yahoo! Search API, as it allows you to query Yahoo’s search index programatically. Under the surface though, Yahoo has removed the 5,000 query per day limit, you’re unrestricted in how you present the data returned, you can re-order the data, and no attribution is required.

For Rubyists ready to play with BOSS, Jay Pignata has developed BOSSMan, a library for interacting with the Yahoo! BOSS Web service. Either get it with Git or install with RubyGems like so:

gem sources -a http://gems.github.com
gem install jpignata-bossman

Once you’ve got the library, make sure you’ve got an application ID from Yahoo (this is unavoidable, alas) and then you can start to play:

require ‘rubygems’
require ‘bossman’
include BOSSMan

BOSSMan.application_id = “Your Application ID here”

news = BOSSMan::Search.news(“Barack Obama”, 0, 3)
news.results.each do |result|
puts “#{result.title} [from #{result.source}]”
end

BOSSMan supports Web, news, and image searches out of the box. Read More

By Peter Cooper / August 15, 2008

shoesnew.png

It was about a year ago now that Rubyist extraordinaire Why The Lucky Stiff first showed his “Shoes” Ruby cross-platform GUI application toolkit off to the world. Since then, he’s not let up with the development.

Previously, we’ve featured the release of The Shoebox – a Shoes application repository – and Nobody Knows Shoes – a short book about Shoes, done a roundup of Shoes tutorials, and looked at how to write a drawing program with Shoes on OS X.

Now, Shoes has a new official homepage – located at http://shoooes.net/ (yes, that’s three os). Complete with a picture of an Amstrad CPC and gloriously pixellated logo, there’s now a reasonably non-technical place to go to download Shoes, get into the wiki, and get access to the book. Read More

By Peter Cooper / August 12, 2008

ruby19samruby.png

Ruby 1.9: What To Expect is an online slideshow by Sam Ruby that covers a lot of the differences between the Ruby 1.8 that we all know and love and the currently experimental Ruby 1.9. Sam’s examples are to the point, easily digestible, and span 47 slides. He gave the original presentation at OSCON in Portland a couple of weeks ago.

Sam’s presentation is quite similar to “Migrating to Ruby 1.9” by Bruce Williams which we posted about in April. It never hurts, however, to frequently revise the changes since Ruby 1.9 will be production-ready in just four short months..! Read More

By Peter Cooper / August 8, 2008

dontpanic.jpg
Photo by JL2003 – CC 2.0 Attribution License

In June, a serious security advisory was put out about the official (MRI) Ruby interpreter for all versions prior to 1.8.5, 1.8.6 prior to patch 231, 1.8.7 prior to patch 22, and 1.9.0 prior to 1.9.0-2. Now (August 8, 2008) a new set of vulnerabilities have been discovered and announced. They affect all 1.8.5 releases, 1.8.6 patch 285 and prior, 1.8.7 patch 70 and prior, and Ruby 1.9 r18423 and prior. This almost certainly means an upgrade is required for most users as all but very recent versions are affected.

The vulnerabilities discovered this time around aren’t, on the surface, quite as serious as those last time around. Read More

By Peter Cooper / August 6, 2008

There are some really amazing sounding jobs this month! The focus is definitely on Rails – and working environments include the skunkworks at an adult entertainment provider, a gaming startup, a mansion in Los Angeles, and one of the biggest companies in America. All the jobs are in the US, alas, but on both coasts and in-between!

From the Ruby Inside job board (costs $99 for a 60 day listing – and you get featured on Ruby Inside like this) comes a whole batch of interesting opportunities:

kiha.png Web Developer for a Mobile Start Up (Seattle, WA) – Kiha are looking for a general Web developer with Ruby, Ajax, and MySQL experience (and preferably some Java). Read More

By Peter Cooper / August 4, 2008

prawn.png

Prawn is a new pure Ruby PDF generation library developed primarily by Gregory Brown.

Back in March, Gregory tried to raise $13000 so he could spend six months working on Ruby-related open source projects. He eventually raised $5525 from the community (plus $5000 from Ruby Central and $500 from Mountain West RubyConf) and has spent the last few months working on Prawn.

Prawn can be installed from a pull from GitHub or, for those of us who are less adventurous, with a gem install prawn. Once installed, you can give it a quick test run:

require ‘prawn’

Prawn::Document.generate(“test.pdf”) do
font “#{Prawn::BASEDIR}/data/fonts/DejaVuSans.ttf”
text “this is a test ” * 100
end

Prawn comes with 11 typefaces, including Helvetica, Courier, DejaVuSans, Times, and everyone’s favorite – Comic Sans. Read More

By Peter Cooper / August 3, 2008

rubyist-thumb.jpg

The Rubyist – not to be confused with the Japanese Rubyist Magazine – a new paper-and-PDF based magazine for Ruby developers has released its first issue. This is a significant milestone, since it was just over a year I lamented about how the blogosphere killed the enthusiasm for Ruby magazines. In response to that post, Jeremy McAnally announced his intention to produce a Ruby magazine, and now, with the advent of simple Print On Demand magazines from MagCloud, it has become a reality.

The first issue is available in print for the United States only and costs $8 plus postage. Read More

By Peter Cooper / August 2, 2008

httparty.jpg

HTTParty is a new Ruby library by John Nunemaker (of railstips.org fame) that makes it a snap to build classes that can use Web-based APIs and related services. At its simplest, you include the HTTParty module within a class, which gives your class a “get” method that can retrieve data over HTTP. Further directives, however, instruct HTTParty to parse results (XML, JSON, and so on), define base URIs for the requests, and define HTTP authentication information.

HTTParty’s simplicity is demonstrated in the most “complex” example John gives in his introduction post – a Representative class that can retrieve information about US Representatives from whoismyrepresentative.com:

require ‘rubygems’
require ‘httparty’

class Representative
include HTTParty
base_uri ‘whoismyrepresentative.com’
default_params :output =’json’
format :json

def self.find_by_zip(zip)
get(‘/whoismyrep.php’, :query ={:zip =zip})
end

def self.get_all_by_name(last_name)
get(‘/getall_reps_byname.php’, :query ={:lastname =last_name})
end
end

puts Representative.get_all_by_name(‘Donnelly’).inspect
# {“results”=[{"district"="2", "last"="Donnelly", "first"="Joe", "state"="IN", "party"="D"}]}

That code will work for you after a simple gem install httparty. Read More

By Peter Cooper / August 1, 2008

rubyhoedown.png

Yee-haw! The Ruby Hoedown, the “Ruby conference for the South” enters its second year, taking place in Huntsville, Alabama on August 8th and 9th, 2008 (yes, in a week’s time!). Speakers include David Black, Chris Wanstrath, Giles Bowkett, Robert Dempsey, Gregg Pollack and Jason Seifer, and late registration is $199. If you fancy a last-minute trip to what should be a great sophomore Ruby event, register now!. Huntsville isn’t a crazy distance from Birmingham, Atlanta, or Nashville, so it shouldn’t be too hard to attend if you’re already in that corner of the country.

Describe Your Vision of the Perfect Ruby Conference.. Read More

By Peter Cooper / July 29, 2008

Ruby on Bells is a demo of the Madrona fork of RAD (Ruby Arduino Development) itself a Ruby bridge to Arduino, an open source electronics prototyping platform. Powered by a simple Ruby script, a set of glasses are hit by small mallets on servos, resulting in a Philip Glass-esque cacophony. It’s a compelling demo, and if physical computing intrigues you, the tools available to Ruby and Arduino developers are now mature enough to bring interesting results within easy reach.

A longer “behind the scenes” video explaining how it was put together and how the code looks is also available. The code used is a very simple Ruby-based DSL. Read More