public
Rubygem
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Click here to lend your support to: thin and make a donation at www.pledgie.com !
Fix Merb adapter autoloading, closes #47
macournoyer (author)
Wed Apr 02 18:59:36 -0700 2008
commit  0284f81987798e3c73b04a729e30b32592e6a49f
tree    5741c10f66b15e005861f7ba7c43bf74587923af
parent  1d1faea0401103e2d16cfb38b19d7fd133053cb5
...
21
22
23
24
 
25
26
27
...
29
30
31
32
 
33
34
35
36
37
38
39
 
 
 
 
 
 
 
 
 
 
40
41
42
 
43
44
45
 
 
46
47
48
...
21
22
23
 
24
25
26
27
...
29
30
31
 
32
33
 
 
 
 
 
 
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
50
51
52
53
54
0
@@ -21,7 +21,7 @@ module Rack
0
     def self.for(name, options={})
0
       case name.to_sym
0
       when :rails
0
-        Rails.new(options.merge(:root => options[:chdir]))
0
+        return Rails.new(options.merge(:root => options[:chdir]))
0
       
0
       when :ramaze
0
         require "#{options[:chdir]}/start"
0
@@ -29,20 +29,26 @@ module Rack
0
         Ramaze.trait[:essentials].delete Ramaze::Adapter
0
         Ramaze.start :force => true
0
 
0
-        Ramaze::Adapter::Base
0
+        return Ramaze::Adapter::Base
0
 
0
-      # FIXME not working, halp! halp!
0
-      # when :merb
0
-      #   require 'merb'
0
-      #   require "#{options[:chdir]}/config/init.rb"
0
-      #   Merb::BootLoader.run
0
-      #   Merb::Rack::Application.new
0
+      when :merb
0
+        require 'merb-core'
0
+
0
+        Merb::Config.setup(:merb_root   => options[:chdir],
0
+                           :environment => options[:environment])
0
+        Merb.environment = Merb::Config[:environment]
0
+        Merb.root = Merb::Config[:merb_root]
0
+        Merb::BootLoader.run
0
+
0
+        return Merb::Rack::Application.new
0
       
0
       when :halcyon
0
         require 'halcyon'
0
+        
0
         $:.unshift(Halcyon.root/'lib')
0
         Halcyon::Runner.load_config Halcyon.root/'config'/'config.yml'
0
-        Halcyon::Runner.new
0
+        
0
+        return Halcyon::Runner.new
0
       
0
       else
0
         raise AdapterNotFound, "Adapter not found: #{name}"

Comments