Hi,

I just got the latest hobix version from CVS and regen stumbles over this change in bin\hobix:

http://rubyforge.org/cgi-bin/viewcvs.cgi/hobix/bin/hobix.diff?r1=1.14&r2=1.15&cvsroot=hobix

I've put some traces and it looks similar to the problem I had previously with expand_path on Windows and the drive letter.

In particular this line (hobix:77):
   hobix_weblog = URI::parse( cmdline.config['weblogs'][ weblog ] )

On my configuration:

   cmdline.config['weblogs'][ weblog ] is Z:/projects/not-yet/hobix.yaml

and after the parse call:

   hobix_weblog.scheme is Z

Since this seems to be used to call things like "http_post_remote" and also uses the scheme itself as fallback ("http"), I think it could be modified as follows with no ill effect (not tested!!!):

--- D:\apps\ruby\bin\hobix.original    2005-07-25 13:37:10.000000000 +-0100
+++ D:\apps\ruby\bin\hobix    2005-07-25 13:37:47.000000000 +-0100
@@ -56,17 +56,18 @@
    unless cmdline.config['weblogs'].has_key? weblog
        puts "*** no weblog `#{ weblog }' found in your configuration."
        puts "*** type `hobix help' and check your spelling."
        exit
    end
    hobix_weblog = URI::parse( cmdline.config['weblogs'][ weblog ] )
-    if hobix_weblog.scheme
-        mname = "#{ hobix_weblog.scheme }_#{ cmd }_remote"
+    scheme = hobix_weblog.scheme
+ if scheme and cmdline.methods.detect { |m| m =~ /^#{scheme}/} + mname = "#{ scheme }_#{ cmd }_remote"
        unless cmdline.respond_to? mname
            opts.unshift cmd
-            mname = hobix_weblog.scheme
+            mname = scheme
        end
    else
hobix_weblog = Hobix::Weblog.load( cmdline.config['weblogs'][ weblog ] )
        mname = "#{ cmd }_action"
    end
    opts.unshift hobix_weblog

This double checks that there us any "http*" method at all in the commandline object before proceeding. The other way I can think of is to maintain a list of supported scheme's in commandline, but that's dulplicating information.

Would it have been a posibility to include the "remote" stuff as a separate config variable that has to be used explicitly?

Cheers,
Ernesto.
_______________________________________________
Hobix-is-the-way mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/hobix-is-the-way

Reply via email to