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

Author Archives: Peter Cooper

By Peter Cooper / January 5, 2009

If you’re developing a snippets or pastie-type system or another form of CMS where source code might be stored, it’d be incredibly useful to automatically detect what language a provided source is in so that you can style it appropriately.

Chris Lowis’ SourceClassifier (or Github repo) library does just that, using a Bayesian classifier trained on source code from the Alioth Shootouts. Out of the box it has support for C, Java, JavaScript, Perl, Python and Ruby, but you can train it to recognize others (CSS and HTML seem like notable omissions to me). Read More

By Peter Cooper / January 1, 2009

sanitize.png

If you’ve developed an application that displays user-supplied text in a Web browser, it’s always possible that the user has entered some crazy HTML (or even CSS) that will break your site’s layout. While it’s easy to remove all HTML from a piece of text, you might want them to use certain subsets of HTML to format their content, so you need to sanitize the user supplied HTML and CSS. Luckily, two Ruby libraries have been released in the last couple of days to sanitize HTML and CSS respectively.

HTML

Sanitize (or Github repo) by Ryan Grove is a new HTML sanitization library for Ruby. Read More

By Peter Cooper / December 31, 2008

rubytop10-giles.gif

Note: This post is a part of Ruby Inside’s Top 10 in 2008 series. To learn more or see the other awards, read this introductory post.

Giles Bowkett – Controversy, Excitement, and Awesomeness in 2008

Giles simply had to feature in Ruby Inside’s Top 10 of 2008 and since there’s no Top Crazy Mofo category, he instead scores for this excellent presentation at RubyFringe (yes, it’s all there to watch online, thanks to InfoQ!) Despite nominatively being about his “semi-autonomous Ruby musical instrument” Archaeopteryx, the presentation is really about building up an ecosystem around your passions – something most of us can relate to. Read More

By Peter Cooper / December 30, 2008

Yuki Sonoda has just announced the release of Ruby 1.9.1 Release Candidate 1 on the ruby-talk mailing list:

This is a release candidate of Ruby 1.9.1, which will be the first stable version of Ruby 1.9 series. Try it early and have a experience of modern, faster, with clearer syntax, multilingualized and much improved Ruby world.

We have fixed 72 bugs and implemented some features. If you encounter a bug or a problem, please let us know it via the official issue tracking system.

If you’re a Ruby developer, particularly if you have any libraries out in the field, getting up to speed with Ruby 1.9 is becoming a necessity. Read More

By Peter Cooper / December 27, 2008

somebooks.jpgSo here we are right in the down period between Christmas and the start of the New Year. Few big releases or new developments come out at this time of the year, so it’s a good time to either enjoy time offline or.. to get reading some insightful articles we wouldn’t normally have time for! Luckily a few Rubyists have been busy spending the end of December putting together some rather good articles.. so get reading:

Understanding Ruby Blocks, Procs, and Lambdas by Robert Sosinski. Robert presents a comprehensive walkthrough of Ruby blocks, Proc objects, and lambdas with lots of code examples. Read More

By Peter Cooper / December 23, 2008

fukuoka.pngThe Government of Fukuoka Japan, together with the Fukuoka Ruby Award Selection Committee, is running the 2009 Fukuoka Ruby Award Competition. In short, they’re trying to raise public awareness of the growing software industry in Japan but also Ruby in general.

With a deadline of Christmas Day, you only have just over 24 hours to apply! Two types of award are offered:

Award Type A is for a business model or system developed using Ruby.

Award Type B is for activities that contribute to the promotion, growth and expansion of the Ruby language.

The top prize is 1 million yen (approximately $11,114 at current rates) but three “outstanding performance award”s of 100,000 yen (approximately $1111) are also up for grabs. Read More

By Peter Cooper / December 23, 2008

cloudkit.gif Apologies for the buzzword collision in the title, but Cloudkit really is a RESTful JSON-powered storage appliance that uses Rack! Think of it as a schema-less, HTTP accessible database of sorts – like CouchDB without some of the more advanced features. It’s all written in Ruby and makes it ridiculously easy to set up a fully discoverable, RESTful, JSON API.

In the Release: CloudKit 0.9 blog post, developer Jon Crosby demonstrates how easy it is to get Cloudkit up and running. Just two lines in a config.ru file and you’re ready to roll with the basic featureset. If you want to add OpenID and OAuth support, just change a word and it’s all running. Read More

By Peter Cooper / December 21, 2008

rubytop10-john.gif

Note: This post is a part of Ruby Inside’s Top 10 in 2008 series. To learn more or see the other awards, read this introductory post.

John Nunemaker – Consistently Good Ruby Blogging in 2008!

johnn.jpg

Rather than unethically considering ourselves or one of our sister blogs (!!), we set out to look for the best independent Ruby blogger of 2008. It wasn’t a hard search. While there are a lot of good blogs out there, few have been as consistently good as John Nunemaker’s RailsTips. John (@jnunemaker on Twitter) is always looking out for new things and ways to make life simpler for Ruby and Rails developers, and while many have fallen back to just putting code on Github or Twittering in 2008, John has consistently blogged about his new projects and those of others. Read More

