Revision: 3985 http://trac.macosforge.org/projects/ruby/changeset/3985 Author: joshua.ballanco@apple.com Date: 2010-04-30 02:57:24 -0700 (Fri, 30 Apr 2010) Log Message: ----------- Add a HACKING.rdoc Modified Paths: -------------- ControlTower/branches/gcd-ify/ext/CTParser/CTParser.m Added Paths: ----------- ControlTower/branches/gcd-ify/HACKING.rdoc Removed Paths: ------------- ControlTower/branches/gcd-ify/README Added: ControlTower/branches/gcd-ify/HACKING.rdoc =================================================================== --- ControlTower/branches/gcd-ify/HACKING.rdoc (rev 0) +++ ControlTower/branches/gcd-ify/HACKING.rdoc 2010-04-30 09:57:24 UTC (rev 3985) @@ -0,0 +1,17 @@ +== 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 +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@lists.macosforge.org>. You can also find more +information at the MacRuby website (http://www.macruby.org/). + +=== 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. Deleted: ControlTower/branches/gcd-ify/README =================================================================== --- ControlTower/branches/gcd-ify/README 2010-04-30 09:57:20 UTC (rev 3984) +++ ControlTower/branches/gcd-ify/README 2010-04-30 09:57:24 UTC (rev 3985) @@ -1,31 +0,0 @@ -== Control Tower -Control Tower 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 Rack web -application interface. It is currently very much a work in progress! - -=== Installation -From the root directory of the project, run: - - $ rake package - $ sudo macgem install pkg/control_tower-0.1-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 - -=== License -Control Tower is covered by the Ruby license. See COPYING for more details. - -=== Credits -Control Tower's parser was stolen Thin which stole it from Mongrel (http://mongrel.rubyforge.org) originially written by Zed Shaw. -Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw <zedshaw at zedshaw dot com> You can redistribute it and/or -modify it under the terms of the GPL. - -Thin is copyright Marc-Andre Cournoyer <macournoyer@gmail.com> - -Control Tower is copyright (c) 2009-2010, Apple Inc Modified: ControlTower/branches/gcd-ify/ext/CTParser/CTParser.m =================================================================== --- ControlTower/branches/gcd-ify/ext/CTParser/CTParser.m 2010-04-30 09:57:20 UTC (rev 3984) +++ ControlTower/branches/gcd-ify/ext/CTParser/CTParser.m 2010-04-30 09:57:24 UTC (rev 3985) @@ -81,7 +81,8 @@ if (colon_pos.location != NSNotFound) { serverName = [hostString substringToIndex:colon_pos.location]; serverPort = [hostString substringFromIndex:(colon_pos.location + 1)]; - } else { + } + else { serverName = [NSString stringWithString:hostString]; serverPort = @"80"; } @@ -104,7 +105,8 @@ NSMutableString *body = [environment objectForKey:@"rack.input"]; if (body != nil) { [body appendString:[[NSString alloc] initWithBytes:at length:length encoding:NSASCIIStringEncoding]]; - } else { + } + else { NSLog(@"Hmm...you seem to have body data but no where to put it. That's probably an error."); }