about summary refs log tree commit homepage
path: root/lib/rainbows.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-03 13:24:26 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-03 13:24:26 -0700
commit8edb6c7e5aeed022f224f163dddf02bc4468da91 (patch)
tree7458e070fa0922fefa06a4cd5ee1b18cc072548b /lib/rainbows.rb
parent05e96fe3a3487eac65721dde3655269226269d9b (diff)
downloadrainbows-8edb6c7e5aeed022f224f163dddf02bc4468da91.tar.gz
This allows the server to be configured by doing something like
this inside an existing Unicorn configuration file:

  Rainbows! do
    use :Revactor
    worker_connections 50
  end

This should make it obvious we're using Rainbows-only features.
Diffstat (limited to 'lib/rainbows.rb')
-rw-r--r--lib/rainbows.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb
index cb08ca3..f79c1e8 100644
--- a/lib/rainbows.rb
+++ b/lib/rainbows.rb
@@ -1,10 +1,14 @@
 # -*- encoding: binary -*-
 require 'unicorn'
 
+def Rainbows!(&block)
+  block_given? or raise ArgumentError, "Rainbows! requires a block"
+  Rainbows::HttpServer.setup(block)
+end
+
 module Rainbows
 
   require 'rainbows/const'
-  require 'rainbows/configurator'
   require 'rainbows/http_server'
   require 'rainbows/http_response'