ratpoison-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RP] PATCH - simplify Ruby bindings generation


From: Doug Kearns
Subject: [RP] PATCH - simplify Ruby bindings generation
Date: Thu Dec 2 21:21:02 2004
User-agent: Mutt/1.4i

This simplifies the Ruby bindings a little.

Regards,
Doug

Index: contrib/genrpbindings
===================================================================
RCS file: /cvsroot/ratpoison/ratpoison/contrib/genrpbindings,v
retrieving revision 1.6
diff -u -r1.6 genrpbindings
--- contrib/genrpbindings       2 Dec 2004 00:33:22 -0000       1.6
+++ contrib/genrpbindings       3 Dec 2004 05:09:27 -0000
@@ -25,7 +25,7 @@
 #
 # #!ruby
 # require "ratpoison"
-# Ratpoison.echo ("hello world")
+# Ratpoison::echo("hello world")
 #
 # ;;; Common Lisp
 # (load "ratpoison.lisp")
@@ -84,10 +84,10 @@
 
   RATPOISON="$RATPOISON"
 
-  def command (command, *args)
-    return `#{RATPOISON} -c "#{command} #{args.join(' ')}"`
+  def method_missing(command, *args)
+    return `#{RATPOISON} -c "#{command.id2name} #{args.join(' ')}"`
   end
-  module_function :command
+  module_function :method_missing
 PREAMBLE
 
 # Scheme preamble
@@ -141,10 +141,6 @@
              print PERL "sub $1 { return command (\"$1\", address@hidden); }";
              print ELISP "(defun-ratpoison $1)";
              print COMMONLISP "(defun-ratpoison $1)";
-             print RUBY "  def $1 (*args)";
-             print RUBY "    return command (\"$1\", args)";
-             print RUBY "  end";
-             print RUBY "  module_function :$1\n";
            }
        }
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]