Skip to content

@nasser /a.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Rubinius Embed Example
puts __FILE__
def salad
"caesar"
end
foo
puts salad
puts __FILE__
puts "This is file b"
#include "embed.h"
int main(int argc, char** argv) {
rbx_ctx rbx = rbx_create_context();
printf("** rbx_require_file\n");
rbx_require_file(rbx, "req.rb");
printf("\n** rbx_eval_file\n");
rbx_eval_file(rbx, "a.rb");
printf("\n** rbx_eval_file\n");
rbx_eval_file(rbx, "b.rb");
printf("\n** rbx_eval\n");
rbx_eval(rbx, "puts 'Hello, World!';10.times { |i| puts \"Hello, W#{'o' * (i+2)}rld!\" }");
rbx_close_context(rbx);
return 0;
}
def foo
puts "foo method called"
end
puts "#{__FILE__} required"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.