# = Nitro # # Copyright (c) 2004-2005, Navel Ltd (http://www.navel.gr) # Copyright (c) 2004-2005, George Moschovitis (http://www.gmosx.com) # # Nitro (http://www.nitrohq.com) is copyrighted free software # created and maintained by George Moschovitis (mailto:gm@navel.gr) # and released under the standard BSD Licence. For details # consult the file doc/LICENCE. require 'glue' require 'glue/logger' require 'glue/configuration' module Nitro # The version. Version = '0.29.0' # Library path. LibPath = File.dirname(__FILE__) # The path to the prototype application. setting :proto_path, :default => File.join(LibPath, '..', 'proto'), :doc => 'The path to the prototype application' # Add the src dir in the path. $LOAD_PATH.unshift File.join(LibPath, '..', 'src') # Include the Glue namespace in Nitro include Glue end #-- # gmosx: leave them here. #++ require 'nitro/context' require 'nitro/controller' require 'nitro/dispatcher' require 'nitro/render' require 'nitro/server' require 'nitro/part' unless $NITRO_NO_ENVIRONMENT # Setup up the proposed environment. You are free # to skip this if you dont like it. Just set # # $NITRO_NO_ENVIRONMENT = true # # before requiring nitro. # Put the start file dir in the path. Dir.chdir(File.dirname($0)) # Application code come here. $LOAD_PATH.unshift 'src' # Library code come here. $LOAD_PATH.unshift 'lib' end module Nitro class << self # A helper method to start a Nitro application. def run(controller = nil) Server.run(controller) end alias_method :start, :run # A helper to get the current execution mode. def mode Runner.mode end alias_method :execution_mode, :mode # A helper method. def live? Runner.mode == :live end alias_method :production?, :live? end # Cache for application scoped (global) variables. This is a # temporal store, will be moved to the actuall cache in # Server.start $global = $application = {} end # * George Moschovitis