Пример #1
0
 @Override
 public IRubyObject set(IRubyObject value) {
   runtime
       .getWarnings()
       .warnOnce(ID.SAFE_NOT_SUPPORTED, "SAFE levels are not supported in JRuby");
   return RubyFixnum.zero(runtime);
 }
Пример #2
0
 private RubyString getCorrectKey(IRubyObject key, ThreadContext context) {
   RubyString originalKey = key.convertToString();
   RubyString actualKey = originalKey;
   Ruby runtime = context.runtime;
   if (Platform.IS_WINDOWS) {
     // this is a rather ugly hack, but similar to MRI. See hash.c:ruby_setenv and similar in MRI
     // we search all keys for a case-insensitive match, and use that
     RubyArray keys = super.keys();
     for (int i = 0; i < keys.size(); i++) {
       RubyString candidateKey = keys.eltInternal(i).convertToString();
       if (candidateKey
           .casecmp(context, originalKey)
           .op_equal(context, RubyFixnum.zero(runtime))
           .isTrue()) {
         actualKey = candidateKey;
         break;
       }
     }
   }
   return actualKey;
 }
Пример #3
0
 @Override
 public IRubyObject get() {
   return RubyFixnum.zero(runtime);
 }