instiki/vendor/plugins/erubis-2.6.5/doc-api/files/README_txt.html

247 lines
5.7 KiB
HTML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>File: README.txt</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
<script type="text/javascript">
// <![CDATA[
function popupCode( url ) {
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
}
function toggleCode( id ) {
if ( document.getElementById )
elem = document.getElementById( id );
else if ( document.all )
elem = eval( "document.all." + id );
else
return false;
elemStyle = elem.style;
if ( elemStyle.display != "block" ) {
elemStyle.display = "block"
} else {
elemStyle.display = "none"
}
return true;
}
// Make codeblocks hidden by default
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
// ]]>
</script>
</head>
<body>
<div id="fileHeader">
<h1>README.txt</h1>
<table class="header-table">
<tr class="top-aligned-row">
<td><strong>Path:</strong></td>
<td>README.txt
</td>
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Jul 20 19:09:23 +0900 2009</td>
</tr>
</table>
</div>
<!-- banner header -->
<div id="bodyContent">
<div id="contextContent">
<div id="description">
<h1>README</h1>
<table>
<tr><td valign="top">release:</td><td>2.6.5
</td></tr>
<tr><td valign="top">copyright:</td><td>copyright(c) 2006-2009 kuwata-lab.com all rights reserved.
</td></tr>
</table>
<h2>About <a href="../classes/Erubis.html">Erubis</a></h2>
<p>
<a href="../classes/Erubis.html">Erubis</a> is an implementation of eRuby.
It has the following features.
</p>
<ul>
<li>Very fast, almost three times faster than <a
href="../classes/ERB.html">ERB</a> and even 10% faster than eruby
</li>
<li>Multi-language support (Ruby/PHP/C/Java/Scheme/Perl/Javascript)
</li>
<li>Auto escaping support
</li>
<li>Auto trimming spaces around &#8217;&lt;% %&gt;&#8217;
</li>
<li>Embedded pattern changeable (default &#8217;&lt;% %&gt;&#8217;)
</li>
<li>Enable to handle Processing Instructions (PI) as embedded pattern (ex.
&#8217;&lt;?rb &#8230; ?&gt;&#8217;)
</li>
<li>Context object available and easy to combine eRuby template with YAML
datafile
</li>
<li>Print statement available
</li>
<li>Easy to extend and customize in subclass
</li>
<li>Ruby on Rails support
</li>
</ul>
<p>
<a href="../classes/Erubis.html">Erubis</a> is implemented in pure Ruby. It
requires Ruby 1.8 or higher. <a href="../classes/Erubis.html">Erubis</a>
now supports Ruby 1.9.
</p>
<p>
See doc/users-guide.html for details.
</p>
<h2>Installation</h2>
<ul>
<li>If you have installed RubyGems, just type <tt>gem install erubis</tt>.
<pre>
$ sudo gem install erubis
</pre>
</li>
<li>Else install <a href="http://rubyforge.org/projects/abstract/">abstract</a>
at first, and download erubis_X.X.X.tar.bz2 and install it by setup.rb.
<pre>
$ tar xjf abstract_X.X.X.tar.bz2
$ cd abstract_X.X.X/
$ sudo ruby setup.rb
$ cd ..
$ tar xjf erubis_X.X.X.tar.bz2
$ cd erubis_X.X.X/
$ sudo ruby setup.rb
</pre>
</li>
<li>(Optional) It is able to merge &#8216;lib/**/*.rb&#8217; into
&#8216;bin/erubis&#8217; by &#8216;contrib/inline-require&#8217; script.
<pre>
$ tar xjf erubis_X.X.X.tar.bz2
$ cd erubis_X.X.X/
$ cp /tmp/abstract_X.X.X/lib/abstract.rb lib
$ unset RUBYLIB
$ contrib/inline-require -I lib bin/erubis &gt; contrib/erubis
</pre>
</li>
</ul>
<h2>Ruby on Rails Support</h2>
<p>
<a href="../classes/Erubis.html">Erubis</a> supports Ruby on Rails. All you
have to do is to add the following code into your
&#8216;config/environment.rb&#8217; and restart web server.
</p>
<pre>
require 'erubis/helpers/rails_helper'
#Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby
#Erubis::Helpers::RailsHelper.init_properties = {}
#Erubis::Helpers::RailsHelper.show_src = nil
</pre>
<p>
If Erubis::Helpers::RailsHelper.show_src is ture, <a
href="../classes/Erubis.html">Erubis</a> prints converted Ruby code into
log file (&#8216;log/development.log&#8217; or so). It is useful for debug.
</p>
<h2>Exploring Guide</h2>
<p>
If you are exploring Eruby, see the following class at first.
</p>
<ul>
<li><a href="../classes/Erubis/TinyEruby.html">Erubis::TinyEruby</a>
(erubis/tiny.rb) &#8212; the most simple eRuby implementation.
</li>
<li><a href="../classes/Erubis/Engine.html">Erubis::Engine</a>
(erubis/engine.rb) &#8212; base class of Eruby, Ephp, Ejava, and so on.
</li>
<li><a href="../classes/Erubis/Eruby.html">Erubis::Eruby</a>
(erubis/engine/eruby.rb) &#8212; engine class for eRuby.
</li>
<li><a href="../classes/Erubis/Converter.html">Erubis::Converter</a>
(erubis/converter.rb) &#8212; convert eRuby script into Ruby code.
</li>
</ul>
<h2>Benchmark</h2>
<p>
&#8216;benchmark/erubybenchmark.rb&#8217; is a benchmark script of <a
href="../classes/Erubis.html">Erubis</a>. Try &#8216;ruby
erubybenchmark.rb&#8217; in benchmark directory.
</p>
<h2>License</h2>
<p>
MIT License
</p>
<h2>Author</h2>
<p>
makoto kuwata &lt;kwa(at)kuwata-lab.com&gt;
</p>
</div>
</div>
</div>
<!-- if includes -->
<div id="section">
<!-- if method_list -->
</div>
<div id="validator-badges">
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>
</body>
</html>