All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jruby.rack.rails.RailsRackApplicationFactory Maven / Gradle / Ivy

Go to download

A servlet bridge for (Ruby-based) Rack applications that allow them to run in Java Application servers using JRuby.

There is a newer version: 1.2.2
Show newest version
/*
 * Copyright (c) 2010-2012 Engine Yard, Inc.
 * Copyright (c) 2007-2009 Sun Microsystems, Inc.
 * This source code is available under the MIT license.
 * See the file LICENSE.txt for details.
 */

package org.jruby.rack.rails;

import org.jruby.Ruby;
import org.jruby.rack.DefaultRackApplicationFactory;
import org.jruby.runtime.builtin.IRubyObject;

/**
 *
 * @author nicksieger
 */
public class RailsRackApplicationFactory extends DefaultRackApplicationFactory {
    @Override
    public IRubyObject createApplicationObject(Ruby runtime) {
        runtime.evalScriptlet("load 'jruby/rack/boot/rails.rb'");
        runtime.evalScriptlet("JRuby::Rack::RailsBooter.load_environment");
        return createRackServletWrapper(runtime, "run JRuby::Rack::RailsBooter.to_app");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy