Ejemplo n.º 1
0
 private String getClassNameFromFrame(Frame current) {
   String klazzName;
   if (current.getKlazz() == null) {
     klazzName = UNKNOWN_NAME;
   } else {
     klazzName = current.getKlazz().getName();
   }
   return klazzName;
 }
Ejemplo n.º 2
0
  // XXX: Again, screwy evaling under previous frame's scope
  public void preExecuteUnder(RubyModule executeUnderClass, Block block) {
    Frame frame = getCurrentFrame();

    pushRubyClass(executeUnderClass);
    DynamicScope scope = getCurrentScope();
    StaticScope sScope = new BlockStaticScope(scope.getStaticScope());
    sScope.setModule(executeUnderClass);
    pushScope(DynamicScope.newDynamicScope(sScope, scope));
    pushCallFrame(frame.getKlazz(), frame.getName(), frame.getSelf(), block);
    getCurrentFrame().setVisibility(getPreviousFrame().getVisibility());
  }