ruby-style 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/LICENSE +1 -1
  2. data/README +10 -2
  3. data/lib/style.rb +3 -2
  4. metadata +3 -3
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007-2008 Jeremy Evans <code@jeremyevans.net>
1
+ Copyright (c) 2007-2009 Jeremy Evans <code@jeremyevans.net>
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
data/README CHANGED
@@ -233,6 +233,13 @@ $LOAD_PATH that uses Mongrel to run camping):
233
233
  | ---
234
234
  | :port: 3301
235
235
  | :adapter: my_camping_app
236
+ | :environment:
237
+ | RACK_ENV: production
238
+
239
+ One important thing to note from the example above is that you can specify
240
+ an :environment key in the config file that should be a hash. If it is
241
+ provided, the hash under it will be added to the environment before
242
+ the child processes are loaded.
236
243
 
237
244
  == How restarting works
238
245
 
@@ -323,7 +330,7 @@ same filename, without the directory:
323
330
 
324
331
  Adapter handling was simplified in 1.2.0. Because there is no easy script
325
332
  that loads rails, there is still a rails adapter. However, for all other
326
- framaworks you would want to use, just specify the file you want to require
333
+ frameworks you would want to use, just specify the file you want to require
327
334
  as the adapter. This simplifies things and allows you to specify your
328
335
  adapter file on the command line:
329
336
 
@@ -376,7 +383,8 @@ To:
376
383
 
377
384
  Q: Does this run on Windows?
378
385
 
379
- A: No. Among other things, style uses fork, which is not available on Windows.
386
+ A: Only using debug mode (--debug, -D). All other modes use fork, which isn't
387
+ supported on Windows.
380
388
 
381
389
  Q: Does it work with Capistrano yet?
382
390
 
@@ -20,7 +20,7 @@ class Style
20
20
  # Configure style
21
21
  def initialize
22
22
  @config = {:pidfile=>'style.pid', :number=>1, :port=>9999,
23
- :fork=>1, :bind=>'127.0.0.1',
23
+ :fork=>1, :bind=>'127.0.0.1', :environment=>{},
24
24
  :cliconfig=>{}, :killtime=>2, :config=>'style.yaml',
25
25
  :logfile=>'style.log', :children=>{},:sockets=>{},
26
26
  :adapter_config=>{}, :directory=>'.', :debug=>false,
@@ -277,8 +277,9 @@ class Style
277
277
  end rescue nil
278
278
  end
279
279
 
280
- # Load the relevant handler and adapter and run the server
280
+ # Update the environment from the config file and load the relevant handler and adapter and run the server
281
281
  def run_child
282
+ config[:environment].each{|k,v| ENV[k.to_s] = v.to_s}
282
283
  load_handler
283
284
  load_adapter
284
285
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-style
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Evans
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-07-06 00:00:00 -07:00
12
+ date: 2009-05-28 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  requirements: []
57
57
 
58
58
  rubyforge_project: ruby-style
59
- rubygems_version: 1.0.1
59
+ rubygems_version: 1.3.1
60
60
  signing_key:
61
61
  specification_version: 2
62
62
  summary: Supervised TCPServer, Yielding Listeners Easily