[macruby-changes] [4529] ControlTower/trunk

source_changes at macosforge.org source_changes at macosforge.org
Mon Sep 20 15:45:37 PDT 2010


Revision: 4529
          http://trac.macosforge.org/projects/ruby/changeset/4529
Author:   joshua.ballanco at apple.com
Date:     2010-09-20 15:45:36 -0700 (Mon, 20 Sep 2010)
Log Message:
-----------
Update README, HACKING, and version number.

Modified Paths:
--------------
    ControlTower/trunk/HACKING.rdoc
    ControlTower/trunk/README.rdoc
    ControlTower/trunk/ext/CTParser/CTParser.h

Added Paths:
-----------
    ControlTower/trunk/sample/example_content.txt

Modified: ControlTower/trunk/HACKING.rdoc
===================================================================
--- ControlTower/trunk/HACKING.rdoc	2010-09-20 22:45:34 UTC (rev 4528)
+++ ControlTower/trunk/HACKING.rdoc	2010-09-20 22:45:36 UTC (rev 4529)
@@ -1,14 +1,14 @@
 == Hacking Control Tower
 
-Control Tower is still in very early development. It is being developed as part
-of the MacRuby project, so be sure to familiarize yourself with MacRuby's
+Control Tower is still a very young project. It is being developed as part of
+the MacRuby project, so be sure to familiarize yourself with MacRuby's
 HACKING.rdoc, as all guidelines there apply here as well. If you have any ideas
 or suggestions for improvements, please communicate them with the MacRuby
 developer's list at <macruby-devel at lists.macosforge.org>. You can also find more
 information at the MacRuby website (http://www.macruby.org/).
 
 
-== CAUTION! AVERTISSEMENT! VOORZICHTIG! 注意!
+=== CAUTION! AVERTISSEMENT! VOORZICHTIG! 注意!
 
 DO NOT EDIT http11_parser.c! THIS FILE CONTAINS MACHINE GENERATED CODE.
 N'EDITEZ PAS http11_parser.c! Ce fichier a été généré automatiquement.
@@ -20,55 +20,18 @@
 once, but editing it is not likely to ever be a good idea.
 
 
-== Sample Code
+=== Project Structure
 
-There are two samples that you can run to explore ControlTower's behavior on GET
-and POST requests located in the 'sample' directory. To use these samples, first
-build and install the Control Tower gem:
+The three components of ControlTower are:
 
-> rake gem
-> sudo macgem install pkg/control_tower-0.1-universal-darwin-10.gem
+1. The Mongrel parser. The Ragel-generated C file is wrapped by an objective C
+   class and the whole thing is collected as an extension in ext/CTParser.
 
-Then, to try a GET request, start the 'simple_hello.ru' rack-up config like so:
+2. The GCD based socket handling code. This is located in rack_socket.rb.
+   Primarily, the while loop located in the #open method on RackSocket. After
+   each connection is made, the connection is handed off to the GCD queue
+   (either serial or concurrent) for processing.
 
-> control_tower -R sample/simple_hello.ru
-
-and test it with a utility such as curl like so:
-
-> curl http://localhost:8080/
-
-This should reply with a very traditional string and a read-out of the rack
-environment generated by your request. To try a POST request, start the
-'file_upload.ru' config as above, then use curl (or similar tool) to send a post
-with some file content like so:
-
-> curl -F "file=@README.rdoc" http://localhost:8080/
-
-This command tells curl to send the file as a form parameter, and the reply
-should contain the content of the rack 'params' variable constructed from this
-parameter. In particular, when the parameter is named 'file', the
-'file_upload.ru' sample will return the contents of the file.
-
-
-== Debugging
-
-=== Environment variables
-
-Currently, there is only one environment variable specifically for debugging
-Control Tower:
-
-* CT_DEBUG: This will turn on debug logging until we get a better logger.
-
-
-== Known Issues
-
-* Error compiling Regular Expression in Rack::Request
-    Workaround: Modify line 150 in rack/request.rb like so
--          form_vars.sub!(/\0\z/, '')
-+          form_vars.slice!(-1) if form_vars[-1] == "\0"
-
-* Problem with Sinatra > 1.0 using Rack.release
-    Workaround: Modify line 39 in sinatra/base.rb like so
--    if Rack.release < '1.1'
-+    if Rack.version < '1.1'
-
+3. Interaction with the Rack app is coordinated by the Server object in
+   server.rb. Actually, the Server object handles the options hash and
+   coordinates opening and closing of the socket as well.

Modified: ControlTower/trunk/README.rdoc
===================================================================
--- ControlTower/trunk/README.rdoc	2010-09-20 22:45:34 UTC (rev 4528)
+++ ControlTower/trunk/README.rdoc	2010-09-20 22:45:36 UTC (rev 4529)
@@ -1,22 +1,39 @@
-== Control Tower
-Control Tower is a web application server for Rack-based MacRuby applications based on Apple's Grand Central Dispatch libraries.
+== ControlTower
 
-It is composed of three major components: A Grand Central Dispatch based networking layer, the Mongrel HTTP parser, and Rack web
-application interface. It is currently very much a work in progress!
+ControlTower is a web application server for Rack-based MacRuby applications
+based on Apple's Grand Central Dispatch libraries.
 
+It is composed of three major components: A Grand Central Dispatch based
+networking layer, the Mongrel HTTP parser, and a Rack web application interface.
+
+
 === Installation
-From the root directory of the project, run:
 
+ControlTower can be installed as a gem using the `macgem` command. To build and
+install from source, go to the root directory of the project and run:
+
   $ rake package
-  $ sudo macgem install pkg/control_tower-0.1-universal-darwin-10.gem
+  $ sudo macgem install pkg/control_tower-1.0-universal-darwin-10.gem
 
+
 === Usage
+
 There are currently only 4 supported command line options:
 
-* -R <rackup_config.ru> : Where you specify the Rackup config file to run
-* -h <hostname>         : Hostname for the server (Control Tower will only respond to requests to this host)
-* -p <port>             : Port # for the server
-* -c                    : Use this to enable serving requests to a GCD concurrent queue
+* -R <config.ru> : Where you specify the Rack-up config to run
+* -a <host>      : Address to bind server to (default: 0.0.0.0)
+* -p <port>      : Port on which to run the server (default: 3000)
+* -c             : Enable serving requests on a concurrent GCD queue
 
+
+=== Sample
+
+There are a collection of Rack-up configs located in the "sample" directory that
+demonstrate some features of ControlTower and MacRuby. See the README in that
+directory for more information.
+
+
 === License
-All the files in this distribution are covered under the Ruby's license (see the file COPYING).
+
+All the files in this distribution are covered under the Ruby's license (see the
+file COPYING).

Modified: ControlTower/trunk/ext/CTParser/CTParser.h
===================================================================
--- ControlTower/trunk/ext/CTParser/CTParser.h	2010-09-20 22:45:34 UTC (rev 4528)
+++ ControlTower/trunk/ext/CTParser/CTParser.h	2010-09-20 22:45:36 UTC (rev 4529)
@@ -6,8 +6,7 @@
 #include "http11_parser.h"
 #import <Foundation/Foundation.h>
 
-// TODO - We should grab this from a plist somewhere...
-#define SERVER_SOFTWARE @"Control Tower v0.1"
+#define SERVER_SOFTWARE @"Control Tower v1.0"
 
 @interface CTParser : NSObject
 {

Added: ControlTower/trunk/sample/example_content.txt
===================================================================
--- ControlTower/trunk/sample/example_content.txt	                        (rev 0)
+++ ControlTower/trunk/sample/example_content.txt	2010-09-20 22:45:36 UTC (rev 4529)
@@ -0,0 +1,3 @@
+This is a file with some content to demonstrate ControlTower's X-Sendfile functionality.
+
+See the README for more info.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100920/cb234450/attachment-0001.html>


More information about the macruby-changes mailing list