erubis 2.4.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{CHANGES → CHANGES.txt} +59 -3
- data/MIT-LICENSE +1 -1
- data/README.txt +5 -5
- data/benchmark/bench.rb +2 -2
- data/bin/erubis +2 -2
- data/contrib/erubis +46 -46
- data/contrib/inline-require +2 -2
- data/doc-api/classes/Erubis.html +5 -1
- data/doc-api/classes/Erubis/ArrayEnhancer.html +12 -12
- data/doc-api/classes/Erubis/BiPatternEnhancer.html +12 -12
- data/doc-api/classes/Erubis/CGenerator.html +60 -60
- data/doc-api/classes/Erubis/Context.html +42 -42
- data/doc-api/classes/Erubis/DeleteIndentEnhancer.html +6 -6
- data/doc-api/classes/Erubis/Engine.html +30 -30
- data/doc-api/classes/Erubis/ErboutEnhancer.html +12 -12
- data/doc-api/classes/Erubis/EscapeEnhancer.html +6 -6
- data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +12 -12
- data/doc-api/classes/Erubis/Helpers.html +6 -1
- data/doc-api/classes/Erubis/Helpers/RailsFormHelper.html +762 -0
- data/doc-api/classes/Erubis/Helpers/RailsHelper.html +12 -18
- data/doc-api/classes/Erubis/Helpers/RailsHelper/PreprocessingEruby.html +2 -2
- data/doc-api/classes/Erubis/JavaGenerator.html +54 -54
- data/doc-api/classes/Erubis/JavascriptGenerator.html +60 -60
- data/doc-api/classes/Erubis/Main.html +19 -19
- data/doc-api/classes/Erubis/NoTextEnhancer.html +6 -6
- data/doc-api/classes/Erubis/OptimizedEruby.html +6 -6
- data/doc-api/classes/Erubis/OptimizedGenerator.html +72 -72
- data/doc-api/classes/Erubis/OptimizedXmlEruby.html +6 -6
- data/doc-api/classes/Erubis/PercentLineEnhancer.html +6 -6
- data/doc-api/classes/Erubis/PhpGenerator.html +54 -54
- data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +20 -20
- data/doc-api/classes/Erubis/PrintOutEnhancer.html +30 -30
- data/doc-api/classes/Erubis/RubyEvaluator.html +18 -18
- data/doc-api/classes/Erubis/StringBufferEnhancer.html +12 -12
- data/doc-api/classes/Erubis/TinyEruby.html +24 -24
- data/doc-api/classes/Erubis/XmlHelper.html +30 -30
- data/doc-api/created.rid +1 -1
- data/doc-api/files/README_txt.html +6 -7
- data/doc-api/files/erubis/context_rb.html +1 -1
- data/doc-api/files/erubis/converter_rb.html +1 -1
- data/doc-api/files/erubis/engine/ec_rb.html +1 -1
- data/doc-api/files/erubis/engine/ejava_rb.html +1 -1
- data/doc-api/files/erubis/engine/ejavascript_rb.html +1 -1
- data/doc-api/files/erubis/engine/enhanced_rb.html +1 -1
- data/doc-api/files/erubis/engine/eperl_rb.html +1 -1
- data/doc-api/files/erubis/engine/ephp_rb.html +1 -1
- data/doc-api/files/erubis/engine/eruby_rb.html +1 -1
- data/doc-api/files/erubis/engine/escheme_rb.html +1 -1
- data/doc-api/files/erubis/engine/optimized_rb.html +1 -1
- data/doc-api/files/erubis/engine_rb.html +1 -1
- data/doc-api/files/erubis/enhancer_rb.html +1 -1
- data/doc-api/files/erubis/error_rb.html +1 -1
- data/doc-api/files/erubis/evaluator_rb.html +1 -1
- data/doc-api/files/erubis/generator_rb.html +1 -1
- data/doc-api/files/erubis/helper_rb.html +1 -1
- data/doc-api/files/erubis/helpers/rails_form_helper_rb.html +107 -0
- data/doc-api/files/erubis/helpers/rails_helper_rb.html +2 -2
- data/doc-api/files/erubis/local-setting_rb.html +1 -1
- data/doc-api/files/erubis/main_rb.html +1 -1
- data/doc-api/files/erubis/tiny_rb.html +1 -1
- data/doc-api/files/erubis_rb.html +2 -2
- data/doc-api/fr_class_index.html +1 -0
- data/doc-api/fr_file_index.html +1 -0
- data/doc-api/fr_method_index.html +162 -138
- data/doc/users-guide.html +157 -62
- data/lib/erubis.rb +4 -4
- data/lib/erubis/context.rb +2 -2
- data/lib/erubis/converter.rb +2 -2
- data/lib/erubis/engine.rb +2 -2
- data/lib/erubis/engine/ec.rb +2 -2
- data/lib/erubis/engine/ejava.rb +2 -2
- data/lib/erubis/engine/ejavascript.rb +2 -2
- data/lib/erubis/engine/enhanced.rb +2 -2
- data/lib/erubis/engine/eperl.rb +2 -2
- data/lib/erubis/engine/ephp.rb +2 -2
- data/lib/erubis/engine/eruby.rb +2 -2
- data/lib/erubis/engine/escheme.rb +2 -2
- data/lib/erubis/engine/optimized.rb +2 -2
- data/lib/erubis/enhancer.rb +2 -2
- data/lib/erubis/error.rb +2 -2
- data/lib/erubis/evaluator.rb +2 -2
- data/lib/erubis/generator.rb +2 -2
- data/lib/erubis/helper.rb +2 -2
- data/lib/erubis/helpers/rails_form_helper.rb +190 -0
- data/lib/erubis/helpers/rails_helper.rb +63 -28
- data/lib/erubis/local-setting.rb +2 -2
- data/lib/erubis/main.rb +2 -2
- data/lib/erubis/tiny.rb +2 -2
- data/test/assert-text-equal.rb +2 -2
- data/test/test-engines.rb +2 -2
- data/test/test-enhancers.rb +2 -2
- data/test/test-erubis.rb +2 -2
- data/test/test-main.rb +2 -2
- data/test/test-users-guide.rb +2 -2
- data/test/test.rb +2 -2
- data/test/testutil.rb +2 -2
- metadata +53 -44
- data/test/data/users-guide/stderr.log +0 -3
data/doc/users-guide.html
CHANGED
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
<div align="left"><h1>Erubis Users' Guide</h1></div>
|
|
16
16
|
<div align="left">
|
|
17
|
-
last update: $Date:
|
|
17
|
+
last update: $Date: 2008-01-30 23:27:58 +0900 (Wed, 30 Jan 2008) $<br>
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
|
-
<p>release: 2.
|
|
20
|
+
<p>release: 2.5.0
|
|
21
21
|
</p>
|
|
22
22
|
<a name="preface"></a>
|
|
23
23
|
<h2 class="section1">Preface</h2>
|
|
@@ -145,6 +145,8 @@ It has the following features.
|
|
|
145
145
|
</li>
|
|
146
146
|
<li><a href="#rails-preprocessing">Preprosessing</a>
|
|
147
147
|
</li>
|
|
148
|
+
<li><a href="#rails-formhelpers">Form Helpers for Preprocessing</a>
|
|
149
|
+
</li>
|
|
148
150
|
<li><a href="#rails-others">Others</a>
|
|
149
151
|
</li>
|
|
150
152
|
</ul>
|
|
@@ -2322,71 +2324,55 @@ This section describes how to use Erubis with Ruby on Rails.
|
|
|
2322
2324
|
</p>
|
|
2323
2325
|
<a name="rails-settings"></a>
|
|
2324
2326
|
<h3 class="section2">Settings</h3>
|
|
2325
|
-
<
|
|
2326
|
-
|
|
2327
|
+
<p>Add the following code to your 'config/environment.rb' and restart web server.
|
|
2328
|
+
This replaces ERB in Rails by Erubis entirely.
|
|
2329
|
+
</p>
|
|
2327
2330
|
<div class="program_caption">
|
|
2328
2331
|
config/environment.rb</div>
|
|
2329
2332
|
<pre class="program">require 'erubis/helpers/rails_helper'
|
|
2330
2333
|
#Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby # or Erubis::FastEruby
|
|
2331
2334
|
#Erubis::Helpers::RailsHelper.init_properties = {}
|
|
2332
|
-
#Erubis::Helpers::RailsHelper.show_src =
|
|
2333
|
-
#Erubis::Helpers::RailsHelper.preprocessing =
|
|
2335
|
+
#Erubis::Helpers::RailsHelper.show_src = nil
|
|
2336
|
+
#Erubis::Helpers::RailsHelper.preprocessing = false
|
|
2334
2337
|
</pre>
|
|
2335
|
-
<p>
|
|
2338
|
+
<p>Options:
|
|
2336
2339
|
</p>
|
|
2337
|
-
|
|
2338
|
-
<
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
<
|
|
2342
|
-
+++ lib/action_view/base.rb (working copy)
|
|
2343
|
-
@@ -445,6 +445,11 @@
|
|
2344
|
-
end
|
|
2345
|
-
end
|
|
2346
|
-
|
|
2347
|
-
+ # convert template into ruby code
|
|
2348
|
-
+ def convert_template_into_ruby_code(template)
|
|
2349
|
-
+ ERB.new(template, nil, @@erb_trim_mode).src
|
|
2350
|
-
+ end
|
|
2351
|
-
+
|
|
2352
|
-
# Create source code for given template
|
|
2353
|
-
def create_template_source(extension, template, render_symbol, locals)
|
|
2354
|
-
if template_requires_setup?(extension)
|
|
2355
|
-
@@ -458,7 +463,7 @@
|
|
2356
|
-
"update_page do |page|\n#{template}\nend"
|
|
2357
|
-
end
|
|
2358
|
-
else
|
|
2359
|
-
- body = ERB.new(template, nil, @@erb_trim_mode).src
|
|
2360
|
-
+ body = convert_template_into_ruby_code(template)
|
|
2361
|
-
end
|
|
2362
|
-
|
|
2363
|
-
@@template_args[render_symbol] ||= {}
|
|
2364
|
-
</pre>
|
|
2365
|
-
<p> This patch is included in erubis_2.X.X/contrib directory and the following is an
|
|
2366
|
-
example to apply this patch.
|
|
2340
|
+
<dl class="dl2">
|
|
2341
|
+
<dt class="dt2">
|
|
2342
|
+
Erubis::Helpers::RailsHelper.engine_class (=Erubis::Eruby)</dt>
|
|
2343
|
+
<dd class="dd2">
|
|
2344
|
+
<p> Erubis engine class (default Erubis::Eruby).
|
|
2367
2345
|
</p>
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
<p> Notice that this patch is not necessary if you are using Ruby on Rails ver 1.1 or 1.2, but it is recommended.
|
|
2346
|
+
</dd>
|
|
2347
|
+
<dt class="dt2">
|
|
2348
|
+
Erubis::Helpers::RailsHelper.init_properties (={})</dt>
|
|
2349
|
+
<dd class="dd2">
|
|
2350
|
+
<p> Optional arguments for Erubis::Eruby#initialize() method (default {}).
|
|
2374
2351
|
</p>
|
|
2375
|
-
</
|
|
2376
|
-
<
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2352
|
+
</dd>
|
|
2353
|
+
<dt class="dt2">
|
|
2354
|
+
Erubis::Helpers::RailsHelper.show_src (=nil)</dt>
|
|
2355
|
+
<dd class="dd2">
|
|
2356
|
+
<p> Whether to print converted Ruby code into log file.
|
|
2357
|
+
If true, Erubis prints coverted code into log file.
|
|
2358
|
+
If false, Erubis doesn't.
|
|
2359
|
+
If nil, Erubis prints when ENV['RAILS_ENV'] == 'development'.
|
|
2360
|
+
Default is nil.
|
|
2361
|
+
</p>
|
|
2362
|
+
</dd>
|
|
2363
|
+
<dt class="dt2">
|
|
2364
|
+
Erubis::Helpers::RailsHelper.preprocessing (=false)</dt>
|
|
2365
|
+
<dd class="dd2">
|
|
2366
|
+
<p> Enable preprocessing if true (default false).
|
|
2382
2367
|
</p>
|
|
2368
|
+
</dd>
|
|
2369
|
+
</dl>
|
|
2383
2370
|
<br>
|
|
2384
2371
|
|
|
2385
2372
|
|
|
2386
2373
|
<a name="rails-preprocessing"></a>
|
|
2387
2374
|
<h3 class="section2">Preprosessing</h3>
|
|
2388
|
-
<p
|
|
2389
|
-
Erubis supports preprocessing of template files.
|
|
2375
|
+
<p>Erubis supports preprocessing of template files.
|
|
2390
2376
|
Preprocessing make your Ruby on Rails application about 20-40 percent faster.
|
|
2391
2377
|
To enable preprocessing, set Erubis::Helpers::RailsHelper.preprocessing to true in your 'environment.rb' file.
|
|
2392
2378
|
</p>
|
|
@@ -2463,6 +2449,118 @@ because tag helpers generate different html code when form parameter has errors
|
|
|
2463
2449
|
Preprocessing is not available with these methods.
|
|
2464
2450
|
</li>
|
|
2465
2451
|
</ul>
|
|
2452
|
+
<p>In Ruby on Rails 2.0, <code>_?('user_id')</code> is OK but <code>_?('user.id')</code> is NG
|
|
2453
|
+
because the latter contains period ('.') character.
|
|
2454
|
+
</p>
|
|
2455
|
+
<pre class="program"><!-- NG in Rails 2.0, because _?('') contains period -->
|
|
2456
|
+
[%= link_to 'Edit', edit_user_path(<strong>_?('@user.id')</strong>) %]
|
|
2457
|
+
[%= link_to 'Show', <strong>@user</strong> %]
|
|
2458
|
+
[%= link_to 'Delete', <strong>@user</strong>, :confirm=>'OK?', :method=>:delete %]
|
|
2459
|
+
|
|
2460
|
+
<!-- OK in Rails 2.0 -->
|
|
2461
|
+
<strong><%= user_id = @user.id %></strong>
|
|
2462
|
+
[%= link_to 'Edit', edit_user_path(<strong>_?('user_id')</strong>) %]
|
|
2463
|
+
[%= link_to 'Show', <strong>:action=>'show', :id=>_?('user_id')</strong> %]
|
|
2464
|
+
[%= link_to 'Delete', <strong>{:action=>'destroy', :id=>_?('user_id')}</strong>,
|
|
2465
|
+
{:confirm=>'OK?', :method=>:delete} %]
|
|
2466
|
+
</pre>
|
|
2467
|
+
<br>
|
|
2468
|
+
|
|
2469
|
+
|
|
2470
|
+
<a name="rails-formhelpers"></a>
|
|
2471
|
+
<h3 class="section2">Form Helpers for Preprocessing</h3>
|
|
2472
|
+
<p><strong>(Experimental)</strong>
|
|
2473
|
+
</p>
|
|
2474
|
+
<p>Erubis provides form helper methods for preprocessing.
|
|
2475
|
+
These are defined in 'erubis/helpers/rails_form_helper.rb'.
|
|
2476
|
+
If you want to use it, require it and include Erubis::Helpers::RailsFormHelper in 'app/helpers/applition_helper.rb'
|
|
2477
|
+
</p>
|
|
2478
|
+
<div class="program_caption">
|
|
2479
|
+
app/helpers/xxx_helper.rb</div>
|
|
2480
|
+
<pre class="program">require 'erubis/helpers/rails_form_helper'
|
|
2481
|
+
module ApplicationHelper
|
|
2482
|
+
include Erubis::Helpers::RailsFormHelper
|
|
2483
|
+
end
|
|
2484
|
+
</pre>
|
|
2485
|
+
<p>Form helper methods defined in Erubis::Helpers::RailsFormHelper are named as 'pp_xxxx'
|
|
2486
|
+
('pp' represents preprocessing).
|
|
2487
|
+
</p>
|
|
2488
|
+
<p>Assume the following view template:
|
|
2489
|
+
</p>
|
|
2490
|
+
<div class="program_caption">
|
|
2491
|
+
_form.rhtml</div>
|
|
2492
|
+
<pre class="program"> <p>
|
|
2493
|
+
Name: <%= text_field :user, :name %>
|
|
2494
|
+
</p>
|
|
2495
|
+
<p>
|
|
2496
|
+
Name: <strong>[%= pp_text_field :user, :name %]</strong>
|
|
2497
|
+
</p>
|
|
2498
|
+
</pre>
|
|
2499
|
+
<p>Erubis preprocessor converts it to the following eRuby string:
|
|
2500
|
+
</p>
|
|
2501
|
+
<div class="program_caption">
|
|
2502
|
+
preprocessed</div>
|
|
2503
|
+
<pre class="program"> <p>
|
|
2504
|
+
Name: <%= text_field :user, :name %>
|
|
2505
|
+
</p>
|
|
2506
|
+
<p>
|
|
2507
|
+
Name: <strong><input id="stock_name" name="stock[name]" size="30" type="text" value="<%=h @stock.name%>" /></strong>
|
|
2508
|
+
</p>
|
|
2509
|
+
</pre>
|
|
2510
|
+
<p>Erubis converts it to the following Ruby code:
|
|
2511
|
+
</p>
|
|
2512
|
+
<div class="program_caption">
|
|
2513
|
+
Ruby code</div>
|
|
2514
|
+
<pre class="program"> _buf << ' <p>
|
|
2515
|
+
Name: '; _buf << ( text_field :stock, :name ).to_s; _buf << '
|
|
2516
|
+
'; _buf << ' </p>
|
|
2517
|
+
<p>
|
|
2518
|
+
Name: <input id="stock_name" name="stock[name]" size="30" type="text" value="'; _buf << (h @stock.name).to_s; _buf << '" />
|
|
2519
|
+
</p>
|
|
2520
|
+
';
|
|
2521
|
+
</pre>
|
|
2522
|
+
<p>The above Ruby code shows that text_field() is called everytime when rendering,
|
|
2523
|
+
but pp_text_field() is called only once when template is loaded.
|
|
2524
|
+
This means that pp_text_field() with preprocessing makes view layer very fast.
|
|
2525
|
+
</p>
|
|
2526
|
+
<p>Module Erubis::Helpers::RailsFormHelper defines the following form helper methods.
|
|
2527
|
+
</p>
|
|
2528
|
+
<ul type="disc">
|
|
2529
|
+
<li>pp_render_partial(basename)
|
|
2530
|
+
</li>
|
|
2531
|
+
<li>pp_form_tag(url_for_options={}, options={}, *parameters_for_url, &block)
|
|
2532
|
+
</li>
|
|
2533
|
+
<li>pp_text_field(object_name, method, options={})
|
|
2534
|
+
</li>
|
|
2535
|
+
<li>pp_password_field(object_name, method, options={})
|
|
2536
|
+
</li>
|
|
2537
|
+
<li>pp_hidden_field(object_name, method, options={})
|
|
2538
|
+
</li>
|
|
2539
|
+
<li>pp_file_field(object_name, method, options={})
|
|
2540
|
+
</li>
|
|
2541
|
+
<li>pp_text_area(object_name, method, options={})
|
|
2542
|
+
</li>
|
|
2543
|
+
<li>pp_check_box(object_name, method, options={}, checked_value="1", unchecked_value="0")
|
|
2544
|
+
</li>
|
|
2545
|
+
<li>pp_radio_button(object_name, method, tag_value, options={})
|
|
2546
|
+
</li>
|
|
2547
|
+
<li>pp_select(object, method, collection, options={}, html_options={})
|
|
2548
|
+
</li>
|
|
2549
|
+
<li>pp_collection_select(object, method, collection, value_method, text_method, options={}, html_options={})
|
|
2550
|
+
</li>
|
|
2551
|
+
<li>pp_country_select(object, method, priority_countries=nil, options={}, html_options={})
|
|
2552
|
+
</li>
|
|
2553
|
+
<li>pp_time_zone_select(object, method, priority_zones=nil, options={}, html_options={})
|
|
2554
|
+
</li>
|
|
2555
|
+
<li>pp_submit_tag(value="Save changes", options={})
|
|
2556
|
+
</li>
|
|
2557
|
+
<li>pp_image_submit_tag(source, options={})
|
|
2558
|
+
</li>
|
|
2559
|
+
</ul>
|
|
2560
|
+
<p>Notice that pp_form_for() is not provided.
|
|
2561
|
+
</p>
|
|
2562
|
+
<p><span style="color:#FF0000">CAUTION:</span> These are experimental and may not work in Ruby on Rails 2.0.
|
|
2563
|
+
</p>
|
|
2466
2564
|
<br>
|
|
2467
2565
|
|
|
2468
2566
|
|
|
@@ -2473,12 +2571,9 @@ because tag helpers generate different html code when form parameter has errors
|
|
|
2473
2571
|
</li>
|
|
2474
2572
|
</ul>
|
|
2475
2573
|
<ul type="disc">
|
|
2476
|
-
<li>
|
|
2574
|
+
<li>Form helper methods are not tested in Ruby on Rails 2.0.
|
|
2477
2575
|
</li>
|
|
2478
2576
|
</ul>
|
|
2479
|
-
<p>If it is nil (default), Erubis prints converted Ruby code into log file only when development mode.
|
|
2480
|
-
It is useful for debugging.
|
|
2481
|
-
</p>
|
|
2482
2577
|
<ul type="disc">
|
|
2483
2578
|
<li>ERB::Util.h() is redefined if you require 'erubis/helpers/rails_helper.rb'.
|
|
2484
2579
|
Original definition of ERB::Util.h() is the following and it is slow
|
|
@@ -2488,8 +2583,6 @@ because tag helpers generate different html code when form parameter has errors
|
|
|
2488
2583
|
end
|
|
2489
2584
|
alias h html_escape
|
|
2490
2585
|
</pre>
|
|
2491
|
-
</li>
|
|
2492
|
-
</ul>
|
|
2493
2586
|
<p> New definition in 'erubis/helpers/rails_helper.rb' is faster than the above
|
|
2494
2587
|
because it scans string only once.
|
|
2495
2588
|
</p>
|
|
@@ -2503,6 +2596,8 @@ because tag helpers generate different html code when form parameter has errors
|
|
|
2503
2596
|
You should use ERB::Util.html_hscape() if string contains a lot of '< > & "'
|
|
2504
2597
|
characters.
|
|
2505
2598
|
</p>
|
|
2599
|
+
</li>
|
|
2600
|
+
</ul>
|
|
2506
2601
|
<br>
|
|
2507
2602
|
|
|
2508
2603
|
|
|
@@ -2820,8 +2915,8 @@ example of using NoCodeEnhancer with PHP file</div>
|
|
|
2820
2915
|
<p>Thanks Andrew R Jackson, he developed 'erubis-run.rb' which enables you to use Erubis with mod_ruby.
|
|
2821
2916
|
</p>
|
|
2822
2917
|
<ol type="1">
|
|
2823
|
-
<li>Copy 'erubis-2.
|
|
2824
|
-
<pre class="terminal">$ cd erubis-2.
|
|
2918
|
+
<li>Copy 'erubis-2.5.0/contrib/erubis-run.rb' to the 'RUBYLIBDIR/apache' directory (for example '/usr/local/lib/ruby/1.8/apache') which contains 'ruby-run.rb', 'eruby-run.rb', and so on.
|
|
2919
|
+
<pre class="terminal">$ cd erubis-2.5.0/
|
|
2825
2920
|
$ sudo copy contrib/erubis-run.rb /usr/local/lib/ruby/1.8/apache/
|
|
2826
2921
|
</pre>
|
|
2827
2922
|
</li>
|
|
@@ -2897,12 +2992,12 @@ p obj.render('world') #=> "hello world"
|
|
|
2897
2992
|
|
|
2898
2993
|
<a name="topics-benchmark"></a>
|
|
2899
2994
|
<h3 class="section2">Benchmark</h3>
|
|
2900
|
-
<p>A benchmark script is included in Erubis package at 'erubis-2.
|
|
2995
|
+
<p>A benchmark script is included in Erubis package at 'erubis-2.5.0/benchark/' directory.
|
|
2901
2996
|
Here is an example result of benchmark.
|
|
2902
2997
|
</p>
|
|
2903
2998
|
<div class="terminal_caption">
|
|
2904
2999
|
MacOS X 10.4 Tiger, Intel CoreDuo 1.83GHz, Ruby1.8.6, eruby1.0.5, gcc4.0.1</div>
|
|
2905
|
-
<pre class="terminal">$ cd erubis-2.
|
|
3000
|
+
<pre class="terminal">$ cd erubis-2.5.0/benchmark/
|
|
2906
3001
|
$ ruby bench.rb -n 10000 -m execute
|
|
2907
3002
|
*** ntimes=10000, testmode=execute
|
|
2908
3003
|
user system total real
|
data/lib/erubis.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
##
|
|
2
|
-
## $Rev:
|
|
3
|
-
## 2.
|
|
4
|
-
## copyright(c) 2006-
|
|
2
|
+
## $Rev: 99 $
|
|
3
|
+
## $Release: 2.5.0 $
|
|
4
|
+
## copyright(c) 2006-2008 kuwata-lab.com all rights reserved.
|
|
5
5
|
##
|
|
6
6
|
|
|
7
7
|
##
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
module Erubis
|
|
51
|
-
VERSION = ('$Release: 2.
|
|
51
|
+
VERSION = ('$Release: 2.5.0 $' =~ /([.\d]+)/) && $1
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
require 'erubis/engine'
|
data/lib/erubis/context.rb
CHANGED
data/lib/erubis/converter.rb
CHANGED
data/lib/erubis/engine.rb
CHANGED
data/lib/erubis/engine/ec.rb
CHANGED
data/lib/erubis/engine/ejava.rb
CHANGED
data/lib/erubis/engine/eperl.rb
CHANGED
data/lib/erubis/engine/ephp.rb
CHANGED
data/lib/erubis/engine/eruby.rb
CHANGED