Sha256: 824d52dad06d187f2227bded45c7065640636646e61952437c82be015910d0b8

Contents?: true

Size: 1007 Bytes

Versions: 28

Compression:

Stored size: 1007 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
			$LOAD_PATH << "#{RAILS_FRAMEWORK_ROOT}/railties/lib"
		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

28 entries across 28 versions & 5 rubygems

Version Path
rockdog-passenger-0.0.1 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/passenger-2.2.15/test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.15 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.14 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.13 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.12 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
colouringcode-passenger-0.2 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.11 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-jmazzi-2.2.10 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.10 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-jmazzi-2.2.9 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.9 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.8 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
colouringcode-passenger-0.1 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.7 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.6 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.5 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.3 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.2.4 test/stub/vendor_rails/minimal/railties/lib/initializer.rb
passenger-2.0.3 test/stub/vendor_rails/minimal/railties/lib/initializer.rb