summaryrefslogtreecommitdiff
path: root/ReleaseNote.txt
blob: adaf328b14aeb7c690511e007fd76b8162a2a80a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
$ [ANN] Erubis 2.1.0 release - a fast eRuby implementation

I have released Erubis 2.1.0.
http://rubyforge.org/projects/erubis/

Erubis is a pure ruby implementation of eRuby.

Features:
  * Very fast, almost three times faster than ERB and
    even as fast as eruby (implemented in C)
  * Support multi-language
    (Ruby,PHP,C,Java,Scheme,Perl,Javascript)
  * Auto escaping support
  * Auto trimming spaces around '<% %>'
  * Embedded pattern changeable (default '<% %>')
  * Context object available and easy to combine eRuby
    template with YAML datafile
  * Print statement available
  * Easy to extend in subclass

See users' guide (erubis_2.1.0/doc/users-guide.html)
for details.


Enhancements from 2.0:

  * Ruby on Rails support. Add the following code to
    your 'app/controllers/application.rb' and restart web server.

    --------------------
    require 'erubis/helper/rails'
    suffix = 'erubis' 
    ActionView::Base.register_template_handler(suffix, Erubis::Helper::RailsTemplate)
    #Erubis::Helper::RailsTemplate.engine_class = Erubis::EscapedEruby ## or Erubis::PI::Eruby
    #Erubis::Helper::RailsTemplate.default_properties = { :escape=>true, :escapefunc=>'h' }
    --------------------

    And rename your view template as 'xxx.erubis'.
    If you got the "(eval):10:in `render': no block given" error,
    use '@content_for_layout' instead 'yield' in your layout template.
 
  * Another eRuby engine (PIEngine) support. This engine doesn't
    break HTML design because it uses Processing Instructions (PI)
    '<?rb .. ?>' as embedded pattern instead of '<% .. %>'.
 
    example.rhtml
    --------------------
    <table>
    <?rb @list.each_with_index do |item, i| ?>
    <?rb   klass = i % 2 == 0 ? 'odd' : 'even' ?>
      <tr class="@{klass}@">
        <td>@!{item}@</td>
      </tr>
    <?rb end ?>
    </table>
    --------------------
 
    compile:
    ====================
    $ erubis -x --pi example.rhtml
    _buf = []; _buf << '<table>
    '; @list.each_with_index do |item, i| 
       klass = i % 2 == 0 ? 'odd' : 'even' 
     _buf << '  <tr class="'; _buf << Erubis::XmlHelper.escape_xml(klass); _buf << '">
        <td>'; _buf << (item).to_s; _buf << '</td>
      </tr>
    '; end 
     _buf << '</table>
    ';
    _buf.join
    ====================
 
  * Add new command 'notext' which remove text part from eRuby
    script and leaves only Ruby code.
    This is very useful when debugging eRuby script.
 
    example2.rhtml
    --------------------
    <html>
     <body>
      <table>
    <% @list.each_with_index do |item, i| %>
    <%   klass = i % 2 == 0 ? 'odd' : 'even' %>
       <tr class="<%= klass %>">
        <td><%== item %></td>
       </tr>
    <% end %>
      </table>
     </body>
    </html>
    --------------------
 
    command line example:
    ====================
    $ notext example2.rhtml
    _buf = [];
    
    
     @list.each_with_index do |item, i| ;
       klass = i % 2 == 0 ? 'odd' : 'even' ;
                   _buf << ( klass ).to_s;
             _buf << Erubis::XmlHelper.escape_xml( item );
    
     end ;
    
    
    
    _buf.join
    $ notext -nc example2.rhtml
      1: _buf = [];
      4:  @list.each_with_index do |item, i| ;
      5:    klass = i % 2 == 0 ? 'odd' : 'even' ;
      6:                _buf << ( klass ).to_s;
      7:          _buf << Erubis::XmlHelper.escape_xml( item );
      9:  end ;
     13: _buf.join
    ====================
 
  * Add new enhance 'NoCode' which removes ruby code from
    eRuby script and leaves only HTML text part.
    It is very useful to validate HTML of eRuby script.
 
    command-line example:
    ====================
    $ erubis -x -E NoCode example2.rhtml
    <html>
     <body>
      <table>
    
    
       <tr class="">
        <td></td>
       </tr>
    
      </table>
     </body>
    </html>
    ====================


Changes from 2.0:
 
  * License is changed to LGPL.

  * Command-line property '--escape=name' is renamed to
    '--escapefunc=name'.
 
  * When command-line option '-l perl' is specified, function
   'encode_entities()' is used ad escaping function which is
   available wth HTML::Entities module.


Bugfix:
  * There is a certain pattern which makes Engine#convert()
    too slow. Now Engne#convert() is fixed not to be slown.
  * Command name is now displayed when '-h' is specified.


Have fun!

--
kwa


$ [ANN] Erubis 2.0.1 release - a fast eRuby implementation

I have released Erubis 2.0.0.
http://rubyforge.org/projects/erubis/

Erubis is a pure ruby implementation of eRuby.

This is a minor bugfix version.



$ [ANN] Erubis 2.0.0 release - a fast eRuby implementation

I have released Erubis 2.0.0.
http://rubyforge.org/projects/erubis/

Erubis is a pure ruby implementation of eRuby.

