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

jruby.rack.rails.environment3.rb 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.
#++

require 'jruby/rack/rails_booter'

# Rails 3.x specific booter behavior.
# @see JRuby::Rack::Railtie
module JRuby::Rack::RailsBooter::Rails3Environment

  # @return [Rails::Application] the (loaded) application instance
  def to_app
    # backward "compatibility" calling #to_app without a #load_environment
    load_environment
    ::Rails.application
  end

  # Loads the Rails environment (*config/environment.rb*).
  def load_environment
    require expand_path('config/boot.rb')
    require 'jruby/rack/rails/railtie'
    require expand_path('config/environment.rb')
    require 'jruby/rack/rails/extensions3'
  end

  protected

  # The public root is set in {JRuby::Rack::Railtie}.
  def set_public_root
    # no-op here
  end

end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy