console_app.rb

Path: vendor/rails/railties/lib/console_app.rb
Last Update: Wed Oct 12 18:49:11 +0000 2011

Required files

active_support/test_case   action_controller  

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 9
 9: def app(create=false)
10:   @app_integration_instance = nil if create
11:   @app_integration_instance ||= new_session do |sess|
12:     sess.host! "www.example.com"
13:   end
14: 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 18
18: def new_session
19:   session = ActionController::Integration::Session.new
20:   yield session if block_given?
21:   session
22: end

reloads the environment

[Source]

    # File vendor/rails/railties/lib/console_app.rb, line 25
25: def reload!
26:   puts "Reloading..."
27:   Dispatcher.cleanup_application
28:   Dispatcher.reload_application
29:   true
30: end

[Validate]