Sha256: beac836ed604a13a6a3fd70b0582feaa08c6e059b658b7c1827969fd5423124f

Contents?: true

Size: 1.47 KB

Versions: 1

Compression:

Stored size: 1.47 KB

Contents

require 'rubygems'
require 'mongrel'
require 'fileutils'
require 'erubis'
require 'logger'

module Merb
  VERSION='0.0.7' unless defined?VERSION
  class Server
    def self.config
      @@merb_opts ||= {}
    end  
  end
end

class MerbControllerError < RuntimeError; end

MERB_FRAMEWORK_ROOT = File.dirname(__FILE__)

begin
  require 'thread'
  require 'fastthread'
  puts 'Using FastThread'
rescue LoadError
  require 'mutex_hotfix'
end

begin
  require 'fjson'
  puts "using fjson"
rescue LoadError
  require 'json'
end

MERB_ROOT = Merb::Server.config[:merb_root] || Dir.pwd
DIST_ROOT = Merb::Server.config[:dist_root] || Dir.pwd+'/dist'

MERB_LOGGER = Logger.new("#{MERB_ROOT}/log/merb.log")
# DEBUG < INFO < WARN < ERROR < FATAL < UNKNOWN
MERB_LOGGER.level = case (Merb::Server.config[:log_level].downcase rescue '')
                    when 'debug' 
                      Logger::DEBUG
                    when 'info'  
                      Logger::INFO
                    when 'warn' 
                      Logger::WARN
                    when 'error'  
                      Logger::ERROR
                    when 'fatal' 
                      Logger::FATAL
                    when 'unknown'  
                      Logger::UNKNOWN
                    else                        
                      Logger::INFO
                    end  
                      
lib = File.join(File.dirname(__FILE__), 'merb')
Dir.entries(lib).sort.each {|fn| require File.join(lib, fn) if fn =~ /\.rb$/}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
merb-0.0.7 lib/merb.rb