Features:
 * Very fast, almost three times faster than ERB and
   even as fast as eruby (implemented in C)
 * Support multi-language
   (Ruby,PHP,C,Java,Scheme,Perl,Javascript)
 * Auto escaping support
 * Auto trimming spaces around '<% %>'
 * Embedded pattern changeable (default '<% %>')
 * Context object available and easy to combine eRuby
   template with YAML datafile
 * Print statement available
 * Easy to extend in subclass

See users' guide (erubis_2.0.0/doc/users-guide.html)
for details.


Changes from 1.1:
 * module 'PrintEnhancer' is renamed to 'PrintEnabledEnahncer'
 * module 'FastEnhancer' and class 'FastEruby' is obsolete
   (these are integrated with Eruby class)
 * Eruby#evaluate() calls instance_eval() instead of eval()
 * XmlEruby.escape_xml() is moved to XmlHelper.escape_xml()
 * and so on

Enhancements from 1.1:
 * multi programming language support
   (Ruby,PHP,C,Java,Scheme,Perl,Javascript)
 * many enhancer modules are added (see users' guide for details)
 * class Eruby runs very fast because FastEnhancer module is
   integrated into Eruby by default
 * TinyEruby class (tiny.rb) is added
 * and so on
 

If you are interested in Eruby internal, see the following classes
at first.
 * Erubis::TinyEruby (erubis/tiny.rb) --
       the most simple eRuby implementation.
 * Erubis::Engine (erubis/engine.rb) --
       base class of Eruby, Ephp, Ejava, and so on.
 * Erubis::Eruby (erubis/engine/eruby.rb) --
       engine class for eRuby.


--
regards,
kwatch





$ Release 1.1.1 (2006-03-06)

I have released Erubis 1.1.0.
http://rubyforge.org/projects/erubis/

Erubis is an implementation of eRuby.
It has the following features:

* Auto sanitizing support
* Auto trimming spaces around '<% %>'
* Embedded pattern changeable (default '<% %>')
* Context object available
* Print statement available
* Faster mode support
* Easy to expand in subclass

Erubis is implemented in pure Ruby.  It requires Ruby 1.8 or higher.

See doc/users-guide.html in archive for details.


: Enhancement from 1.1.0

  * New command-line option '-x' supported.
    This option prints Ruby source code of eRuby script coverted
    and remove the last '_out' line.
    This is more convenient than '-s' when validating with 'ruby -wc'.

    example:
    ====================
    $ cat foo.eruby
    <% (1..3).each do |i| %>
     i = <%= i %>
    <% end %>

    $ eruby -x foo.eruby
    _out = '';  (1..3).each do |i| 
    _out << " i = "; _out << ( i ).to_s; _out << "¡Àn"
     end
    $ eruby -x foo.eruby | ruby -wc
    Syntax OK

    $ eruby -s foo.eruby
    _out = '';  (1..3).each do |i| 
    _out << " i = "; _out << ( i ).to_s; _out << "¡Àn"
     end
    _out
    $ erubis -s foo.rhtml | ruby -wc
    -:4: warning: useless use of a variable in void context
    Syntax OK
    ====================


$ Release 1.1.0 (2006-03-05)

I have released Erubis 1.1.0.
http://rubyforge.org/projects/erubis/

Erubis is an implementation of eRuby.
It has the following features:

* Auto sanitizing support
* Embedded pattern changeable (default '<% %>')
* Auto trimming spaces around '<% %>'
* Context object available
* Print statement available
* Faster mode support
* Easy to expand in subclass

Erubis is implemented in pure Ruby.  It requires Ruby 1.8 or higher.

Sample code (example.rb):
--------------------
## eRuby script
## ('<%= %>' is escaped and '<%== %>' is not escaped when using XmlEruby class)
input = <<END
<ul>
  <% for item in list %>
  <li><%= item %>
      <%== item %></li>
  <% end %>
</ul>
END

## create Eruby object
require 'erubis'
eruby = Erubis::XmlEruby.new(input)     # or Erubis::Eruby.new(input)

## get result
list = ['<aaa>', 'b&b', '"ccc"']
puts eruby.result(binding())
--------------------

result:
====================
$ ruby example.rb
<ul>
  <li>&lt;aaa&gt;
      <aaa></li>
  <li>b&amp;b
      b&b</li>
  <li>&quot;ccc&quot;
      "ccc"</li>
</ul>
====================

See doc/users-guide.html in archive for details.


: Enhancement from 1.0.1

  * '<%# .. %>' supported.  Erubis ignores '<%#  %>'.
  
  * New class PrintEruby and PrintXmlEruby available.
    These class enables you to embed print statement in eRuby
    (this feature is not supported in ERB).
  
    ex.  example.eb
    --------------------
    ## data
    list = ['aaa', 'bbb', 'ccc']
    context = { :list => list }
  
    ## eRuby script
    ## (use print statement instead of <%= item %>)
    input = <<-END
    <ul>
     <% for item in list %>
      <li><% print item %></li> 
     <% end %>
    </ul>
    END
  
    ## create eruby and get result as string
    require 'erubis'
    eruby = Erubis::PrintEruby.new(input)
    str = eruby.evaluate(context)    # don't use result()!
    print str
    --------------------
  
    result:
    ====================
    $ ruby example.rb
    <ul>
      <li>aaa</li>
      <li>bbb</li>
      <li>ccc</li>
    </ul>
    ====================
  
Have fun!

--
regards,
kwatch