console_app.rb

Path: vendor/rails/railties/lib/console_app.rb
Last Update: Wed Nov 19 14:28:38 +0000 2008

Required files

action_controller/integration  

Methods

app   new_session   reload!  

Public Instance methods

reference the global "app" instance, created on demand. To recreate the instance, pass a non-false value as the parameter.

[Source]

    # File vendor/rails/railties/lib/console_app.rb, line 8
 8: def app(create=false)
 9:   @app_integration_instance = nil if create
10:   @app_integration_instance ||= new_session do |sess|
11:     sess.host! "www.example.com"
12:   end
13: end

create a new session. If a block is given, the new session will be yielded to the block before being returned.

[Source]

    # File vendor/rails/railties/lib/console_app.rb, line 17
17: def new_session
18:   session = ActionController::Integration::Session.new
19:   yield session if block_given?
20:   session
21: end

reloads the environment

[Source]

    # File vendor/rails/railties/lib/console_app.rb, line 24
24: def reload!
25:   puts "Reloading..."
26:   dispatcher = ActionController::Dispatcher.new($stdout)
27:   dispatcher.cleanup_application
28:   dispatcher.reload_application
29:   true
30: end

[Validate]