mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add 'app' accessor to script/console as an instance of Integration::Session
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3717 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
491554f6dd
commit
7056fc6782
3 changed files with 16 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Add 'app' accessor to script/console as an instance of Integration::Session [Jamis Buck]
|
||||
|
||||
* Generator::Base#usage takes an optional message argument which defaults to Generator::Base#usage_message. [Jeremy Kemper]
|
||||
|
||||
* Remove the extraneous AR::Base.threaded_connections setting from the webrick server. [Jeremy Kemper]
|
||||
|
|
|
@ -11,6 +11,7 @@ end
|
|||
|
||||
libs = " -r irb/completion"
|
||||
libs << " -r #{RAILS_ROOT}/config/environment"
|
||||
libs << " -r console_app"
|
||||
libs << " -r console_sandbox" if options[:sandbox]
|
||||
|
||||
ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'development'
|
||||
|
|
13
railties/lib/console_app.rb
Normal file
13
railties/lib/console_app.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
require 'action_controller/integration_test'
|
||||
|
||||
# work around the at_exit hook in test/unit, which kills IRB
|
||||
Test::Unit.run = true
|
||||
|
||||
def app(create=false)
|
||||
@app_integration_instance = nil if create
|
||||
unless @app_integration_instance
|
||||
@app_integration_instance = ActionController::Integration::Session.new
|
||||
@app_integration_instance.host! "www.example.test"
|
||||
end
|
||||
@app_integration_instance
|
||||
end
|
Loading…
Reference in a new issue