HTML::ERubyHTML::ERuby is a ERuby processor for Perl. | |
Download |
HTML::ERuby Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- HTML::ERuby Team
- Publisher web site:
- http://search.cpan.org/~ikebe/HTML-ERuby-0.02/lib/HTML/ERuby.pm
HTML::ERuby Tags
HTML::ERuby Description
HTML::ERuby is a ERuby processor for Perl. SYNOPSIS use HTML::ERuby; my $compiler = HTML::ERuby->new; my $result = $compiler->compile(filename => './foo.rhtml'); print $result;HTML::ERuby is a ERuby processor written in Perl.parse ERuby document by Perl and evaluate by Ruby.METHODS$compiler = HTML::ERuby->newconstructs HTML::ERuby object.$result = $compiler->compile(%option)compile ERuby document and return result. you can specify ERuby document as filename, scalarref or arrayref. $result = $compiler->compile(filename => $filename); $result = $compiler->compile(scalarref => $rhtml); $result = $compiler->compile(arrayref => @rhtml);you can use the Perl variables in the ERuby document. supported types are String, Hash and Array only. NO Objects. See the simple example.Perl code my %vars = ( '@var' => 'foo', # Ruby instance variable 'ARRAY_REF' => , # Ruby constant 'hash_ref' => {foo => 'bar', 'bar' => 'baz'} # Ruby local variable ); my $compiler = HTML::ERuby->new; print $compiler->compile(filename => './foo.rhtml', vars => %vars);ERuby document instance variable < %= @var % > < % ARRAY_REF.each do |v| % > < %= v % > < % end % > foo: < %= hash_ref % > bar: < %= hash_ref % >Result instance variable foo a b c foo: bar bar: baz Requirements: · Perl
HTML::ERuby Related Software