Sha256: 8f4005c87e60a1381cb71a6856be3d46996235f9167d58d4a779fd9378973b32

Contents?: true

Size: 1.96 KB

Versions: 1

Compression:

Stored size: 1.96 KB

Contents

# = Nitro 
#
# Copyright (c) 2004-2006, George Moschovitis (http://www.gmosx.com)
# Copyright (c) 2004-2006, Navel Ltd (http://www.navel.gr)
#
# Nitro (http://www.nitroproject.org) 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.30.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/global'
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

  $global = $application = Global
  
end


# * George Moschovitis <gm@navel.gr>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.30.0 lib/nitro.rb