= Halcyon == JSON Server App Framework Halcyon is a JSON Web App Server Framework built on Rack for speed and light weight. For more information, check out our website at http://halcyon.rubyforge.org/ or go straight to the RDocs: http://halcyon.rubyforge.org/doc/ === Announcement Not quite a planned release, but enough improvements were made to warrant it. It is however primarily a minor update with no new features other than testing profile and initial specs. Still, stay tuned for release 0.4.0 which should occur in the next few weeks, adding support for Analogger, daemonization and cluster management, thorough testing, more examples, and some improvements to signal handling! Release Name: halcyon-0.3.22 Notes: This is a relatively minor update with a focus on improving code quality and structure, documentation, and specification/testing. Halcyon is now releasing to the wild for public testing version 0.3.22. Changes: * Reorganized the Base exception component and updated all dependent code. * Added initial specifications for the Router, errors and exceptions, and the server base functionality and behavior. * Simplified the testing process for acceptable requests which now triggers only when not in testing or debugging modes. * Added a profile for testing so Specs can run without having a handler running (which has been tested by Rack's specs) and to adjust settings as appropriate similar to the debugging profile. * Moved the cleanup process into its own method to destroy the PID file and close the logger cleanly so that it may also be executed by the testing hooks at the end of the process (terminating naturally). * Adjusted URI parsing to default to PATH_INFO if REQUEST_URI is not available (primarily a fix for Rack::MockRequest). * Updated documentation to reflect changes. == Dependencies NOTE: The JSON dependency is now recorded as the json_pure gem in the Gem spec and will only automatically install that gem. To get faster parsing and better performance, manually install the json gem with "gem install json". This was done to support platforms that wouldn't natively build the JSON extensions. Internally the JSON extensions are given precedence, though it fails gracefully and will use the pure Ruby JSON gem. * Rack >= 0.2.0 * JSON >= 1.1.1 * Merb >= 0.4.0 Halcyon is built on top of Rack for swift delivery of very small informational payloads transmitted through JSON. Merb routes are employed to make designing app structures easier with routes. = From the Readme == Quick start There's not much to Halcyon. I've put a good deal of time into fleshing out the RDocs so check out the documentation and the example directory. Halcyon is the sister project of Aurora SAS, a simple authentication server to manage authentication, session management, and user roles and permissions. It is still very early in development (as Halcyon was a prerequisite) but there should be some interesting code from that project to let you see just what Halcyon is capable. Stay tuned! == Installing with RubyGems A Gem of Halcyon is available. You can install it with: $ sudo gem install halcyon $ sudo gem install json == Usage The halcyon command will assist you for running the server. Just run: $ halcyon -d -p 3800 example/simple You may need to cd into the project directory, or, alternatively, you can cp the files out into your tmp folder and work from there. If you'd like to just cd, +gem which halcyon+ will tell you where to find the Gem directory. Once you've gotten the server running, pull open your browser, point it to localhost:3800/ and see what happens. Take a look at the source and try to access the other routes and see how things work. Notice the response in the browser. Once you've familiarized yourself with that, kill the server (Ctl+C) and start it again without the debugging switch: -d. (+halcyon -h+ for usage help.) $ halcyon -p 3800 example/simple Now pull it up again in the browser. You'll notice right away that it blocks all access from any user agent that doesn't meet its requirements (but debug mode disabled that feature). The good news about that is that it reduces a lot of the garbage signals that a normal server might have to endure, but since we're working with specialized applications, it's perfectly reasonable to be very stingy about who we talk to. Now, pull up IRB and require RubyGems and Halcyon (as halcon/client). Now run the following: >> require 'example/simple.client' >> s = Simple.new('http://localhost:3800') >> s.greet("Matt") >> s.get("/hello/Matt") >> s.url_for('greet', :name => 'John') And that is some very simple stuff you can do with the Client library. The Client library is meant to be used in larger applications where a fraction of functionality requires smaller and faster updates or quicker responses in a lightweight protocol, perfect for sending authentication information (over secure channels, of course) or getting updates on various monitoring sources. Read more in the RDocs, there's a lot more there to find out. The best way to learn, though, is to play, and I like to play, so, go for it. == Contact Please mail bugs, suggestions and patches to <chiology / gmail.com>. You are also welcome to join the #halcyon channel on irc.freenode.net. Our website is up so stop by and check out what's going down. Our address is http://halcyon.rubyforge.org/. On there you will find information about our mailing list as well, so do stop by. == License and Copyright Copyright (C) 2007 Matt Todd <purl.org/net/maraby>. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. == Links Halcyon: <halcyon.rubyforge.org/> Aurora: <aurora.rubyforge.org/> Rack: <rack.rubyforge.org/> JSON: <json.rubyforge.org/> Matt Todd: <maraby.org/>