Ruport 0.2.5: Enumerable DataSets, and things that go bump i


#1

Welcome to the release of Ruport 0.2.5:
The “I’m releasing too often” edition.

What is Ruport?

Right now, Ruport is alpha software, but it is already useful. It is
both a report generation and formatting framework AND a reporting
library that aims to make talking to database FOO and
outputting in format BAR trivial. You can even talk to things that
aren’t databases, like CSV files. You have a choice of using the
ruport application to automate a lot of your work, or using the
library to implement your own application based on it. That part is
up to you.

Ruport currently can take a query and talk to any Database DBI
supports, and return you a DataSet, which can do neat things, like
easily output a CSV or an HTML table and even email them trivially.
This functionality will be expanded greatly in coming releases.

Who is this new rcanieso guy?

I’m no longer all out on my lonesome with Ruport.
Say hello to Robert Canieso, our new maintainer
of the Ruport::Format module.

About 0.2.5

Well folks, the new stuff here is actually quite useful, despite the
fact that I have not yet updated the ruport-example package to show
off the shiny new features. In previous versions, I was using
Report::DataSet and Report::DataRows as these sort of pseudo
Enumerable messes. No more!

now:

query “SELECT * FROM FOO” do |data|
@report = data.map { |row| row[“name”] } .join(" | ")
end

will work just fine! This again, goes in the category of I should
have read the modules chapter of the pickaxe earlier.

Unfortunately, for those who were using the more low level
Report::Engine#select
or Report::Engine#execute which returned DBI::Row objects… this
feature has gone away in Ruport 0.2.5

Report::Engine#query is now your one stop shop, and it will continue
to be improved in newer releases.

We’ve also begun work on Ruport::Format and now support html and csv
output.

See the CHANGELOG for the rest.

Where do I get it?

Ruport is a gem.

on most *nix, it’s probably just:

sudo gem install ruport

on windows, it’s probably:

gem install ruport

You can also rake your own gem, or work directly with the source by
downloading one of the packaged releases (available as zip, gzip,
bzip2, gem):

http://rubyforge.org/frs/?group_id=856&release_id=3543

How do I use this thing?!?

If you want to use the ruport executable, first start by typing:

ruport generate my_project_name

to create a little directory structure to work on. Then edit
config/ruport.yaml
and populate it with DB / Email info. Then start writing your
templates.

Oh… don’t know how to do that? There is a set of examples at:

http://rubyforge.org/frs/?group_id=856&release_id=3481

which you can just unzip and then follow the PDF walkthrough.

Two Caveats:

  1. The new features in 0.2.5 are not in this walkthrough yet, I will
    release ruport-example 0.2.4 some time this week.

  2. There has been some concern about the artwork on the front page of
    the manual. It was the result of me searching wikipedia for stove
    when looking for suitable “cookbook” artwork.
    But the confusion it is causing will have it removed from the next
    version of the walkthrough, possibly replaced with a nice big slab of
    chunky bacon

You can also use the API documentation (which is not illustrated and
sadly patchy in parts)
http://ruport.rubyforge.org/docs/

Or read the source directly.

Or email me on or off list, because I need the feedback!

Minor Complaint:

the 1.8.3 / 1.8.4pre1 bug with RubyGems / RubyForge is a nightmare!
I had to rebuild everything… and then I had to update version
numbers…
and whine and cry about it. Please release the fix to the public as
soon as you can!

-Greg


#2

On 11/16/05, Gregory B. removed_email_address@domain.invalid wrote:

aren’t databases, like CSV files. You have a choice of using the
ruport application to automate a lot of your work, or using the
library to implement your own application based on it. That part is
up to you.

Ruport currently can take a query and talk to any Database DBI
supports, and return you a DataSet, which can do neat things, like
easily output a CSV or an HTML table and even email them trivially.
This functionality will be expanded greatly in coming releases.

Have you seen IBM’s Directory Integrator at all? It’s sort of a any
format to any format tool which is quite useful. It’s used a lot to
pull stuff out of a database, save it to a csv, then input it to a
LDAP directory, etc. It strikes me that this seems as if it could
have a similar scope. Cool stuff.


#3

On 11/19/05, swille removed_email_address@domain.invalid wrote:

Have you seen IBM’s Directory Integrator at all? It’s sort of a any
format to any format tool which is quite useful. It’s used a lot to
pull stuff out of a database, save it to a csv, then input it to a
LDAP directory, etc. It strikes me that this seems as if it could
have a similar scope. Cool stuff.

I haven’t seen that, but yes, the number one goal of Ruport is to act
as a bridge between various databases and data sources as well as many
different output formats.

The main idea is that Ruport will make it so similar but incompatible
systems will be able to talk, without pain. This way, you can focus
on the reporting, not the bridgework.

Thanks for pointing this out, I’ll look into it :slight_smile:


#4

On 11/27/05, Tom A. removed_email_address@domain.invalid wrote:

Consider the functionality of Jasper Reports - it’s a java-based,
industrial strength open-source report writer. Replicating these
features in Ruby, with YAML specs instead of XML, would be a killer app!!!

Check it out… http://jasperreports.sourceforge.net/

With all these great libraries to steal from, Ruport should be on top
in no time! :slight_smile:

Seriously though, that looks interesting, thanks for the link.

To anyone who’s offered suggestions, I greatly appreciate them, and
have tucked them in a special place within my heart.

As soon as I burn through the rather massive TODO list Ruport is
accumulating, I will definitely do a ‘best of’ pruning of other
libraries :slight_smile:


#5

Consider the functionality of Jasper Reports - it’s a java-based,
industrial strength open-source report writer. Replicating these
features in Ruby, with YAML specs instead of XML, would be a killer
app!!!

Check it out… http://jasperreports.sourceforge.net/

Tom