Changeset 225
- Timestamp:
- 04/30/07 15:04:05 (2 years ago)
- Files:
-
- trunk/Rakefile (modified) (1 diff)
- trunk/lib/merb.rb (modified) (3 diffs)
- trunk/lib/merb/core_ext/merb_object.rb (modified) (1 diff)
- trunk/lib/merb/merb_controller.rb (modified) (1 diff)
- trunk/lib/merb/merb_dispatcher.rb (modified) (1 diff)
- trunk/lib/merb/merb_upload_handler.rb (modified) (1 diff)
- trunk/lib/merb/template/haml.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Rakefile
r208 r225 16 16 17 17 NAME = "merb" 18 VERS = "0.3. 0"18 VERS = "0.3.1" 19 19 CLEAN.include ['**/.*.sw?', '*.gem', '.config'] 20 20 trunk/lib/merb.rb
r224 r225 1 1 require 'rubygems' 2 require 'mongrel' 2 if ENV['SWIFT'] 3 require 'swiftcore/swiftiplied_mongrel' 4 puts "Using Swiftiplied Mongrel" 5 elsif ENV['EVENT'] 6 require 'swiftcore/evented_mongrel' 7 puts "Using Evented Mongrel" 8 else 9 require 'mongrel' 10 end 3 11 require 'fileutils' 4 12 require 'erubis' … … 13 21 14 22 module Merb 15 VERSION='0.3. 0' unless defined?VERSION23 VERSION='0.3.1' unless defined?VERSION 16 24 class Server 17 25 class << self … … 73 81 HTTP_COOKIE = 'HTTP_COOKIE'.freeze 74 82 QUERY_STRING = 'QUERY_STRING'.freeze 75 CONTENT_TYPE_TEXT_HTML_HASH = {'Content-Type' =>'text/html'}76 83 APPLICATION_JSON = 'application/json'.freeze 77 84 TEXT_JSON = 'text/x-json'.freeze trunk/lib/merb/core_ext/merb_object.rb
r224 r225 7 7 8 8 def meta_class() class << self; self end end 9 9 10 def meta_eval(&blk) meta_class.instance_eval( &blk ) end 11 10 12 def meta_def(name, &blk) meta_eval { define_method name, &blk } end 13 11 14 def class_def name, &blk 12 15 self.class.class_eval { define_method name, &blk } trunk/lib/merb/merb_controller.rb
r224 r225 40 40 @env = MerbHash[env.to_hash] 41 41 @status, @method, @response, @headers = 200, (env[Mongrel::Const::REQUEST_METHOD]||Mongrel::Const::GET).downcase.to_sym, response, 42 Mongrel::Const::CONTENT_TYPE_TEXT_HTML_HASH42 {'Content-Type' =>'text/html'} 43 43 cookies = query_parse(@env[Mongrel::Const::HTTP_COOKIE], ';,') 44 44 querystring = query_parse(@env[Mongrel::Const::QUERY_STRING]) trunk/lib/merb/merb_dispatcher.rb
r223 r225 12 12 @@mutex = Mutex.new 13 13 @@use_mutex = ::Merb::Server.use_mutex 14 # This is where we grab the incoming request PATH_INFO14 # This is where we grab the incoming request REQUEST_URI 15 15 # and use that in the merb routematcher to determine 16 16 # which controller and method to run. trunk/lib/merb/merb_upload_handler.rb
r170 r225 6 6 end 7 7 8 HttpHandler.class_eval do 9 def request_aborted(params) 10 end 11 end 12 13 HttpRequest.class_eval do 14 def initialize_with_abort(params, socket, dispatchers) 15 initialize_without_abort(params, socket, dispatchers) 16 dispatchers.each {|d| d.request_aborted(params) if @body.nil? && d } 8 unless ENV['EVENT'] || ENV['SWIFT'] 9 HttpHandler.class_eval do 10 def request_aborted(params) 11 end 17 12 end 18 13 19 alias_method :initialize_without_abort, :initialize 20 alias_method :initialize, :initialize_with_abort 14 HttpRequest.class_eval do 15 def initialize_with_abort(params, socket, dispatchers) 16 initialize_without_abort(params, socket, dispatchers) 17 dispatchers.each {|d| d.request_aborted(params) if @body.nil? && d } 18 end 19 20 alias_method :initialize_without_abort, :initialize 21 alias_method :initialize, :initialize_with_abort 22 end 21 23 end 22 24 end trunk/lib/merb/template/haml.rb
r224 r225 33 33 @@hamls ||= {} 34 34 @@mtimes ||= {} 35 35 36 def exempt_from_layout? 36 37 false
