doc/rdoc/files/README.html in Capcode-0.3.0 vs doc/rdoc/files/README.html in Capcode-0.4.0

- old
+ new

@@ -64,10 +64,11 @@ "<a href="../files/AUTHORS.html" value="File: AUTHORS">AUTHORS</a>", "<a href="../files/COPYING.html" value="File: COPYING">COPYING</a>", "<a href="../files/lib/capcode_rb.html" value="File: capcode.rb">lib/capcode.rb</a>", <a href="http://greg.rubyfr.net">nil</a>].each do<br /> <a href="../classes/Capcode.html" title="Module: Capcode">Capcode</a>.view_html<br /> +<a href="../classes/Capcode/Views.html" title="Module: Capcode::Views">Capcode::Views</a>.view_html<br /> <a href="../classes/Capcode/Helpers.html" title="Module: Capcode::Helpers">Capcode::Helpers</a>.view_html<br /> <a href="../classes/Capcode/HTTPError.html" title="Class: Capcode::HTTPError">Capcode::HTTPError</a>.view_html<br /> <a href="../classes/Capcode/RouteError.html" title="Class: Capcode::RouteError">Capcode::RouteError</a>.view_html<br /> <a href="../classes/Capcode/ParameterError.html" title="Class: Capcode::ParameterError">Capcode::ParameterError</a>.view_html<br /> end</strong> @@ -77,11 +78,11 @@ </div> <div id="README" class="page_shade"> <div class="page"> <div class="header"> - <div class="path">README / Wed Apr 29 18:53:54 +0200 2009</div> + <div class="path">README / Thu Apr 30 07:34:27 +0200 2009</div> </div> <h1><a href="../classes/Capcode.html">Capcode</a></h1> <p> Copyright (C) 2009 Gregoire Lejeune @@ -94,10 +95,19 @@ <h2>DESCRIPTION:</h2> <p> <a href="../classes/Capcode.html">Capcode</a> is a web microframework </p> <h2>FEATURES/PROBLEMS:</h2> +<h3>0.4.0</h3> +<ul> +<li>Major bug correction ! + +</li> +<li>Add views&#8230; + +</li> +</ul> <h3>0.3.0</h3> <ul> <li>Work with Rack 1.0.0 </li> @@ -137,20 +147,20 @@ end end Capcode.run( ) </pre> -<h2>Running <a href="../classes/Capcode.html">Capcode</a> Apps</h2> +<h3>Running <a href="../classes/Capcode.html">Capcode</a> Apps</h3> <ul> <li>Run: <tt>ruby sample.rb</tt> </li> <li>Visit <a href="http://localhost:3000">localhost:3000</a>/ </li> </ul> -<h2>Create model</h2> +<h3>Create model</h3> <pre> require 'rubygems' require 'capcode' require 'capcode/base/dm' # or require 'capcode/base/couchdb' @@ -165,9 +175,61 @@ </pre> <p> See <tt>examples/blog-dm.rb</tt> and/or <tt>examples/blog-couchdb.rb</tt> for complete examples. </p> +<h3>Create View</h3> +<pre> + # file: sample.rb + require 'rubygems' + require 'capcode' + + module Capcode + class Hello &lt; Route '/hello' + def get + @t = Time.now + render :time + end + end + end + + module Capcode::Views + def time + &quot;Hello world #{@t}&quot; + end + end + + Capcode.run( ) +</pre> +<h3>Create Helper</h3> +<pre> + # file: sample.rb + require 'rubygems' + require 'capcode' + + module Capcode + class Hello &lt; Route '/hello' + def get + @t = Time.now + render :time + end + end + end + + module Capcode::Helpers + def bold( &amp;b ) + &quot;&lt;b&gt;&quot;+yield+&quot;&lt;/b&gt;&quot; + end + end + + module Capcode::Views + def time + &quot;Hello world &quot; + bold { @t } + end + end + + Capcode.run( ) +</pre> <h2>REQUIREMENTS:</h2> <ul> <li>rack </li> \ No newline at end of file