lib/ruby_app/templates/application/console.rb in RubyApp-0.0.91 vs lib/ruby_app/templates/application/console.rb in RubyApp-0.2.0

- old
+ new

@@ -1,16 +1,21 @@ +require 'rubygems' +require 'bundler/setup' + +require 'ruby_app' + $LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), %w[lib])) -require '_APPLICATION_DOWNCODE_/application' -require '_APPLICATION_DOWNCODE_/session' -require '_APPLICATION_DOWNCODE_/version' +require '_APPLICATION_DOWNCODE_' puts "Running #{__FILE__.inspect}" -options = { :application_class => _APPLICATION_UPCODE_::Application, - :session_class => _APPLICATION_UPCODE_::Session, - :log_path => File.join(_APPLICATION_UPCODE_::ROOT, %w[log application.log]), - :configuration_paths => File.join(_APPLICATION_UPCODE_::ROOT, %w[config.yml]), - :default_language => :en, - :translations_paths => File.join(_APPLICATION_UPCODE_::ROOT, %w[translations]) } +RubyApp::Configuration.load!([ File.join(RubyApp::ROOT, %w[configuration.yml]), + File.join(_APPLICATION_UPCODE_::ROOT, %w[configuration.yml])]) +RubyApp::Log.open! +RubyApp::Application.create! -_APPLICATION_UPCODE_::Application.create! options +at_exit do + RubyApp::Application.destroy! + RubyApp::Log.close! + RubyApp::Configuration.unload! +end