man > erubis(1)

ERUBIS(1) User Commands ERUBIS(1)

📛 NAME

erubis - eRuby style template engine for multiple languages

🚀 Quick Reference

Use Case Command Description
Convert template to PHP erubis -l php file.ephp Convert embedded document to PHP code
Show converted Ruby code erubis -x file.eruby Display the generated Ruby source
Show converted code with line numbers erubis -x -N file.eruby Display generated source with line numbers
Check syntax erubis -z file.eruby Verify template syntax without executing
Enable HTML escaping erubis -E Escape file.eruby Escape HTML output by default
Load context from YAML file erubis -f data.yaml file.eruby Provide template variables from a file
Custom embedding pattern erubis -p '<? ?>' file.eruby Use <? ... ?> instead of <% ... %>

📋 SYNOPSIS

erubis [..options..] [file ...]

📖 DESCRIPTION

Embedded templating engine for multiple languages. Erubis will take a template file as input and output code to convey that data in the language specified. The following output languages are supported:

âš™ī¸ OPTIONS

🆘 -h, --help

help

â„šī¸ -v

version

🔍 -x

show converted code

🔍 -X

show converted code, only ruby code and no text part

đŸ”ĸ -N

numbering: add line numbers (for '-x/-X')

đŸ—œī¸ -U

unique: compress empty lines to a line (for '-x/-X')

đŸ—œī¸ -C

compact: remove empty lines (for '-x/-X')

🧩 -b

body only: no preamble nor postamble (for '-x/-X')

✅ -z

syntax checking

🔒 -e

escape (equal to '--E Escape')

📐 -p pattern

embedded pattern (default '<% %>')

🌐 -l lang

convert but no execute (ruby/php/c/java/scheme/perl/js)

✨ -E e1,e2,...

enhancer names (Escape, PercentLine, BiPattern, ...)

📂 -I path

library include path

đŸ‡¯đŸ‡ĩ -K kanji

kanji code (euc/sjis/utf8) (default none)

📝 -c context

context data string (yaml inline style or ruby code)

📁 -f datafile

context data file ('*.yaml', '*.yml', or '*.rb')

🛑 -T

don't expand tab characters in YAML file

🔀 -S

convert mapping key from string to symbol in YAML file

⚡ -B

invoke 'result(binding)' instead of 'evaluate(context)'

đŸ”Ŗ --pi=name

parse '<?name ... ?>' instead of '<% ... %>'

📋 Supported Properties

💡 EXAMPLES

Run 'erubis -l php example.ephp' to convert the embedded document to php code.

📄 example.ephp:

 <?xml version="1.0"?>
 <html>
  <body>
   <p>Hello <%= $user %>!</p>
   <table>
    <tbody>
     <% $i = 0; %>
     <% foreach ($list as $item) { %>
     <%   $i++; %>
     <tr bgcolor="<%= $i % 2 == 0 ? '#FFCCCC' : '#CCCCFF' %>">
      <td><%= $i %></td>
      <td><%== $item %></td>
     </tr>
     <% } %>
    </tbody>
   </table>
  </body>
 </html>

🔗 SEE ALSO

http://rubyforge.org/projects/erubis/

erubis 2.6.2                                         January 2009                                         ERUBIS(1)

erubis(1)
📛 NAME 🚀 Quick Reference 📋 SYNOPSIS 📖 DESCRIPTION âš™ī¸ OPTIONS
🆘 -h, --help â„šī¸ -v 🔍 -x 🔍 -X đŸ”ĸ -N đŸ—œī¸ -U đŸ—œī¸ -C 🧩 -b ✅ -z 🔒 -e 📐 -p pattern 🌐 -l lang ✨ -E e1,e2,... 📂 -I path đŸ‡¯đŸ‡ĩ -K kanji 📝 -c context 📁 -f datafile 🛑 -T 🔀 -S ⚡ -B đŸ”Ŗ --pi=name 📋 Supported Properties
💡 EXAMPLES
📄 example.ephp:
🔗 SEE ALSO

Generated by phpman v4.10.0-7-g98e9fd5 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-09-03 18:54 @216.73.216.23
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^