// Path: ext/com/cognitect/transit/ruby/TransitTypeConverter.java
// public class TransitTypeConverter {
//     private static final List<String> specialString = Arrays.asList("NaN", "Infinity", "-Infinity");
// 
//     public static boolean needsCostomConverter(Object o) {
//         if ((o instanceof String) && specialString.contains((String)o)) {
//             return true;
//         } else {
//             return false;
//         }
//     }
// 
//     public static IRubyObject convertStringToFloat(Ruby runtime, Object o) {
//         String str = (String)o;
//         if ("NaN".equals(str)) {
//             return runtime.newFloat(Double.NaN);
//         } else if ("Infinity".equals(str)) {
//             return runtime.newFloat(Double.POSITIVE_INFINITY);
//         } else if ("-Infinity".equals(str)) {
//             return runtime.newFloat(Double.NEGATIVE_INFINITY);
//         } else {
//             return runtime.getNil();
//         }
//     }
// }


import org.jruby.Ruby;
import org.jruby.RubyArray;
import org.jruby.javasupport.JavaUtil;
import org.jruby.runtime.builtin.IRubyObject;
import com.cognitect.transit.ArrayReader;
import com.cognitect.transit.ruby.TransitTypeConverter;
// Copyright 2014 Cognitect. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.cognitect.transit.ruby.unmarshaler;



public class RubyArrayReader implements ArrayReader<RubyArray, IRubyObject, Object> {
    private Ruby runtime;

    public RubyArrayReader(Ruby runtime) {
        this.runtime = runtime;
    }

    @Override
    public RubyArray add(RubyArray array, Object item) {
        IRubyObject value;
// Path: ext/com/cognitect/transit/ruby/TransitTypeConverter.java
// public class TransitTypeConverter {
//     private static final List<String> specialString = Arrays.asList("NaN", "Infinity", "-Infinity");
// 
//     public static boolean needsCostomConverter(Object o) {
//         if ((o instanceof String) && specialString.contains((String)o)) {
//             return true;
//         } else {
//             return false;
//         }
//     }
// 
//     public static IRubyObject convertStringToFloat(Ruby runtime, Object o) {
//         String str = (String)o;
//         if ("NaN".equals(str)) {
//             return runtime.newFloat(Double.NaN);
//         } else if ("Infinity".equals(str)) {
//             return runtime.newFloat(Double.POSITIVE_INFINITY);
//         } else if ("-Infinity".equals(str)) {
//             return runtime.newFloat(Double.NEGATIVE_INFINITY);
//         } else {
//             return runtime.getNil();
//         }
//     }
// }


// Path: ext/com/cognitect/transit/ruby/unmarshaler/RubyArrayReader.java
import org.jruby.Ruby;
import org.jruby.RubyArray;
import org.jruby.javasupport.JavaUtil;
import org.jruby.runtime.builtin.IRubyObject;
import com.cognitect.transit.ArrayReader;
import com.cognitect.transit.ruby.TransitTypeConverter;

// Copyright 2014 Cognitect. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS-IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
// implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.cognitect.transit.ruby.unmarshaler;



public class RubyArrayReader implements ArrayReader<RubyArray, IRubyObject, Object> {
    private Ruby runtime;

    public RubyArrayReader(Ruby runtime) {
        this.runtime = runtime;
    }

    @Override
    public RubyArray add(RubyArray array, Object item) {
        IRubyObject value;
        if (TransitTypeConverter.needsCostomConverter(item)) {