Sha256: dbe4c7d9b7ecf6adf725b0b39c9f9a0513446b9ebff889495d16ab9c8b852e9a

Contents?: true

Size: 951 Bytes

Versions: 2

Compression:

Stored size: 951 Bytes

Contents

RAILS_FRAMEWORK_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../..")

module Rails
	class Initializer
		attr_accessor :configuration
		
		def self.run(action = :boot)
			inst = self.new
			if inst.respond_to?(action)
				inst.send(action)
			end
		end
		
		def initialize
			@configuration = Configuration.new
		end
		
		def boot
			set_load_path
			load_environment
		end
		
		def load_environment
			require "#{RAILS_FRAMEWORK_ROOT}/activesupport/lib/active_support"
			require "#{RAILS_FRAMEWORK_ROOT}/actionpack/lib/action_controller"
		end
		
		def set_load_path
			if defined?(RAILS_ROOT)
				$LOAD_PATH << "#{RAILS_ROOT}/app/controllers"
			end
		end
	
	protected
		class Configuration
			attr_accessor :log_path
			attr_accessor :default_log_path
			
			def initialize
				@log_path = @default_log_path = 'foo.log'
			end
		end
	end
	
	module VERSION
		MAJOR = 2
		MINOR = 0
		TINY = 0
		STRING = [MAJOR, MINOR, TINY].join('.')
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
passenger-2.0.1 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.0.2 test/stub/vendor_rails/minimal/railties/lib/initializer.rb