# File lib/gherkin/native/therubyracer.rb, line 22 def initialize(js, *args) cxt = V8::Context.new cxt['module'] = {} # Mimic Node.js / Firebug console.log cxt['console'] = STDOUT def STDOUT.log(*a) puts sprintf(*a.map(&:to_s)) end cxt.load(js) @js_obj = cxt['module']['exports'].new(*args) end
# File lib/gherkin/native/therubyracer.rb, line 36 def method_missing(name, *args) a = args.map{|a| a.respond_to?(:to_hash) ? a.to_hash : a} @js_obj.__send__(name, *a) end