lib/ruby-app/environment.rb in ruby-app-0.1.9 vs lib/ruby-app/environment.rb in ruby-app-0.1.10

- old
+ new

@@ -33,14 +33,10 @@ Bundler.require(App.bundler_group, "#{App.bundler_group}_#{App.env}") if App.bundler_group # for free usless data from bundler and gems GC.start -unless defined?(Rake) - App.logger.info "Loading #{App.name}[#{App.env}] ..." -end - # default config from app require File.join(App.root, %w{config config}) # Load configs from yaml CommonConfig.load(File.join(App.root, %w{config config.yml})) @@ -48,20 +44,24 @@ # configs from app for env begin require File.join(App.root, %W( config environments #{App.env})) rescue LoadError - raise "unknown env #{App.env}" + raise "unknown env #{App.env}" end # unshift lib app # $:.unshift(File.join(App.root, 'lib')) +unless defined?(Rake) + App.logger.info "Loading #{App.name}[#{App.env}] ..." +end + ActiveSupport::Dependencies::autoload_paths << File.join(App.root, 'lib') # unshift dirs app dirs = Dir[File.join(App.root, %w{app *})] -dirs.each do |a| +dirs.each do |a| $:.unshift(a) ActiveSupport::Dependencies::autoload_paths << a end # load initializers from other gems