summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-05-04 23:42:07 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2011-05-04 23:42:07 +0200
commite4baccaefd209a25daa3ff8d5277fe86aca1d379 (patch)
treeeb2744b7a8624a7538cb0224d40879074c819653 /tools
parent3974ea1fb3734cbf4150c759eebdf8a93d77dc8b (diff)
downloadffi-efl-e4baccaefd209a25daa3ff8d5277fe86aca1d379.zip
ffi-efl-e4baccaefd209a25daa3ff8d5277fe86aca1d379.tar.gz
FFI are in separate namespaces (Efl::Evas::Native), ruby classes are in upper level (Efl::Evas)seperate-natives
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genruby.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/genruby.rb b/tools/genruby.rb
index 4177447..497a855 100755
--- a/tools/genruby.rb
+++ b/tools/genruby.rb
@@ -2,7 +2,7 @@
# -*- coding: UTF-8 -*-
#
path = File.dirname __FILE__
-lib_path = File.join path, '..', 'lib', 'efl', 'ffi'
+lib_path = File.join path, '..', 'lib', 'efl', 'native'
#
# header, module name, fct prefix, lib
libraries = [
@@ -25,7 +25,7 @@ libraries = [
[ 'Elementary.h', 'Elm', 'elm', 'libelementary-ver-pre-svn-09.so.0', 'elementary.rb' ],
]
#
-INDENT=' '*8
+INDENT=' '*12
#
HEADER =<<-EOF
#! /usr/bin/env ruby
@@ -37,16 +37,19 @@ module Efl
#
module MNAME
#
- extend Efl::FFIHelper
- #
def self.method_missing m, *args, &block
sym = 'FCT_PREFIX_'+m.to_s
- raise NameError.new "\#{self.name}.\#{sym} (\#{m})" if not self.respond_to? sym
- self.module_eval "def self.\#{m} *args, &block; r=self.\#{sym}(*args); yield r if block_given?; r; end"
- self.send sym, *args, &block
+ raise NameError.new "\#{self.name}.\#{sym} (\#{m})" if not Efl::MNAME::Native.respond_to? sym
+ self.module_eval "def self.\#{m} *args, &block; r=Efl::MNAME::Native.\#{sym}(*args); yield r if block_given?; r; end"
+ self.send m, *args, &block
end
+ #
+ module Native
+ #
+ extend Efl::FFIHelper
EOF
FOOTER =<<-EOF
+ end
end
end
#