Created
July 28, 2009 16:44
-
-
Save madebymany/157517 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/modules/ruby/SConscript b/modules/ruby/SConscript | |
index 5f13512..48773f3 100644 | |
--- a/modules/ruby/SConscript | |
+++ b/modules/ruby/SConscript | |
@@ -8,8 +8,8 @@ Env.Append(CPPDEFINES=('KROLL_RUBY_API_EXPORT', 1)) | |
build.add_thirdparty(Env, 'poco') | |
if build.is_osx(): | |
- Env.Append(CPPPATH=['/usr/lib/ruby/1.8/universal-darwin10.0','/usr/lib/ruby/1.8/universal-darwin9.0','/usr/lib/ruby/1.8/universal-darwin8.0',build.kroll_include_dir]) | |
- Env.Append(LIBS=['libruby']) | |
+ Env.Append(CPPPATH=['/opt/ruby19/include/ruby-1.9.0', '/opt/ruby19/include/ruby-1.9.0/i686-darwin9.4.0',build.kroll_include_dir]) | |
+ Env.Append(LIBS=['libruby19']) | |
elif build.is_linux(): | |
diff --git a/modules/ruby/ruby_module.cpp b/modules/ruby/ruby_module.cpp | |
index 90ede42..0c52ffe 100644 | |
--- a/modules/ruby/ruby_module.cpp | |
+++ b/modules/ruby/ruby_module.cpp | |
@@ -70,12 +70,11 @@ namespace kroll | |
Module* RubyModule::CreateModule(std::string& path) | |
{ | |
- rb_load_file(path.c_str()); | |
- ruby_exec(); | |
- | |
+ void *node = rb_load_file(path.c_str()); | |
+ ruby_run_node(node); | |
+ | |
// ruby_cleanup(); <-- at some point we need to call? | |
- | |
Poco::Path p(path); | |
std::string basename = p.getBaseName(); | |
std::string name = basename.substr(0,basename.length()-ruby_suffix.length()+3); | |
diff --git a/modules/ruby/ruby_utils.cpp b/modules/ruby/ruby_utils.cpp | |
index c7a16fd..00a937d 100644 | |
--- a/modules/ruby/ruby_utils.cpp | |
+++ b/modules/ruby/ruby_utils.cpp | |
@@ -22,6 +22,9 @@ namespace kroll | |
{ | |
const char *result = StringValueCStr(value); | |
return result; | |
+ } else if (TYPE(value) == T_SYMBOL) { | |
+ const char* result = rb_id2name(SYM2ID(value)); | |
+ return result; | |
} | |
return NULL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment