diff options
-rw-r--r-- | doc/users-guide.html | 22 | ||||
-rw-r--r-- | doc/users-guide.txt | 18 |
2 files changed, 20 insertions, 20 deletions
diff --git a/doc/users-guide.html b/doc/users-guide.html index 82aaf31..9e9c501 100644 --- a/doc/users-guide.html +++ b/doc/users-guide.html @@ -154,7 +154,7 @@ Erubis now supports Ruby 1.9. <ul> <li><a href="#topics-fasteruby"><code>Erubis::FastEruby</code> Class</a> </li> - <li><a href="#topics-bufname"><code>:bufname</code> Option</a> + <li><a href="#topics-bufvar"><code>:bufvar</code> Option</a> </li> <li><a href="#topics-trimspaces">'<%= =%>' and '<%= -%>'</a> </li> @@ -2717,13 +2717,13 @@ _buf.to_s <br> -<a name="topics-bufname"></a> -<h3 class="section2"><code>:bufname</code> Option</h3> -<p>Since 2.7.0, Erubis supports <code>:bufname</code> option which allows you to change buffer variable name (default '<code>_buf</code>'). +<a name="topics-bufvar"></a> +<h3 class="section2"><code>:bufvar</code> Option</h3> +<p>Since 2.7.0, Erubis supports <code>:bufvar</code> option which allows you to change buffer variable name (default '<code>_buf</code>'). </p> -<a name="bufname-example.rb"></a> +<a name="bufvar-example.rb"></a> <div class="program_caption"> -bufname-example.rb</div> +bufvar-example.rb</div> <pre class="program">require 'erubis' input = File.read('example.eruby') @@ -2731,14 +2731,14 @@ puts "----- default -----" eruby = Erubis::FastEruby.new(input) puts eruby.src -puts "----- with :bufname option -----" -eruby = Erubis::FastEruby.new(input, <strong>:bufname=>'@_out_buf'</strong>) +puts "----- with :bufvar option -----" +eruby = Erubis::FastEruby.new(input, <strong>:bufvar=>'@_out_buf'</strong>) print eruby.src </pre> -<a name="bufname-example.result"></a> +<a name="bufvar-example.result"></a> <div class="terminal_caption"> result</div> -<pre class="terminal">$ ruby bufname-example.rb +<pre class="terminal">$ ruby bufvar-example.rb ----- default ----- _buf = ''; _buf << %Q`<div>\n` for item in list @@ -2747,7 +2747,7 @@ _buf = ''; _buf << %Q`<div>\n` end _buf << %Q`</div>\n` _buf.to_s ------ with :bufname option ----- +----- with :bufvar option ----- <strong>@_out_buf</strong> = ''; <strong>@_out_buf</strong> << %Q`<div>\n` for item in list <strong>@_out_buf</strong> << %Q` <p>#{ item }</p> diff --git a/doc/users-guide.txt b/doc/users-guide.txt index 2e48d2f..85431af 100644 --- a/doc/users-guide.txt +++ b/doc/users-guide.txt @@ -2825,12 +2825,12 @@ _buf.to_s Technically, {{,Erubis::FastEruby,}} is just a subclass of {{,Erubis::Eruby,}} and includes {{,{{<InterpolationEnhancer|#interpolation-enhancer>}},}}. {{,Erubis::FastEruby,}} is faster than {{,Erubis::Eruby,}} but is not extensible compared to {{,Erubis::Eruby,}}. This is the reason why {{,Erubis::FastEruby,}} is not the default class of Erubis. -.$$ {{,:bufname,}} Option | topics-bufname +.$$ {{,:bufvar,}} Option | topics-bufvar -Since 2.7.0, Erubis supports {{,:bufname,}} option which allows you to change buffer variable name (default '{{,_buf,}}'). +Since 2.7.0, Erubis supports {{,:bufvar,}} option which allows you to change buffer variable name (default '{{,_buf,}}'). -.? bufname-example.rb -.-------------------- bufname-example.rb +.? bufvar-example.rb +.-------------------- bufvar-example.rb require 'erubis' input = File.read('example.eruby') @@ -2838,14 +2838,14 @@ puts "----- default -----" eruby = Erubis::FastEruby.new(input) puts eruby.src -puts "----- with :bufname option -----" -eruby = Erubis::FastEruby.new(input, {{*:bufname=>'@_out_buf'*}}) +puts "----- with :bufvar option -----" +eruby = Erubis::FastEruby.new(input, {{*:bufvar=>'@_out_buf'*}}) print eruby.src .-------------------- .? result -.==================== bufname-example.result -$ ruby bufname-example.rb +.==================== bufvar-example.result +$ ruby bufvar-example.rb ----- default ----- _buf = ''; _buf << %Q`<div>\n` for item in list @@ -2854,7 +2854,7 @@ _buf = ''; _buf << %Q`<div>\n` end _buf << %Q`</div>\n` _buf.to_s ------ with :bufname option ----- +----- with :bufvar option ----- {{*@_out_buf*}} = ''; {{*@_out_buf*}} << %Q`<div>\n` for item in list {{*@_out_buf*}} << %Q` <p>#{ item }</p> |