Skip to content

Instantly share code, notes, and snippets.

@intractable
Created March 19, 2012 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save intractable/2126721 to your computer and use it in GitHub Desktop.
Save intractable/2126721 to your computer and use it in GitHub Desktop.
by-hand linkage against librubinius.a/so
// #include <rubinius/environment.hpp>
#include <vm/environment.hpp>
#include <iostream>
using namespace rubinius;
int main(int argc, char** argv) {
Environment env(argc, argv);
env.setup_cpp_terminate();
try {
const char* runtime = getenv("RBX_RUNTIME");
if(!runtime) runtime = RBX_RUNTIME;
env.run_from_filesystem(runtime);
} catch(std::runtime_error& e) {
std::cout << "Runtime exception: " << e.what() << std::endl;
} catch(...) {
std::cout << "Unknown exception detected." << std::endl;
}
env.halt(env.state);
return env.exit_code(env.state);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment