Permalink
Browse files

usage and license

  • Loading branch information...
1 parent 9c396b7 commit 76800bd9da8d8c2c82114a185e283a6bbba42db8 @sr committed Jul 9, 2008
Showing with 89 additions and 3 deletions.
  1. +89 −3 README.markdown
View
@@ -3,9 +3,95 @@ QuarckQuarck
Easily creates an [AtomPub][] server through a DSL.
+Usage
+-----
-**Note:** In the spirit of "[You Are Not Your Code][yanyc]", I'll be transparent,
-share my work constantly and solicit and appreciate critiques.
+### Using AtomPub::DSL
+
+The main goal is to be as simple as possible. Thus,
+running the fellowing code will start the server
+at <http://0.0.0.0:5023/service>, served by Mongrel.
+
+ require 'atomp_pub/dsl'
+
+ server do
+ store :memory
+
+ author :name => 'Simon Rozet',
+ :email => 'simon@rozet.name'
+
+ collection do
+ title 'Articles'
+ author :name => 'John Smith'
+ end
+
+ # The global author defined at the top will be used
+ # for the fellowing collections.
+ collection :linking
+ collection :photo, 'Photography'
+ end
+
+*NOTE*: `collection` yields an `Atom::Feed` so the you can use the fellowing
+properties as well :
+
+- subtitle
+- logo
+- icon
+- contributor
+
+### Using AtomPub::Server
+
+`AtomPub::DSL` is only an interface to `AtomPub::Server`.
+You can skip the DSL completely and create a server using `AtomPub::Server` directly.
+As an example, here is a rackup file that can be used to start an AtomPub server
+served by Mongrel available at <http://0.0.0.0:5023/service> using
+`rackup my_atom_pub_server.ru -smongrel -p5023` :
+
+ require 'atom_pub/server'
+ require 'atom_pub/store/memory'
+
+ store = AtomPub::Store::Memory.new
+
+ use Rack::CommonLogger
+ use Rack::Lint
+ run AtomPub::Server.new(store)
+
+
+`AtomPub::Store::Base`
+---------------------
+
+@@ TODO
+
+
+Requirement
+-----------
+
+- atom-tools
+
+License
+-------
+
+(The MIT License)
+
+Copyright (c) 2008 Simon Rozet
+
+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 OR COPYRIGHT HOLDERS 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.
[AtomPub]: http://tools.ietf.org/html/rfc5023
- [yanyc]: http://blog.red-bean.com/sussman/?p=96

0 comments on commit 76800bd

Please sign in to comment.