[picocontainer-dev] Re: Ruby writer for PWR servlet

Paul Hammant <[email protected]> Sun, 8 Feb 2009 10:05:05 -0800
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Well Jean's stuff is all committed now.

If folks want to try it out,

    1) checkout & build pico from trunk
    2) svn https://svn.codehaus.org/picocontainer/java/2.x/trunk/web/
    3) cd web
    4) mvn -Pexamples clean install
    5) cd examples/jquery-email
    6) mvn clean jetty:run-war
    7) surf to app, click on the json links at the bottom, oberwrite / 
json/ in url with /ruby/

eg.

http://localhost:8080/remoting-jqueryemail-webapp/json/Inbox/read?msgId=1 
    gives .......

{
   "id": 1,
   "from": "J Query",
   "to": "Gil Bates",
   "subject": "Nice Example",
   "message": "Very nice example application you've created",
   "sentTime": "2009-02-08T09:33:28.259-08:00",
   "read": true
}

http://localhost:8080/remoting-jqueryemail-webapp/ruby/Inbox/read?msgId=1 
    gives .......

{
   :id => 1,
   :from => "J Query",
   :to => "Gil Bates",
   :subject => "Nice Example",
   :message => "Very nice example application you've created",
   :sentTime => "2009-02-08T09:33:28.259-08:00",
   :read => true
}


Regards,

- Paul

On Feb 8, 2009, at 7:47 AM, [email protected] wrote:

> I think that as the Ruby writer is a copy of the JSON one, a better  
> port would be to add parameters that give the hash map [key, value]  
> symbol and the syntax for the key.
>
> (1) In JS the colon ':' sign is used, while Ruby uses '=>'.
> (2) Ruby prefers 'symbols' to strings for the hash map key.
>
> <JSON>
>   "name": "John"
> <Ruby version would be>
>   :name => "John"
>
> Regards,
> Jean
>
>> Jean Lazarou has written a XStream writer for PWR that serializes  
>> to a
>> Ruby fragments (builder style).  It works with PWR, but maybe needs  
>> to
>> migrate back to the XStream team for general reuse.
>>
>> Fantastic stuff.
>>
>> Regards,
>>
>> - Paul
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email