[MacRuby-devel] MacRuby and XML-RPC

Stéphane Wirtel stephane.wirtel at gmail.com
Mon Mar 30 22:48:45 PDT 2009


Thank you for the workaround and the patch.

It works

Stephane
On 31 Mar 2009, at 05:05, Matt Aimonetti wrote:

> There you go:
>
> $ macirb
> >> require 'rexml/xmltokens'
> => true
> >> module REXML
> >>   class Attribute
> >>     include ::REXML::XMLTokens
> >>   end
> >> end
> => REXML::Attribute
> >> require "xmlrpc/client"
> => true
> >> server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common",  
> 8069)
> => ##-<XMLRPC::Client:0x8003c33e0 @host="tiny.my.odoo.com", @path="/ 
> xmlrpc/common", @cookie=nil, @user=nil, @port=8069, @password=nil,  
> @use_ssl=false, @auth=nil, @create=nil, @http=#<#<Class:#<Net::HTTP: 
> 0x8003bff00>> tiny.my.odoo.com:8069 open=false>,  
> @http_last_response=nil, @proxy_port=nil, @parser=nil, @timeout=30,  
> @http_header_extra=nil, @proxy_host=nil>
> >> puts server.call("about")
>
>
> OpenERP is an ERP+CRM program for small and medium businesses.
>
> The whole source code is distributed under the terms of the
> GNU Public Licence.
>
> (c) 2003-TODAY, Fabien Pinckaers - Tiny sprl
> => nil
>
>
> I added the tiny patch to the bug tracker so other people can use  
> this workaround and get rexml working.
> I'm sure there a obj-c XML-RPC client we could wrap in a macruby  
> specfic lib, rexml is pretty awful :(
>
> - Matt
>
>
>
>
> On Mon, Mar 30, 2009 at 3:16 PM, Stéphane Wirtel <stephane.wirtel at gmail.com 
> > wrote:
> Thank you so much,
>
> If you send me your patch, I send it to a friend of mine, because we  
> want to start this project for the next week.
>
> Regards,
>
> Stephane
>
> On 31 Mar 2009, at 00:11, Matt Aimonetti wrote:
>
> If I can find 5 minutes tonight, I'll try to write a quick work  
> around patch for you so you can start working on your project and  
> not wait for Macruby to be fixed.
>
> - Matt
>
>
> On Mon, Mar 30, 2009 at 2:51 PM, Stéphane Wirtel <stephane.wirtel at gmail.com 
> > wrote:
> http://www.macruby.org/trac/ticket/134
>
> Thank you
>
> But I hope this bug will be resolved because I want to implement a  
> native cocoa client for the OpenERP project
>
> On 30 Mar 2009, at 23:22, Matt Aimonetti wrote:
>
> Could you please create a ticket for this bug, it looks like a  
> constant is being called before being defined. It might be related  
> to the load order in MacRuby (wild guess).
>
> - Matt
>
> On Mon, Mar 30, 2009 at 2:02 PM, Stéphane Wirtel <stephane.wirtel at gmail.com 
> > wrote:
> Hi all,
>
> I am trying to create a small xml-rpc client with macruby, but I got  
> this error.
>
> stargate:test_ruby stephane$ ./client.rb
> /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ruby/ 
> 1.9.1/rexml/attribute.rb:18:in `<class:Attribute>': uninitialized  
> constant REXML::Attribute::NAME_STR (NameError)
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/rexml/attribute.rb:9:in `<module:REXML>'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/rexml/attribute.rb:4:in `<top (required)>'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/rexml/element.rb:3:in `require'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/rexml/element.rb:3:in `<top (required)>'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/rexml/document.rb:1:in `require'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/rexml/document.rb:1:in `<top (required)>'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/xmlrpc/parser.rb:700:in `require'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/xmlrpc/parser.rb:700:in `initialize'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/xmlrpc/utils.rb:48:in `new'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/xmlrpc/utils.rb:48:in `parser'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/xmlrpc/client.rb:421:in `call2'
>      from /Library/Frameworks/MacRuby.framework/Versions/0.4/usr/lib/ 
> ruby/1.9.1/xmlrpc/client.rb:410:in `call'
>      from ./client.rb:6:in `<main>'
>
>
> Here is the source code of my small client
>
> #!/usr/local/bin/macruby
>
> require "xmlrpc/client"
>
> server = XMLRPC::Client.new("tiny.my.odoo.com", "/xmlrpc/common",  
> 8069)
> puts server.call("about")
>
> This code works fine with the standard ruby.
>
> So, I have downloaded the trunk version and I will try to fix this  
> bug, and make a patch.
>
> Regards,
>
> Stephane
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> Stéphane Wirtel
> stephane.wirtel at gmail.com
>
>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> Stéphane Wirtel
> stephane.wirtel at gmail.com
>
>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Stéphane Wirtel
stephane.wirtel at gmail.com





More information about the MacRuby-devel mailing list