Skip to content

Instantly share code, notes, and snippets.

@yokolet
Created February 18, 2010 16:46
Show Gist options
  • Save yokolet/307821 to your computer and use it in GitHub Desktop.
Save yokolet/307821 to your computer and use it in GitHub Desktop.
ManyVarsDynamicScope getManyVarsDynamicScope(Ruby runtime, int depth) {
ManyVarsDynamicScope scope;
ThreadContext context = runtime.getCurrentContext();
DynamicScope currentScope = context.getCurrentScope();
String[] names4Injection = container.getVarMap().getLocalVarNames();
if (names4Injection == null || names4Injection.length == 0) {
scope =
new ManyVarsDynamicScope(new EvalStaticScope(currentScope.getStaticScope()), currentScope);
} else {
scope =
new ManyVarsDynamicScope(new EvalStaticScope(currentScope.getStaticScope(), names4Injection), currentScope);
}
return scope;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment