1 28 package org.jruby; 29 30 import org.jruby.runtime.Block; 31 import org.jruby.runtime.CallbackFactory; 32 import org.jruby.runtime.builtin.IRubyObject; 33 34 39 public class RubySignal { 40 public static void createSignal(Ruby runtime) { 41 RubyModule mSignal = runtime.defineModule("Signal"); 42 CallbackFactory cf = runtime.callbackFactory(RubySignal.class); 43 mSignal.getMetaClass().defineMethod("trap", cf.getOptSingletonMethod("trap")); 44 } 45 46 public static IRubyObject trap(IRubyObject recv, IRubyObject[] args, Block unusedBlock) { 47 recv.getRuntime().getWarnings().warning("Signal.trap: Signals is currently not implemented in JRuby and will not work"); 48 return recv.getRuntime().getNil(); 49 } 50 } | Popular Tags |