By Peter Cooper / December 18, 2008

sinatra-icon.pngSinatra, a Ruby “micro framework” for developing Web applications, is hot stuff! Despite being over a year since we first mentioned Sinatra (as used on a 100 line blogging app called Reprise), only now does Sinatra seem to have reached critical mass – it’s on the cusp of becoming really popular. This is a good time, then, to check it out and see where it could fit into your own projects (with the new Rails Metal functionality (in edge/2.3 only) you can ever run a Sinatra app as a lightweight companion integrated with your Rails apps!)

Sinatra’s official homepage provides an incredible number of alluring examples. Read More

By Peter Cooper / December 16, 2008

rubytop10-hitter.gif

Note: This post is a part of Ruby Inside’s Top 10 in 2008 series. To learn more or see the other awards, read this introductory post.

Jeremy McAnally – One of Ruby’s Busiest Hackers of 2008

jeremym.pngJeremy McAnally (Twitter @jeremymcanally) is a Huntsville, Alabama based Ruby developer who has been developing software for about 10 years and now works for popular consultancy ENTP. He takes Top Hitter (no, not Hitler!) for being, in Ruby Inside’s opinion, one of the most consistent releasers, challengers, and driving forces in the Ruby and Rails worlds this year. His releases span many media – two books (Ruby In Practice and The Humble Little Ruby Book), a magazine (The Rubyist), libraries (context, matchy, dcov, and more), and a blog (his blog – omg blog!! Read More

By Peter Cooper / December 15, 2008

ast-img.pngWhenever you run a Ruby program, Ruby’s parser processes the code and turns it into an “abstract syntax tree” (an AST) which can then be either turned into bytecode for YARV (on Ruby 1.9) or be interpreted immediately (as with Ruby 1.8).

While a programming language allows programmers to represent the logic of a program in a way that’s both suitable for developers and computers to easily understand, abstract syntax trees act as a low-level tree representation of the program’s mechanics. Given that ASTs are typically simple data structures, it’s possible to use them to convert one language to another, to semantically analyze what a program is going to do, to detect repetition, or to optimize how the final program will run. Read More

By Peter Cooper / December 12, 2008

rubytop10-teacher.gif

Note: This post is a part of Ruby Inside’s Top 10 in 2008 series. To learn more or see the other awards, read this introductory post.
satishtalim.png

Satish Talim – Ruby Evangelist and Facilitator

Satish Talim is an established software development expert (over 30 years of experience in the industry!) based in Pune, India. He’s most recognized in the Ruby community for his ongoing work with his RubyLearning group of sites. He’s also built up a strong following on Twitter @IndianGuru.

Since 2006, Satish – along with a fast growing group of volunteers – has helped thousands of people (many of who first came into the Ruby world in 2008) in over 100 countries to learn Ruby. Read More

By Peter Cooper / December 11, 2008

rubytop10logo.png2008 has been an interesting year for Ruby. Some people are going to remember 2008 as a snarky, uncivil year, filled with call outs, lay-offs and bitchiness. There has been an increase in negative articles about Ruby, even from prominent Rubyists. Back in November, KirinDave said that Ruby is in “a very bad place” and lacks momentum.. as if!

Back in the real world, Ruby has been doing just fine. Ruby 1.9.1 is due for final release any time soon, a ton of awesome libraries and technologies have been released or previewed, and Ruby (and Rails and Merb) powered Web apps have continued to flourish. Read More

By Peter Cooper / December 9, 2008

ruby-shootout-dec.png

Back in December 2007, Antonio Cangiano presented The Great Ruby Shootout, a large set of benchmarks of then-current Ruby implementations (Ruby 1.8.5, YARV – early Ruby 1.9, JRuby, Ruby.NET, Rubinius, XRuby, and Cardinal). Even then, despite Ruby 1.9′s infancy and experimental nature, Ruby 1.9 came out as about three times faster than Ruby 1.8.5 – while other implementations were barely faster than 1.8.5.

Now.. for 2008: Ruby 1.9.1 is the winner..!

Now Antonio has put together an all new December 2008 Great Ruby Shootout! There’s a lot of reading to do but the results are very exciting. JRuby’s performance has come along in leaps and bounds and Ruby 1.9.1 is around five times faster than Ruby 1.8.7. Read More

By Peter Cooper / December 6, 2008

rrunx.pngIt was a few months ago that Rubysophic – a Bay Area startup working on products relating to Ruby diagnostics – came quietly into the Ruby scene, launching their first product, RubyRun Community Edition, a free, standalone application-performance diagnostic tool. While the most obvious use is with Rails applications, RubyRun works on any Ruby code (within reason) though it’s primarily suited to Web applications.

I spoke with a few developers at Rubysophic recently to find out more about RubyRun and why they were offering it for free. It turns out that their team mostly comes from the J2EE (Java 2 Platform, Enterprise Edition) world (from companies including HP, IBM, and Cisco) and they wanted to release a suite of enterprise-quality diagnostics tools and services for the Ruby world. Read More