Want to stay on top? Ruby Weekly is a once-weekly e-mail newsletter covering the latest Ruby and Rails news.
     Feed Icon

Interesting Ruby Tidbits That Don’t Need Separate Posts #27

By Peter Cooper / August 3, 2009

Yep, it's the latest installment of the series of posts crammed with random Ruby links, articles, and resources:

php-logo.png

Phuby - A PHP Runtime from within Ruby

Aaron Patterson (a.k.a. tenderlove), creator of Nokogiri, has recently been working on Phuby - a library that "wraps PHP in a loving embrace." In short, Phuby exposes a PHP runtime in Ruby so you can eval stuff in PHP from Ruby, etc.

hash.png

Hash Mapper - A "Hash to Hash" Converter

The guys over at New Bamboo (a UK Rails shop - looking for a new team member, by the way..) have recently unveiled Hash Mapper, a "hash to hash" converter. They describe it as a module that "gives you a little DSL to map which keys in an input hash should map to which keys" in an output hash. Their own use case was for "translating" a messed up response from a JSON API into something more sanitized.

Sunspot - Solr-Powered Search for Ruby Objects

Sunspot describes itself well without me messing it up, so... "All the power of the Solr search engine; all the beauty of Ruby. Sunspot exposes all of Solr's most powerful search features using an API of elegant DSLs. That means robust, flexible fulltext search with no boolean queries and no string programming." Sunspot's homepage has a couple of code snippets demonstrating the overall idea. If you're not familiar with Solr, it's a stand alone search server built upon Lucene (Ferret being a Ruby port of Lucene - so Ferret == library, Solr == stand alone server).

terminal-icon-512x512.png

Mutter - A "Tiny" Ruby Command Line Interface Library

Mutter is a "tiny command-line interface library" with, supposedly, lots of style. So far its primary function is to simply produce command line output with various styles (bold, underline, blinking) and ANSI colors - no input stuff or curses type interface doodads, but for what it is, it's cute.

RubyConf 2009 Call For Proposals

RubyConf 2009 is taking place in San Francisco in November and the call for speaking proposals is now out. You might want to be quick though; you have only until August 21 to get your proposal in.

ODF-Report: Generate Open Document files with a template + data

ODF-Report is a new Ruby library for generating .odt files (OpenDocument text files - should be familiar to OpenOffice users) by substituting strings in a previously created template .odt file. The idea is that with this functionality you can use ODF-Report to automatically produce reports in an OpenDocument format.

Comments

  1. Jim Neath says:

    PHP in Ruby? Eurgh.

  2. cloudhead says:

    What I'm trying to do with mutter is a separation of style from content, ala html/css. You basically define your styles in .yml files (or inline), and then use them in various ways, like:

    `mutter.warning "the dogs are out of their cages!"

    which would be equivalent to:

    the dogs are out of their cages!

    and

    `mutter.say "the #dogs# are out of their cages!"

    would be equivalent to:

    the dogs are out of their cages!

    If you defined # as the glyph for that style.

  3. Sam Granieri says:

    +1 Jim Neath

  4. Ellen says:

    The most interesting feature I've found in ODF-Report is that you can easily edit your .odt template, using just OpenOffice.

    That way, you don't need to concern about layout and text formatting in your application. Just leave it to OpenOffice.

    Great tool!

  5. Hubert Łępicki says:

    Jim: this would probably made my life easier couple of months ago when I had to...

    ...execute some PHP scripts that generated PDF files from Ruby app. No, Prawn couldn't do what we needed. ;)

  6. Brandon says:

    Actually I think Phuby has the potential to be HUGE. I was talking about this VERY thing (and suggested the same name, or Phruby, alternately) a couple of weeks ago at work.

    The (sad?) reality is that there's a lot of software written in PHP that you might want or need to use, and there are times when you'd (or at least I'd) like to extend/test/interact with it from Ruby.

  7. farleyknight says:

    That's funny because I was working on similar functionality back in June. I wonder why this thing is so popular?

  8. Peter Cooper says:

    Please note cloudhead's post is missing some formatting that our sanitizer removes. I decided to approve the comment anyway as hopefully you'll get the idea of what he's saying even without some of the formatting.. :)

Other Posts to Enjoy

Twitter Mentions