kuwata-lab homepage
Materials
-
LL Spirit 2007
- Presentation (LL2007LT.pdf) (japanese, 2007-08-04)
-
RubyKaigi2007
- Presesntation (rubykaigi2007.pdf) (japanese, 2007-06-09)
- Benchmark program (erubybench-1.1.zip) (2007-06-13)
News
- (2008-02-07) rbTenjin 0.6.1 released
- (2008-02-01) jsTenjin 0.0.2 released
- (2008-01-30) Erubis 2.5.0 released
- (2008-01-27) Kwalify 0.7.1 rleased
- (2008-01-27) Kwalify 0.7.0 rleased
- (2007-10-23) pyTenjin 0.6.1 releasd
- (2007-09-25) Erubis 2.4.1 released
- (2007-08-04) Tenjin released
- (2007-07-27) Kwalify 0.6.1 released
- (2007-07-19) Erubis 2.4.0 released
Softwares
The followings are released from kuwata-lab.com.
- Kwartz - a fast and multi-language template system which doesn't break HTML desgin at all.
- Kwaff - a pretty text formatter to generate XML document as easy as YAML.
- Kwalify - a simple but useful schema validator for YAML and JSON.
- Kook & Rook - a tiny SCM tool (like Make or Ant) for PHP and Ruby.
- Erubis & Erubis-J - fast, secure, and extensible eRuby/eJavaScript imprementation.
Kwartz
| Fig: Kwartz divide template into two parts: presentation data and presentation logic. |
|
Kwartz is a template system which realized the concept 'Independence of Presentation Logic'(IoPL).
Kwartz divide template into two parts: presentation data and presentation logic. Presentation data is HTML file and you don't have to 'mix' presentation logic into HTML file. In the result, HTML design is not breaked at all.
In addition, Kwartz has more features:
- Separates presentation logic from presentation data.
- Multi-languages: Ruby(eRuby), PHP, Java(JSP)
- Runs very fast
- Doesn't break HTML design at all
- Handle any text file
- Supports auto-sanitizing and partial-sanitizing
Kwaff
| Fig: Kwaff makes XML as easy as YAML to read and write for human. |
|
Kwaff is a pretty formatter to generate XML document. It convert Kwaff format document into XML document, and convert XML into Kwaff to the contrary.
Kwaff format is a friendly format for human to read and write than XML. Kwaff format enables you to generate XML as easy as YAML.
The following is an example to convert Kwaff <=> XML.
$ kwaff example.kwaff > example.xml
$ kwaff -r example.xml > example.kwaff
Kwalify
| Fig: Kwalify validates YAML or JSON document. |
|
Kwalify is a small but useful schema validator for YAML and JSON. The followings are available with Kwalify.
- datatype check
- data existenceness check
- key names check if mappings
- value range (from min to max)
- value length (from min to max)
- value pattern check with regular expression
- and so on...
YAML and JSON are simple and nice format for structured data and easier for human to read and write than XML. But they havn't have schema validator such as RelaxNG or DTD. Kwalify gets over this situation.
Kwalify is designed to be easy to extend in script and to embed into other application.
Kwalify is implemented in Ruby and is now ported into Java.
Kook & Rook
| Fig: Cookbook format is YAML and it allows to contain PHP/Ruby code. |
|
Kook is a simple Software Construction Management (SCM) tool like Make, Ant, SCons, or Rake. Kook is implemented in pure PHP and Rook is implemented in pure Ruby.
Kook and Rook are inspired Cook which is developed by Peter Miller. They regard software project as cooking. Terms used in Kook and Rook are cooking terms.
- 'Recipe' means how to generate output from input.
- 'Product' means output of recipe.
- 'Ingredient' means input of recipe.
- 'Topping' means optional input of recipe.
- 'Cookbook' means a file on which recipes are defined.
Cookbook is just 'Makefile' or 'build.xml' in Kook. Cookbook is easy to read and understand because it is described in YAML format which is much easier to read and write than XML.
Kook and Rook are also very powerful because they can allow you to embed PHP or Ruby code in Cookbook directly. It means that you can get the advantage of 'declarative' by YAML format and advantage of 'procedural' by PHP or Ruby code. This approach is very strong and powerful.
Erubis & Erubis-J
| Fig: Erubis is the fastest eRuby implementation. |
|
Erubis is a fast, secure, and extensible implementation of eRuby (embedded Ruby). It has the following features.
- Very fast, almost three times faster than ERB and about ten percent faster than eruby.
- Embedded pattern (default '
<% %>') is changeable, for example '[% %]' or '<? ?>'. - Auto escaping support, it means that '
<%= %>' can be escaped in default. - Multi-language support (Ruby/PHP/C/Java/Scheme/Perl/Javascript)
- Easy to combine eRuby template with YAML datafile.
- Print statement available.
- Easy to expand and customize in subclass.
- Ruby on Rails support.
Erubis supports new embedded pattern '<?rb statement ?>' and '@{expression}@', too.
This is more suitable for XML and HTML than ordinaly pattern '<% statement %>' and '<%= expression %>', because the latter breaks HTML design and the former doesn't.
Erubis is impremented pure Ruby and is ported into Java, named Erubis-J. Erubis-J is an embedded JavaScript converter which uses Rhino as JavaScript engine.