class method self.run

Ruby on Rails 2.3.18

Since v2.3.18 Last seen in v2.3.18

Signature

self.run(lock = @@default_lock)

No documentation comment.

Parameters

lock opt = @@default_lock
Source
# File actionpack/lib/action_controller/reloader.rb, line 30
    def self.run(lock = @@default_lock)
      lock.lock
      begin
        Dispatcher.reload_application
        status, headers, body = yield
        # We do not want to call 'cleanup_application' in an ensure block
        # because the returned Rack response body may lazily generate its data. This
        # is for example the case if one calls
        #
        #   render :text => lambda { ... code here which refers to application models ... }
        #
        # in an ActionController.
        #
        # Instead, we will want to cleanup the application code after the request is
        # completely finished. So we wrap the body in a BodyWrapper class so that
        # when the Rack handler calls #close during the end of the request, we get to
        # run our cleanup code.
        [status, headers, BodyWrapper.new(body, lock)]
      rescue Exception
        lock.unlock
        raise
      end
    end

Defined in actionpack/lib/action_controller/reloader.rb line 30 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::Reloader

Type at least 2 characters to search.

↑↓ navigate · open · esc close