public final String toString() { return description(); } public static Signal valueOf(long value) {
public final String toString() { return description(); } public static Signal valueOf(long value) {
public final String toString() { return description(); } public static Signal valueOf(long value) {
@JRubyMethod(module = true) public static IRubyObject list(ThreadContext context, IRubyObject recv) { Ruby runtime = recv.getRuntime(); RubyHash names = RubyHash.newHash(runtime); for (Signal s : Signal.values()) { if (!s.description().startsWith("SIG")) continue; if (!RUBY_18_SIGNALS.contains(s.description().substring(3))) continue; // replace CLD with CHLD value long longValue = s.longValue(); if (s == Signal.SIGCLD) longValue = Signal.SIGCHLD.longValue(); // omit unsupported signals if (longValue >= 20000) continue; names.op_aset(context, runtime.newString(s.description().substring("SIG".length())), runtime.newFixnum(longValue)); } names.op_aset(context, runtime.newString("EXIT"), runtime.newFixnum(0)); return names; }
@JRubyMethod(module = true) public static IRubyObject list(ThreadContext context, IRubyObject recv) { Ruby runtime = recv.getRuntime(); RubyHash names = RubyHash.newHash(runtime); for (Signal s : Signal.values()) { if (!s.description().startsWith("SIG")) continue; if (!RUBY_18_SIGNALS.contains(s.description().substring(3))) continue; // replace CLD with CHLD value long longValue = s.longValue(); if (s == Signal.SIGCLD) longValue = Signal.SIGCHLD.longValue(); // omit unsupported signals if (longValue >= 20000) continue; names.op_aset(context, runtime.newString(s.description().substring("SIG".length())), runtime.newFixnum(longValue)); } names.op_aset(context, runtime.newString("EXIT"), runtime.newFixnum(0)); return names; }