File: fasteruby.result

package info (click to toggle)
ruby-erubis 2.7.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,260 kB
  • sloc: ruby: 8,758; ansic: 97; makefile: 72; php: 17
file content (38 lines) | stat: -rw-r--r-- 675 bytes parent folder | download | duplicates (5)
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
$ ruby fasteruby.rb
---------- script source ---
_buf = ''; _buf << %Q`<html>
  <body>
    <h1>#{Erubis::XmlHelper.escape_xml( @title )}</h1>
    <table>\n`
 i = 0 
 for item in @list 
   i += 1 
 _buf << %Q`      <tr>
        <td>#{ i }</td>
        <td>#{Erubis::XmlHelper.escape_xml( item )}</td>
      </tr>\n`
 end 
 _buf << %Q`    </table>
  </body>
</html>\n`
_buf.to_s
---------- result ----------
<html>
  <body>
    <h1>Example</h1>
    <table>
      <tr>
        <td>1</td>
        <td>aaa</td>
      </tr>
      <tr>
        <td>2</td>
        <td>bbb</td>
      </tr>
      <tr>
        <td>3</td>
        <td>ccc</td>
      </tr>
    </table>
  </body>
</html>