path: root/man
diff options
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-29 09:26:34 (GMT)
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-29 09:26:34 (GMT)
commitaf91b4235416af1ec499afafcf4524d93437607b (patch)
tree66010749bd70f0fd5d3048a7c65f5eb7babc88c8 /man
parentd33298e52459045ddde4bae619a8da3c3cf7dbd6 (diff)
* lib/erb.rb (ERB): m17n of ERB. adds rdoc.
fixes #712. c.f. [ruby-dev:37516]. * lib/erb.rb (ERB::Compiler#compile): recognizes magic comments. returns a pair of compiled script and its script encoding. * lib/erb.rb (ERB#set_eoutvar): make generated scripts return a string in correct encoding. * lib/erb.rb (ERB#def_method): use Kernel#eval for encoding-awareness of the evaluated string. * bin/erb.rb ( adds -E and -U options. String is no longer Enumerable. * man/erb.1: new manapage. * test/erb/test_erb_m17n.rb: new test case for m17n features. git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'man')
1 files changed, 158 insertions, 0 deletions
diff --git a/man/erb.1 b/man/erb.1
new file mode 100644
index 0000000..87a0a6f
--- /dev/null
+++ b/man/erb.1
@@ -0,0 +1,158 @@
+.\"Ruby is copyrighted by Yukihiro Matsumoto <>.
+.Dd December 27, 2008
+.Dt ERB(1) "" "Ruby Programmers Reference Guide"
+.Nm erb
+.Nd Ruby Templating
+.Op Fl -version
+.Op Fl UPdnvx
+.Op Fl E Ar ext Ns Op Ns : Ns int
+.Op Fl S Ar level
+.Op Fl T Ar mode
+.Op Fl r Ar library
+.Op Fl -
+.Op file ...
+is a command line front-end for
+.Li "ERB"
+library, which is an implementation of eRuby.
+eRuby provdes an easy to use but powerful templating system for Ruby.
+Using eRuby, actual Ruby code can be added to any plain text document for the
+purposes of generating document information details and/or flow control.
+is a part of
+.Nm Ruby .
+.Bl -tag -width "1234567890123" -compact
+.It Fl -version
+Prints the version of
+.Nm .
+.It Fl E Ar external Ns Op : Ns Ar internal
+.It Fl -encoding Ar external Ns Op : Ns Ar internal
+Specifies the default value(s) for external encodings and internal encoding. Values should be separated with colon (:).
+You can ommit the one for internal encodings, then the value
+.Pf ( Li "Encoding.default_internal" ) will be nil.
+.It Fl P
+Evaluates lines starting with
+.Li "%"
+as Ruby code and removes the tailing EOLs.
+.It Fl S Ar level
+Specifies the safe level in which eRuby script will run.
+.It Fl T Ar mode
+Specifies trim mode (default 0).
+.Ar mode
+can be one of
+.Bl -hang -offset indent
+.It Sy 0
+EOL remains after the embedded ruby script is evaluated.
+.It Sy 1
+EOL is removed if the line ends with
+.Li "%>" .
+.It Sy 2
+EOL is removed if the line starts with
+.Li "<%"
+and ends with
+.Li "%>" .
+.It Sy -
+EOL is removed if the line ends with
+.Li "-%>" .
+And leading whitespaces are removed if the erb directive starts with
+.Li "<%-" .
+.It Fl U
+can be one of
+Sets the defalut value for internal encodings
+.Pf ( Li "Encoding.default_internal" ) to UTF-8.
+.It Fl d
+.It Fl -debug
+Turns on debug mode.
+.Li "$DEBUG"
+will be set to true.
+.It Fl h
+.It Fl -help
+Prints a summry of the options.
+.It Fl n
+Used with
+.Fl x .
+Prepends the line number to each line in the output.
+.It Fl v
+Enables verbose mode.
+will be set to true.
+.It Fl x
+Converts the eRuby script into Ruby script and prints it without line numbers.
+Here is an eRuby script
+.Bd -literal -offset indent
+<?xml version="1.0" ?>
+<% require 'prime' -%>
+ <calc><%= 1+1 %></calc>
+ <var><%= __FILE__ %></var>
+ <library><%= Prime.each(10).to_a.join(", ") %></library>
+.Dl "% erb -T - example.erb"
+.Bd -literal -offset indent
+<?xml version="1.0" ?>
+ <calc>2</calc>
+ <var>example.erb</var>
+ <library>2, 3, 5, 7</library>
+.Xr ruby 1 .
+And see
+.Xr ri 1
+documentation for
+.Li "ERB"
+.Bl -bullet
+.Li Security vulnerabilities should be reported via an email to
+.Aq Ns
+.Li .
+Reported problems will be published after fixed.
+.Li And you can report other bugs and feature requests via the
+Ruby Issue Tracking System (
+Do not report security vulnerabilities
+via the system because it publishes the vulnerabilities immedately.
+Written by Masatoshi SEKI.