Module: Oasis::Development

Extended by:
Development
Included in:
Development
Defined in:
lib/oasis/development.rb

Instance Method Summary collapse

Instance Method Details

#configure!(config = nil) ⇒ Object

this block of code is responsible for making sure that while in development mode, Rails will treat anything it considers a “rails engine”, will completely reload everything in app/ and lib/ within itself.



8
9
10
11
12
13
14
15
# File 'lib/oasis/development.rb', line 8

def configure!(config = nil)
  config ||= Rails.configuration if defined? Rails
  config.after_initialize do
    app_names = Oasis.apps.collect { |app| Regexp.escape(app.name) }.join("|")
    load_once_paths = ActiveSupport::Dependencies.load_once_paths.dup.reject { |path| path =~ /\/#{app_names}\// }
    ActiveSupport::Dependencies.load_once_paths = load_once_paths
  end
end