Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Multi-Purpose format plugins
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Gregory Brown  
View profile  
 More options Feb 8 2007, 6:23 pm
From: "Gregory Brown" <gregory.t.br...@gmail.com>
Date: Thu, 8 Feb 2007 18:23:54 -0500
Local: Thurs, Feb 8 2007 6:23 pm
Subject: Multi-Purpose format plugins
In trunk, I've got multi-purpose plugins working.

What they do is provide the name of your format inside of the plugin,
so that you can handle it appropriately.

You can also have something like:

def build_header
   csv { output << data.to_csv }
   text { output <<< data.join(' | ') }
end

where something like
  format_name { .. }

will only run the block if the plugin is being invoked for that format.

I also added syntactic sugar for plugin registration in the form of:
renders :csv, :for => MyRenderer

For a more comprehensive example, see the simplified code from the
grouping example I posted earlier this week.

http://pastie.caboo.se/38970

You can also see the changeset which adds these features:
http://stonecode.svnrepository.com/ruport/trac.cgi/changeset/519

I'm interested in what people think of these changes.  Once we add in
the smart hooks to the Report DSL, i figure they could be a pretty
helpful abstraction.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory Brown  
View profile  
 More options Feb 8 2007, 6:26 pm
From: "Gregory Brown" <gregory.t.br...@gmail.com>
Date: Thu, 8 Feb 2007 18:26:44 -0500
Local: Thurs, Feb 8 2007 6:26 pm
Subject: Re: Multi-Purpose format plugins
On 2/8/07, Gregory Brown <gregory.t.br...@gmail.com> wrote:

> In trunk, I've got multi-purpose plugins working.

> What they do is provide the name of your format inside of the plugin,
> so that you can handle it appropriately.

> You can also have something like:

> def build_header
>    csv { output << data.to_csv }
>    text { output <<< data.join(' | ') }

whoops,  << not <<<

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google