-1

I'm working in a new Rails engine and I need to restart it while testing. Of I try Dummy::Application.initialize! it do not work because the application was already initialized, so Rails returned the same instance.

I need to do so my engine after_initialize block runs again>

Matt Briggs
  • 41,224
  • 16
  • 95
  • 126
stJhimy
  • 19
  • 2

1 Answers1

1

I do not believe that Rails::Application has any (at least publicly accessible) method for restarting the stack. Your best way (and what I do) is just exit the server process (Control + C) and rails s the server back up.

If that is not what you are talking about, please be more specific on the error and situation you are in.

ref: http://railsapi.com/doc/rails-v3.0.7/classes/Rails/Application.html

colinross
  • 2,075
  • 13
  • 10
  • I'm testing if the middleware stack contains a specific Middleware, and this middleware to be loaded depends on a txt file on the rails root, so i need to be able to initialize! again the application to test with or without the txt file, got it ? – stJhimy May 24 '11 at 02:09
  • The middleware should already be loaded by the time `initialize!` is hit so that should be able to flag which strategy to execute for your own Application-level. – colinross May 24 '11 at 07:35