Sha256: 4030b434fb6f7e6616f87bb5ab72175d09addd642d48d0eb8c62f4ea92fc9f8c

Contents?: true

Size: 1021 Bytes

Versions: 26

Compression:

Stored size: 1021 Bytes

Contents

require 'rubygems'
require 'bundler/setup'

require 'fileutils'

module RubyApp
  require 'ruby_app/configuration'
  require 'ruby_app/log'
  require 'ruby_app/mixins'
  require 'ruby_app/version'

  class Application
    extend RubyApp::Mixins::ConfigurationMixin
    extend RubyApp::Mixins::DelegateMixin

    attr_reader :options, :environment

    def initialize
      @environment = {}
    end

    def self.get
      @@_application ||= nil
    end

    def self.create!
      @@_application = ( Kernel.eval(RubyApp::Application.configuration._class) ).new
    end

    def self.destroy!
      @@_application = nil
    end

    def self.create_context!(configuration_paths = [File.join(RubyApp::ROOT, %w[configuration.yml])])
      RubyApp::Configuration.load!(configuration_paths)
      RubyApp::Log.open!
      RubyApp::Application.create!
      begin
        yield
      ensure
        RubyApp::Application.destroy!
        RubyApp::Log.close!
        RubyApp::Configuration.unload!
      end
    end

  end

end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
RubyApp-0.5.40 lib/ruby_app/application.rb
RubyApp-0.5.39 lib/ruby_app/application.rb
RubyApp-0.5.38 lib/ruby_app/application.rb
RubyApp-0.5.37 lib/ruby_app/application.rb
RubyApp-0.5.36 lib/ruby_app/application.rb
RubyApp-0.5.35 lib/ruby_app/application.rb
RubyApp-0.5.34 lib/ruby_app/application.rb
RubyApp-0.5.33 lib/ruby_app/application.rb
RubyApp-0.5.32 lib/ruby_app/application.rb
RubyApp-0.5.31 lib/ruby_app/application.rb
RubyApp-0.5.30 lib/ruby_app/application.rb
RubyApp-0.5.29 lib/ruby_app/application.rb
RubyApp-0.5.28 lib/ruby_app/application.rb
RubyApp-0.5.23 lib/ruby_app/application.rb
RubyApp-0.5.18 lib/ruby_app/application.rb
RubyApp-0.5.17 lib/ruby_app/application.rb
RubyApp-0.5.16 lib/ruby_app/application.rb
RubyApp-0.5.15 lib/ruby_app/application.rb
RubyApp-0.5.14 lib/ruby_app/application.rb
RubyApp-0.5.13 lib/ruby_app/application.rb