Factored out ruby interop. Eliminated compiler warnings.