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

Author Archives: Peter Cooper

By Peter Cooper / September 10, 2006

Infoqjrubyvideo

Thomas Enebo and Charles Nutter have put together an online video and slide presentation along with InfoQ about JRuby. As the guys talk about Ruby and JRuby in the video, the slides underneath automatically update with their slides and code examples. Excellent, and especially excellent if you want to learn about what they’re up to with JRuby. Read More

By Peter Cooper / September 10, 2006

Chronic is a natural language (English only, at present, I think) time and date parser written entirely in Ruby. It supports a staggering number of different ways of expressing the date and time. For example:

tomorrow
this monday 07:30
may 15th
tomorrow morning
yesterday at 9:00
tomorrow at 11pm
wednesday last week

Time.parse already does a great job, but this goes a step further. You can install chronic quickly with gem install chronic. Read More

By Peter Cooper / September 7, 2006

Charles Nutter, one of the developers of JRuby, a Ruby implemention running on the JVM, has announced that he and Thomas Enebo are becoming Sun Microsystems employees later this month with the responsibility of working on JRuby full-time!

The primary goal is to give JRuby the attention it really needs. The potential for Ruby on the JVM has not escaped notice at Sun, and so we’ll be focusing on making JRuby as complete, performant, and solid as possible. We’ll then proceed on to help build out broader tool support for Ruby, answering calls by many in the industry for a “better” or “smarter” Ruby development experience. Read More

By Peter Cooper / September 7, 2006

Flex2

Mike Potter of Adobe has posted an announcement of the release of a Ruby on Rails SDK for developing ‘Rich Internet Applications’ using Rails and Adobe’s technologies. The code has been made available on Google’s Developer Network.

The SDK includes four samples: a ‘directory explorer’, an ‘issue tracker’, a file transfer demo, and a ‘send data’ demo (appears to be a way to pipe file data from Rails into a Flex app). Derek Wischusen of the Flex on Rails blog has some more info. Read More

By Peter Cooper / September 6, 2006

Bob Silva presents a rundown of some new features due in Rails 1.2. These minor features are in addition to the full REST support and ActiveResource (supposedly not just yet), as previously covered by a multitude of blogs.

David Heinemeier Hansson says Rails 1.2 won’t be released before RailsConf Europe (in a couple of weeks’ time) but a Release Candidate may be available. Judging from previous releases, I’d personally speculate we could expect Rails 1.2 to be released in mid October, but don’t hold me to that. Read More

By Peter Cooper / September 5, 2006

Sitepointsurvey
Josh Catone looks at the results of SitePoint’s State of Web Development 2006 survey. Josh says:

According to respondents Ruby is used as a development platform by 5.31%, well behind PHP’s dominating 67.54% market penetration. However, when asked what platforms people were not currently developing for but planning to use in the next twelve months, Ruby was the answer of 24.37% of respondents!

Of more immediate interest to me is that Python only takes 2.96% of the vote and Perl has 9.79% of the vote. And in response to “What server platform(s) are you not developing for, but expect to in the next 12 months?” Ruby takes 24.37% of the vote in comparison to just 8.47% for Python. Read More

By Peter Cooper / September 5, 2006

The ‘Unofficial Ruby on Rails Blog‘ has put together a great article about how to install Ruby, Ruby on Rails, MySQL, and RMagick on Windows. It gives the ideal places to download each part from in order to avoid nasty errors, and should act as a good resource for any Windows-based developers to set up their environment. Read More

By Peter Cooper / September 5, 2006

Chris Wanstrath has put together an excellent guide to sessions in Ruby on Rails. He covers a whole ton of gotchas and features that I’d never known about before. Did you know that if you specify session :off in your application.rb that session can still be created automatically in certain situations? If not, check it out, there’s a lot of great information. Read More

By Peter Cooper / September 3, 2006

Railstat

RailStat is an open-source real-time Web site statistics package written in Ruby on Rails. It’s not particularly advanced, but covers all of the main areas and provides another quality application to the still reasonably small group of open-source Rails applications. Excellent!

(Found via the always amazing ozmm.org) Read More

By Peter Cooper / September 3, 2006

Eric Hodel has put together a great guide to optimizing Ruby code with RubyInline and ruby-prof, a code profiler.

Here’s how I optimized png.rb to make PNG saving over 100 times faster using RubyInline. This is a good model to follow to make any ruby program faster.

The basic steps are to optimizing code are:

1. Profile
2. Find the method taking the most time
3. Try one change to make it faster
4. Profile
5. Check for improvement
* No improvement? Not enough improvement? Remove your change, go to step 3
* Improvement? Go to step 1 Read More

By Peter Cooper / September 1, 2006

Johnny of Johnny’s Thoughts has put together a brief article / tutorial about implementing full text search with tagging in a Ruby on Rails application. He uses Ferret, a Ruby port of Lucene, the acts_as_ferret Rails plugin, and ActsAsTaggable. Read More

By Peter Cooper / August 31, 2006

Rakemin

One of my clients has a multi-application rollout system in place that operates on Rake tasks (Capistrano wasn’t viable). The Rake tasks are centralized with the application and need to be run from the deployment boxes. As their developers aren’t au-fait with the command line, they wanted an easy way to run Rake tasks on arbitrary applications over the Web. I decided I could write a tool to do this, and I have.. it’s called Rakemin.

It’s all AJAX, quick, and all you have to do is specify the ‘base directory’ where all of your Rails applications live, and it’ll hunt out all the projects for you. Read More

By Peter Cooper / August 31, 2006

On the back of Kevin Clark’s “Things You Shouldn’t Be Doing in Rails”, Geoffrey Grosenbach has created a plugin called ‘deprecated‘ that, with a single rake task, will alert you to all of the old and deprecated code in your application. This is perfect for bringing those old applications up to date and will help you catch all of the changes necessary, such as using flash and session instead of @flash and @session, etc.

I wonder how viable it would be to go even further and create something that could check for sloppy coding practices (rather than outdated practices) and fix spacing issues, etc. Read More

By Peter Cooper / August 31, 2006

Eric Hodel has worked out a scary way to reduce Ruby’s safe-level on the fly using a little inline C. Please don’t use this in production code, it’s just an experiment! That said, this could be a useful trick for things like Classroom and sandboxing environments. Read More

By Peter Cooper / August 31, 2006

Hotscripts

HotScripts.com, a popular destination for finding PHP and CGI scripts, has added a Ruby on Rails category. Currently only 30 resources are listed, but as one of the heavyweights in the Web developer resources industry, it’s likely to get a lot bigger soon. If you’re a developer you might want to get your stuff added while it’s still small.

(Thanks to Peter Scott for the tip-off!) Read More