public
Description: Run multiple framework / rack app / wathever inside the same VM
Clone URL: git://github.com/macournoyer/rack_sandbox.git
Search Repo:
macournoyer (author)
Fri Mar 21 12:51:03 -0700 2008
commit  95167f5720d92c1d2a3a02b9ba5963ac8aaa1cac
tree    7e2e5fa2883cb0730518ab567960c3e1df89d4aa
rack_sandbox / example / rails.rb
100644 21 lines (18 sloc) 0.631 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$:.unshift File.dirname(__FILE__) + '/../lib'
 
# IMPORTANT: sandbox must be loaded before rubygems!
require 'sandbox'
require 'rubygems'
require 'rack/adapter/sandboxed_rails'
require 'thin'
 
# FIXME autoload doesn't work for some reason...
require 'thin/connection'
require 'thin/request'
require 'thin/response'
 
Thin::Server.start '0.0.0.0', 3000 do
  map '/rails1' do
    run Rack::Adapter::SandboxedRails.new(:root => '/Users/marc/projects/thin/spec/rails_app', :prefix => '/rails1')
  end
  map '/rails2' do
    run Rack::Adapter::SandboxedRails.new(:root => '/Users/marc/projects/rails_app', :prefix => '/rails2')
  end
end