[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Need Ruby expertise to fix SvnClientTest::test_cleanup

From: Malcolm Rowe <malcolm-svn-dev_at_farside.org.uk>
Date: 2006-07-04 18:17:02 CEST

On Tue, Jul 04, 2006 at 04:36:03PM +0100, Max Bowsher wrote:
> When a svn_error_t whose constant happens to be the first in its
> category (i.e., its apr_err equals one of the CATEGORY_START constants),
> Ruby thinks it has a FOO_CATEGORY_START error, not whatever the real
> error is.
>
> This is causing SvnClientTest::test_cleanup to fail.
>
> Someone needs to fix the "Ext::Core.constants.each do |const_name|" loop
> in svn/error.rb to ignore constants ending with _CATEGORY_START. Since I
> do not know any Ruby, that someone cannot be me.
>

I don't know any Ruby either, but this seems simple enough.
Does this work?

Index: subversion/bindings/swig/ruby/svn/error.rb
===================================================================
--- subversion/bindings/swig/ruby/svn/error.rb (revision 20417)
+++ subversion/bindings/swig/ruby/svn/error.rb (working copy)
@@ -7,6 +7,7 @@
 
     Ext::Core.constants.each do |const_name|
       if /^SVN_ERR_(.*)/ =~ const_name
+ next if /^SVN_ERR_.*_CATEGORY_START$/ =~ #{$1}
         value = Ext::Core.const_get(const_name)
         module_eval(<<-EOC, __FILE__, __LINE__)
           class #{$1} < Error

Or does the second regex destroy the value of $1 obtained from the
grouping in the first regex?

Regards,
Malcolm

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 4 18:17:35 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.