Picture of stu

Streamlined on JRuby on Rails

  • Posted By Stuart Halloway on September 27, 2006

I am giving a Streamlined talk tonight at the NovaRUG, and I am giving a JRuby talk next week at the Atlanta No Fluff, Just Stuff symposium. I sense a chocolate-and-peanut-butter opportunity here…

(2 hours pass)

Success. Following Charles’s instructions here, I got JRuby, Rails, and a Rails scaffold up and running without major incident. Streamlined, however, balked at the code generation phase. I posted a question on the jruby-user list, and within minutes had the answer from Charles: the following syntax is not OK in JRuby, and apparently will be removed from Ruby 2.0 as well:

    opt.on("--authentication=auth_lib",
    "Use authentication, and choose library (AAA)") {|options[:auth_lib]| }

A quick regexp replace to this form did the trick:

    opt.on("--authentication=auth_lib",
    "Use authentication, and choose library (AAA)") { |val| options[:auth_lib] = val }

[Note: Typo mentioned in the comments has been fixed. Thanks Jim.]

Streamlined (trunk or 0.0.6) now runs on JRuby on Rails. Bring on those funky enterprise databases!

Comments
  1. Mike HSeptember 27, 2006 @ 03:35 PM
    Could you explain the syntax problem a bit? Those two forms don't look obviously equivalent to me. Of course a situation could exists where a method did different things for blocks of different arity, making those two forms equivalent, but it's unclear to me from the example.
  2. Jim WeirichSeptember 27, 2006 @ 06:01 PM
    Those two forms don't look obviously equivalent to me. I suspect there is a typo in the code. Probably the first one should have vertical bars surrounding the options[:auth_lib] in the code block, relying on an implicit assignment to the options[:auth_lib] to initialize it.
  3. Bala ParanjSeptember 28, 2006 @ 08:23 AM
    I enjoyed your presentation. The Authentication plugin you were talking about, is this the right link: http://svn.techno-weenie.net/projects/plugins/acts_as_authenticated The name of this plugin is acts_as_authenticated. I also need some help on using Zentest. Is there anyone in NovaRUG who can help me with this? I am willing to pay for instructions on how to use all the features in Zentest. Please contact me at bparanj at gmail. TIA
  4. Stuart HallowayOctober 04, 2006 @ 06:07 AM
    Jim is exactly right, the first form has a typo. Will fix it.