Skip to content

Instantly share code, notes, and snippets.

@jeremyroman
Created December 29, 2011 19:52
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 jeremyroman/1535904 to your computer and use it in GitHub Desktop.
Save jeremyroman/1535904 to your computer and use it in GitHub Desktop.
Testing Rubinius::Generator
g = Rubinius::Generator.new
g.required_args = 1
g.total_args = 1
g.local_count = 1
g.set_line 1
g.push_local 0
g.ret
g.close
g.encode
meth = g.package(Rubinius::CompiledMethod)
meth.scope = Rubinius::StaticScope.of_sender
be = Rubinius::BlockEnvironment.new
be.under_context binding.variables, meth
p be.call(6)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment