ruby-style 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README CHANGED
@@ -29,7 +29,7 @@ Subversion access is available at svn://code.jeremyevans.net/ruby-style/.
29
29
  * Supports both command line and yaml config file configuration
30
30
  * Is easily extensible to support running other frameworks and protocols other
31
31
  than the included ones (Rails, Ramaze, and a generic adapter; SCGI, Mongrel,
32
- and Evented Mongrel)
32
+ Thin, and Evented Mongrel)
33
33
 
34
34
  == Running and configuration
35
35
 
@@ -204,6 +204,15 @@ Example Rails+SCGI style.yaml that has four listeners on port 8912:
204
204
  | :maxconns: 10
205
205
  | :environment: production
206
206
 
207
+ Configuration for running Rails with Thin on ports 3456-3459 with one
208
+ listener on each port:
209
+
210
+ | ---
211
+ | :port: 3456
212
+ | :number: 4
213
+ | :adapter: rails
214
+ | :handler: thin
215
+
207
216
  Very simple configuration that runs Ramaze+Evented Mongrel in unsupervised
208
217
  mode on port 3000.
209
218
 
@@ -4,7 +4,22 @@ require 'rubygems'
4
4
  class Style
5
5
  # Initialzes Rails and Mongrel with the appropriate environment and settings.
6
6
  def run
7
- config[:handler] == 'scgi' ? run_rails_scgi : run_rails_mongrel
7
+ if config[:handler] == 'scgi'
8
+ run_rails_scgi
9
+ elsif config[:handler] == 'thin'
10
+ run_rails_thin
11
+ else
12
+ run_rails_mongrel
13
+ end
14
+ end
15
+
16
+ def run_rails_thin
17
+ options = {:environment=>'production', :address=>config[:bind],
18
+ :port=>config[:sockets][$STYLE_SOCKET], :pid=>'/dev/null',
19
+ :log=>'/dev/null', :timeout=>Thin::Server::DEFAULT_TIMEOUT,
20
+ :max_persistent_conns=>Thin::Server::DEFAULT_MAXIMUM_PERSISTENT_CONNECTIONS,
21
+ :max_conns=>Thin::Server::DEFAULT_MAXIMUM_CONNECTIONS}.merge(config[:adapter_config])
22
+ Thin::Controllers::Controller.new(options).start
8
23
  end
9
24
 
10
25
  def run_rails_scgi
@@ -0,0 +1,3 @@
1
+ require 'rubygems'
2
+ require 'style/handler/eventmachine'
3
+ require 'thin'
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.4
3
3
  specification_version: 1
4
4
  name: ruby-style
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.1.1
7
- date: 2008-02-23 00:00:00 -08:00
6
+ version: 1.1.2
7
+ date: 2008-02-28 00:00:00 -08:00
8
8
  summary: Supervised TCPServer, Yielding Listeners Easily
9
9
  require_paths:
10
10
  - lib
@@ -36,6 +36,7 @@ files:
36
36
  - lib/style/handler/scgi.rb
37
37
  - lib/style/handler/eventmachine.rb
38
38
  - lib/style/handler/evented_mongrel.rb
39
+ - lib/style/handler/thin.rb
39
40
  - lib/style/adapter/ramaze.rb
40
41
  - lib/style/adapter/rails.rb
41
42
  - lib/style/adapter/generic.rb