Archive for June, 2008

Ruby Hoedown Speakers Announced

Jeremy McAnally has just announced the talks that we’ll be seeing at this year’s Ruby Hoedown, and it’s a really great-looking lineup:

  • Giles Bowkett will be speaking about Archaeopteryx, a Ruby-based system for auto-generating, self-modifying music. I’ve heard nothing but rave reviews of this project, which Giles has previously spoken about at GoRuCo and the MountainWest Ruby Conference.
  • Gregg Pollack and Jason Seifer (of RailsEnvy blog and podcast fame) will be speaking about a number of the most useful, ingenious and innovative developments to come out of the Ruby community over the past year. If you saw Gregg and Jason in the MVC Public Service Announcement videos at RailsConf, you know that this is bound to be an entertaining presentation.
  • Rick Bradley will be speaking about the problem of transforming a Ruby application that doesn’t have any tests into one that’s well-spec’d and has good test coverage. I’m especially looking forward to hearing this talk!
  • Rein Henrichs is the author of an upcoming book on Ruby best practice patterns (inspired by Kent Beck’s Smalltalk Best Practice Patterns book) and he’ll be speaking about that, with examples from the book.
  • Robert Dempsey will be speaking on how to employ Ruby in “cloud computing” applications, via services like Amazon.com’s Elastic Compute Cloud (EC2) and Simple Storage Service (S3). This is another talk that I’m looking forward to, given all of the recent development in this area.
  • Joe Kutner will be speaking about Ruleby, a rule engine for Ruby. If you’ve never used a rule engine before, you may be surprised to learn how this declarative style of programming can complement the procedural Ruby code that you’re used to.
  • Finally, Troy Davis will take a look at different APIs you can use to develop Ruby applications that can interact with phone calls to varying degrees (via platforms like Asterisk and FreeSWITCH).

In addition, we’ll have a Charity Tutorial Breakfast session during which Jim Weirich and Joe O’Brien will discuss the use of mock objects in testing. Sounds good, right? If you haven’t registered yet, get to it! The Hoedown will be held August 8 and 9 in Huntsville, Alabama. We’re looking forward to seeing you there!

Easy Charts in FXRuby with the Google Chart API

InfoQ has just published an article written by Matthew Bass that introduces the Google Chart API and the gchartrb library, which you can use to programmatically generate URLs for use with Google Chart. It’s very easy to use this library to generate charts in your FXRuby applications. First, install the gchartrb gem:

$ sudo gem install gchartrb
You’ll need to poke around the gchartrb documentation to decide just what kinds of charts are supported; for this example, we’ll just use a bar chart example from Matthew’s article:

def bar_chart
  GoogleChart::BarChart.new('600x200', 'My Chart', :vertical) do |bc|
    bc.data 'Trend 1', [5,4,3,1,3,5], '0000ff'
    bc.data 'Trend 2', [1,2,3,4,5,6], 'ff0000'
    bc.data 'Trend 3', [6,5,4,4,5,6], '00ff00'
  end
end

The toescapedurl method for the BarChart object returns a URL from which we can retrieve the chart image data in PNG format. We can in turn use that data to construct an FXPNGImage, and place it inside an FXImageFrame:

FXImageFrame.new(self, nil, :opts => LAYOUT_FILL) do |f|
  f.image = FXPNGImage.new(app, open(bar_chart.to_escaped_url, "rb").read)
end

The result is a nice little bar chart, as shown here:

google_charts_demo.png

For reference, here’s the complete program: