kwartz 3.0.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/COPYING +340 -0
 - data/ChangeLog +103 -0
 - data/README.txt +37 -0
 - data/bin/kwartz +12 -0
 - data/doc-api/classes/Kwartz.html +218 -0
 - data/doc-api/classes/Kwartz/Assertion.html +140 -0
 - data/doc-api/classes/Kwartz/AssertionError.html +148 -0
 - data/doc-api/classes/Kwartz/AttrInfo.html +320 -0
 - data/doc-api/classes/Kwartz/BaseError.html +206 -0
 - data/doc-api/classes/Kwartz/BaseTranslator.html +331 -0
 - data/doc-api/classes/Kwartz/CharacterType.html +212 -0
 - data/doc-api/classes/Kwartz/CommandOptionError.html +154 -0
 - data/doc-api/classes/Kwartz/CommandOptions.html +374 -0
 - data/doc-api/classes/Kwartz/Config.html +150 -0
 - data/doc-api/classes/Kwartz/ConvertError.html +191 -0
 - data/doc-api/classes/Kwartz/Converter.html +252 -0
 - data/doc-api/classes/Kwartz/CssStyleParser.html +483 -0
 - data/doc-api/classes/Kwartz/DocumentRuleset.html +369 -0
 - data/doc-api/classes/Kwartz/ElementExpander.html +325 -0
 - data/doc-api/classes/Kwartz/ElementInfo.html +312 -0
 - data/doc-api/classes/Kwartz/ElementRuleset.html +582 -0
 - data/doc-api/classes/Kwartz/EperlHandler.html +338 -0
 - data/doc-api/classes/Kwartz/EperlTranslator.html +167 -0
 - data/doc-api/classes/Kwartz/ErubisHandler.html +113 -0
 - data/doc-api/classes/Kwartz/ErubisTranslator.html +168 -0
 - data/doc-api/classes/Kwartz/ErubyHandler.html +337 -0
 - data/doc-api/classes/Kwartz/ErubyTranslator.html +167 -0
 - data/doc-api/classes/Kwartz/ExpandStatement.html +227 -0
 - data/doc-api/classes/Kwartz/Expression.html +119 -0
 - data/doc-api/classes/Kwartz/Handler.html +558 -0
 - data/doc-api/classes/Kwartz/JstlHandler.html +657 -0
 - data/doc-api/classes/Kwartz/JstlTranslator.html +226 -0
 - data/doc-api/classes/Kwartz/KwartzError.html +146 -0
 - data/doc-api/classes/Kwartz/Main.html +384 -0
 - data/doc-api/classes/Kwartz/NativeExpression.html +236 -0
 - data/doc-api/classes/Kwartz/NativeStatement.html +254 -0
 - data/doc-api/classes/Kwartz/Node.html +156 -0
 - data/doc-api/classes/Kwartz/ParseError.html +148 -0
 - data/doc-api/classes/Kwartz/PhpHandler.html +333 -0
 - data/doc-api/classes/Kwartz/PhpTranslator.html +194 -0
 - data/doc-api/classes/Kwartz/PresentationLogicParser.html +830 -0
 - data/doc-api/classes/Kwartz/PrintStatement.html +221 -0
 - data/doc-api/classes/Kwartz/RailsHandler.html +587 -0
 - data/doc-api/classes/Kwartz/RailsTranslator.html +167 -0
 - data/doc-api/classes/Kwartz/RubyStyleParser.html +558 -0
 - data/doc-api/classes/Kwartz/Ruleset.html +117 -0
 - data/doc-api/classes/Kwartz/Statement.html +119 -0
 - data/doc-api/classes/Kwartz/StrutsTranslator.html +190 -0
 - data/doc-api/classes/Kwartz/TagInfo.html +314 -0
 - data/doc-api/classes/Kwartz/TextConverter.html +270 -0
 - data/doc-api/classes/Kwartz/Translator.html +318 -0
 - data/doc-api/classes/Test.html +107 -0
 - data/doc-api/classes/Test/Unit.html +101 -0
 - data/doc-api/created.rid +1 -0
 - data/doc-api/files/__/README_txt.html +150 -0
 - data/doc-api/files/kwartz/assert_rb.html +114 -0
 - data/doc-api/files/kwartz/binding/eperl_rb.html +116 -0
 - data/doc-api/files/kwartz/binding/erubis_rb.html +116 -0
 - data/doc-api/files/kwartz/binding/eruby_rb.html +115 -0
 - data/doc-api/files/kwartz/binding/jstl_rb.html +116 -0
 - data/doc-api/files/kwartz/binding/php_rb.html +116 -0
 - data/doc-api/files/kwartz/binding/rails_rb.html +115 -0
 - data/doc-api/files/kwartz/binding/struts_rb.html +117 -0
 - data/doc-api/files/kwartz/config_rb.html +107 -0
 - data/doc-api/files/kwartz/converter_rb.html +119 -0
 - data/doc-api/files/kwartz/error_rb.html +107 -0
 - data/doc-api/files/kwartz/main_rb.html +124 -0
 - data/doc-api/files/kwartz/node_rb.html +114 -0
 - data/doc-api/files/kwartz/parser_rb.html +117 -0
 - data/doc-api/files/kwartz/translator_rb.html +115 -0
 - data/doc-api/files/kwartz/util/assert-text-equal_rb.html +115 -0
 - data/doc-api/files/kwartz/util/testcase-helper_rb.html +115 -0
 - data/doc-api/files/kwartz_rb.html +120 -0
 - data/doc-api/fr_class_index.html +75 -0
 - data/doc-api/fr_file_index.html +45 -0
 - data/doc-api/fr_method_index.html +216 -0
 - data/doc-api/index.html +24 -0
 - data/doc-api/rdoc-style.css +208 -0
 - data/doc/docstyle.css +188 -0
 - data/doc/p-pattern.html +1207 -0
 - data/doc/reference.html +3396 -0
 - data/doc/users-guide.html +1670 -0
 - data/examples/breadcrumbs1/Makefile +15 -0
 - data/examples/breadcrumbs1/breadcrumbs.eruby.plogic +27 -0
 - data/examples/breadcrumbs1/breadcrumbs.html +12 -0
 - data/examples/breadcrumbs1/breadcrumbs.jstl.plogic +28 -0
 - data/examples/breadcrumbs1/breadcrumbs.php.plogic +26 -0
 - data/examples/breadcrumbs1/main.php +12 -0
 - data/examples/breadcrumbs1/main.rb +12 -0
 - data/examples/breadcrumbs2/Makefile +15 -0
 - data/examples/breadcrumbs2/breadcrumbs.eruby.plogic +22 -0
 - data/examples/breadcrumbs2/breadcrumbs.html +14 -0
 - data/examples/breadcrumbs2/breadcrumbs.jstl.plogic +24 -0
 - data/examples/breadcrumbs2/breadcrumbs.php.plogic +23 -0
 - data/examples/breadcrumbs2/main.php +12 -0
 - data/examples/breadcrumbs2/main.rb +12 -0
 - data/examples/pagelayout/Makefile +47 -0
 - data/examples/pagelayout/content.eruby.plogic +44 -0
 - data/examples/pagelayout/content.jstl.plogic +36 -0
 - data/examples/pagelayout/content.php.plogic +37 -0
 - data/examples/pagelayout/content1.html +36 -0
 - data/examples/pagelayout/content2.html +29 -0
 - data/examples/pagelayout/design.css +40 -0
 - data/examples/pagelayout/layout.html +50 -0
 - data/examples/pagelayout/main.php +55 -0
 - data/examples/pagelayout/main.rb +77 -0
 - data/examples/pagelayout/menu.eruby.plogic +14 -0
 - data/examples/pagelayout/menu.html +13 -0
 - data/examples/pagelayout/menu.jstl.plogic +14 -0
 - data/examples/pagelayout/menu.php.plogic +14 -0
 - data/examples/rails1/Makefile +36 -0
 - data/examples/rails1/README +19 -0
 - data/examples/rails1/application_helper.rb +31 -0
 - data/examples/rails1/edit.html +28 -0
 - data/examples/rails1/edit.plogic +10 -0
 - data/examples/rails1/form.html +52 -0
 - data/examples/rails1/form.plogic +33 -0
 - data/examples/rails1/layout.plogic +15 -0
 - data/examples/rails1/link_to.plogic +19 -0
 - data/examples/rails1/list.html +48 -0
 - data/examples/rails1/list.plogic +28 -0
 - data/examples/rails1/new.html +27 -0
 - data/examples/rails1/new.plogic +10 -0
 - data/examples/rails1/reader.plogic +29 -0
 - data/examples/rails1/show.html +40 -0
 - data/examples/rails1/show.plogic +4 -0
 - data/examples/rails1/writer.plogic +8 -0
 - data/examples/table1/Makefile +15 -0
 - data/examples/table1/main.php +11 -0
 - data/examples/table1/main.rb +11 -0
 - data/examples/table1/table1.eruby.plogic +21 -0
 - data/examples/table1/table1.html +16 -0
 - data/examples/table1/table1.jstl.plogic +21 -0
 - data/examples/table1/table1.php.plogic +22 -0
 - data/kwartz.gemspec +55 -0
 - data/lib/kwartz.rb +13 -0
 - data/lib/kwartz/assert.rb +31 -0
 - data/lib/kwartz/binding/eperl.rb +166 -0
 - data/lib/kwartz/binding/erubis.rb +61 -0
 - data/lib/kwartz/binding/eruby.rb +164 -0
 - data/lib/kwartz/binding/jstl.rb +334 -0
 - data/lib/kwartz/binding/php.rb +167 -0
 - data/lib/kwartz/binding/rails.rb +295 -0
 - data/lib/kwartz/binding/struts.rb +109 -0
 - data/lib/kwartz/config.rb +28 -0
 - data/lib/kwartz/converter.rb +920 -0
 - data/lib/kwartz/error.rb +41 -0
 - data/lib/kwartz/main.rb +464 -0
 - data/lib/kwartz/node.rb +454 -0
 - data/lib/kwartz/parser.rb +903 -0
 - data/lib/kwartz/translator.rb +153 -0
 - data/lib/kwartz/util/assert-text-equal.rb +44 -0
 - data/lib/kwartz/util/testcase-helper.rb +112 -0
 - data/setup.rb +1331 -0
 - data/test/test-compile.rb +36 -0
 - data/test/test-compile.yaml +178 -0
 - data/test/test-converter.rb +34 -0
 - data/test/test-converter.yaml +127 -0
 - data/test/test-directives.rb +32 -0
 - data/test/test-directives.yaml +1411 -0
 - data/test/test-main.rb +464 -0
 - data/test/test-parser.rb +54 -0
 - data/test/test-parser.yaml +394 -0
 - data/test/test-rails.rb +28 -0
 - data/test/test-rails.yaml +301 -0
 - data/test/test-ruleset.rb +36 -0
 - data/test/test-ruleset.yaml +804 -0
 - data/test/test.rb +44 -0
 - metadata +236 -0
 
| 
         @@ -0,0 +1,36 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
         
     | 
| 
      
 2 
     | 
    
         
            +
            <html>
         
     | 
| 
      
 3 
     | 
    
         
            +
              <body>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
                <h1 id="mark:pagetitle">Stock Quoting</h1>
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                <table id="mark:content">
         
     | 
| 
      
 8 
     | 
    
         
            +
                  <thead>
         
     | 
| 
      
 9 
     | 
    
         
            +
                    <tr>
         
     | 
| 
      
 10 
     | 
    
         
            +
                      <th>Symbol</th><th>Company</th><th>Price</th><th>Change</th>
         
     | 
| 
      
 11 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 12 
     | 
    
         
            +
                  </thead>
         
     | 
| 
      
 13 
     | 
    
         
            +
                  <tbody>
         
     | 
| 
      
 14 
     | 
    
         
            +
                    <tr id="mark:stocks">
         
     | 
| 
      
 15 
     | 
    
         
            +
                      <td><a href="#" id="mark:stock_symbol_link">AAAA</a></td>
         
     | 
| 
      
 16 
     | 
    
         
            +
                      <td id="mark:stock_company">AAAA Corp.</td>
         
     | 
| 
      
 17 
     | 
    
         
            +
                      <td id="mark:stock_price" align="right">11.11</td>
         
     | 
| 
      
 18 
     | 
    
         
            +
                      <td id="mark:stock_rate" align="right">1.11%</td>
         
     | 
| 
      
 19 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 20 
     | 
    
         
            +
                    <tr id="dummy:s1">
         
     | 
| 
      
 21 
     | 
    
         
            +
                      <td>BBBB</td>
         
     | 
| 
      
 22 
     | 
    
         
            +
                      <td>BBBB Corp.</td>
         
     | 
| 
      
 23 
     | 
    
         
            +
                      <td align="right">22.22</td>
         
     | 
| 
      
 24 
     | 
    
         
            +
                      <td align="right">2.22%</td>
         
     | 
| 
      
 25 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 26 
     | 
    
         
            +
                    <tr id="dummy:s2">
         
     | 
| 
      
 27 
     | 
    
         
            +
                      <td>CCCC</td>
         
     | 
| 
      
 28 
     | 
    
         
            +
                      <td>CCCC Corp.</td>
         
     | 
| 
      
 29 
     | 
    
         
            +
                      <td align="right">33.33</td>
         
     | 
| 
      
 30 
     | 
    
         
            +
                      <td align="right" class="minus">3.33%</td>
         
     | 
| 
      
 31 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 32 
     | 
    
         
            +
                  </tbody>
         
     | 
| 
      
 33 
     | 
    
         
            +
                </table>
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
              </body>
         
     | 
| 
      
 36 
     | 
    
         
            +
            </html>
         
     | 
| 
         @@ -0,0 +1,29 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
         
     | 
| 
      
 2 
     | 
    
         
            +
            <html>
         
     | 
| 
      
 3 
     | 
    
         
            +
              <body>
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
                <h1 id="mark:pagetitle">Quoting Detail</h1>
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
                <table id="mark:content">
         
     | 
| 
      
 8 
     | 
    
         
            +
                  <tbody id="mark:stock">
         
     | 
| 
      
 9 
     | 
    
         
            +
                    <tr>
         
     | 
| 
      
 10 
     | 
    
         
            +
                      <th class="label">Symbol:</th>
         
     | 
| 
      
 11 
     | 
    
         
            +
                      <td id="mark:stock_symbol">AAAA</td>
         
     | 
| 
      
 12 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 13 
     | 
    
         
            +
                    <tr>
         
     | 
| 
      
 14 
     | 
    
         
            +
                      <th class="label">Company:</th>
         
     | 
| 
      
 15 
     | 
    
         
            +
                      <td id="mark:stock_company">AAAA Corp.</td>
         
     | 
| 
      
 16 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 17 
     | 
    
         
            +
                    <tr>
         
     | 
| 
      
 18 
     | 
    
         
            +
                      <th class="label">Price:</th>
         
     | 
| 
      
 19 
     | 
    
         
            +
                      <td id="mark:stock_price">11.11</td>
         
     | 
| 
      
 20 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 21 
     | 
    
         
            +
                    <tr>
         
     | 
| 
      
 22 
     | 
    
         
            +
                      <th class="label">Change:</th>
         
     | 
| 
      
 23 
     | 
    
         
            +
                      <td id="mark:stock_rate">1.11%</td>
         
     | 
| 
      
 24 
     | 
    
         
            +
                    </tr>
         
     | 
| 
      
 25 
     | 
    
         
            +
                  </tbody>
         
     | 
| 
      
 26 
     | 
    
         
            +
                </table>
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
              </body>
         
     | 
| 
      
 29 
     | 
    
         
            +
            </html>
         
     | 
| 
         @@ -0,0 +1,40 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            body {
         
     | 
| 
      
 2 
     | 
    
         
            +
                background-color: #FFFFFF;
         
     | 
| 
      
 3 
     | 
    
         
            +
            }
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            ul  {
         
     | 
| 
      
 6 
     | 
    
         
            +
                margin:        0px;
         
     | 
| 
      
 7 
     | 
    
         
            +
                padding-left:  15px;
         
     | 
| 
      
 8 
     | 
    
         
            +
            }
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            #pain-table {
         
     | 
| 
      
 11 
     | 
    
         
            +
                border-width:  0;
         
     | 
| 
      
 12 
     | 
    
         
            +
            }
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            #menu-pain, #content-pain {
         
     | 
| 
      
 15 
     | 
    
         
            +
                border-style:  solid;
         
     | 
| 
      
 16 
     | 
    
         
            +
                border-color:  #006699;
         
     | 
| 
      
 17 
     | 
    
         
            +
                border-width:  2px;
         
     | 
| 
      
 18 
     | 
    
         
            +
                padding:       10px;
         
     | 
| 
      
 19 
     | 
    
         
            +
            }
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            #footer-pain {
         
     | 
| 
      
 22 
     | 
    
         
            +
                text-align:    center;
         
     | 
| 
      
 23 
     | 
    
         
            +
                color:         #FFFFFF;
         
     | 
| 
      
 24 
     | 
    
         
            +
                background-color:  #006699;
         
     | 
| 
      
 25 
     | 
    
         
            +
            }
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            .minus {
         
     | 
| 
      
 28 
     | 
    
         
            +
                color:         #FF0000;
         
     | 
| 
      
 29 
     | 
    
         
            +
            }
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            th.label {
         
     | 
| 
      
 32 
     | 
    
         
            +
                text-align:    left;
         
     | 
| 
      
 33 
     | 
    
         
            +
            }
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            .menulist {
         
     | 
| 
      
 36 
     | 
    
         
            +
            }
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
            .contents {
         
     | 
| 
      
 39 
     | 
    
         
            +
            }
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,50 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <?xml version="1.0" encoding="UTF-8"?>
         
     | 
| 
      
 2 
     | 
    
         
            +
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         
     | 
| 
      
 3 
     | 
    
         
            +
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         
     | 
| 
      
 4 
     | 
    
         
            +
            <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
         
     | 
| 
      
 5 
     | 
    
         
            +
              <head>
         
     | 
| 
      
 6 
     | 
    
         
            +
                <title id="replace_content_with_content:pagetitle">pagetitle</title>
         
     | 
| 
      
 7 
     | 
    
         
            +
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
         
     | 
| 
      
 8 
     | 
    
         
            +
                <link rel="stylesheet" type="text/css" href="design.css" />
         
     | 
| 
      
 9 
     | 
    
         
            +
              </head>
         
     | 
| 
      
 10 
     | 
    
         
            +
              <body>
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
                <table summary="" id="pain-table">
         
     | 
| 
      
 13 
     | 
    
         
            +
                  <tr>
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
                    <td width="100" valign="top" id="menu-pain">
         
     | 
| 
      
 16 
     | 
    
         
            +
                      <b>Menu:</b>
         
     | 
| 
      
 17 
     | 
    
         
            +
                      <!-- menu -->
         
     | 
| 
      
 18 
     | 
    
         
            +
                      <div id="replace_element_with_element:menulist">
         
     | 
| 
      
 19 
     | 
    
         
            +
                        * menu1 <br />
         
     | 
| 
      
 20 
     | 
    
         
            +
                        * menu2 <br />
         
     | 
| 
      
 21 
     | 
    
         
            +
                        * menu3 <br />
         
     | 
| 
      
 22 
     | 
    
         
            +
                        * menu4 <br />
         
     | 
| 
      
 23 
     | 
    
         
            +
                      </div>
         
     | 
| 
      
 24 
     | 
    
         
            +
                      <!-- /menu -->
         
     | 
| 
      
 25 
     | 
    
         
            +
                    </td>
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                    <td width="400" valign="top" id="content-pain">
         
     | 
| 
      
 28 
     | 
    
         
            +
                      <h3 id="replace_content_with_content:pagetitle">...title...</h3>
         
     | 
| 
      
 29 
     | 
    
         
            +
                      <!-- content -->
         
     | 
| 
      
 30 
     | 
    
         
            +
                      <div id="replace_element_with_element:content">
         
     | 
| 
      
 31 
     | 
    
         
            +
                        content<br />
         
     | 
| 
      
 32 
     | 
    
         
            +
                        content<br />
         
     | 
| 
      
 33 
     | 
    
         
            +
                        content<br />
         
     | 
| 
      
 34 
     | 
    
         
            +
                        content<br />
         
     | 
| 
      
 35 
     | 
    
         
            +
                      </div>
         
     | 
| 
      
 36 
     | 
    
         
            +
                      <!-- /content -->
         
     | 
| 
      
 37 
     | 
    
         
            +
                    </td>
         
     | 
| 
      
 38 
     | 
    
         
            +
             
     | 
| 
      
 39 
     | 
    
         
            +
                  </tr>
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
                  <tr>
         
     | 
| 
      
 42 
     | 
    
         
            +
                    <td colspan="2" id="footer-pain">
         
     | 
| 
      
 43 
     | 
    
         
            +
                      copyright© 2004-2006 kuwata-lab.com all rights reserved
         
     | 
| 
      
 44 
     | 
    
         
            +
                    </td>
         
     | 
| 
      
 45 
     | 
    
         
            +
                  </tr>
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
                </table>
         
     | 
| 
      
 48 
     | 
    
         
            +
             
     | 
| 
      
 49 
     | 
    
         
            +
              </body>
         
     | 
| 
      
 50 
     | 
    
         
            +
            </html>
         
     | 
| 
         @@ -0,0 +1,55 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            <?php
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            // menu
         
     | 
| 
      
 4 
     | 
    
         
            +
            $menulist = array(
         
     | 
| 
      
 5 
     | 
    
         
            +
                array('label' => 'Mail',     'url' => '/cgi-bin/mail.cgi'     ),
         
     | 
| 
      
 6 
     | 
    
         
            +
                array('label' => 'Calnedar', 'url' => '/cgi-bin/calendar.cgi' ),
         
     | 
| 
      
 7 
     | 
    
         
            +
                array('label' => 'Todo',     'url' => '/cgi-bin/todo.cgi'     ),
         
     | 
| 
      
 8 
     | 
    
         
            +
                array('label' => 'Stock',    'url' => '/cgi-bin/stock.cgi'    ),
         
     | 
| 
      
 9 
     | 
    
         
            +
                );
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            // contents data
         
     | 
| 
      
 13 
     | 
    
         
            +
            $stocks = array(
         
     | 
| 
      
 14 
     | 
    
         
            +
                array('symbol' => "AAPL", 'price' => 62.94, 'rate' => -0.23,
         
     | 
| 
      
 15 
     | 
    
         
            +
                      'company' => "Apple Computer, Inc." ),
         
     | 
| 
      
 16 
     | 
    
         
            +
                array('symbol' => "MSFT", 'price' => 22.53, 'rate' =>  0.64,
         
     | 
| 
      
 17 
     | 
    
         
            +
                      'company' => "Microsoft Corp." ),
         
     | 
| 
      
 18 
     | 
    
         
            +
                array('symbol' => "ORCL", 'price' => 12.89, 'rate' => -2.02,
         
     | 
| 
      
 19 
     | 
    
         
            +
                      'company' => "Oracle Corporation" ),
         
     | 
| 
      
 20 
     | 
    
         
            +
                array('symbol' => "SUNW", 'price' =>  4.12, 'rate' =>  0.28,
         
     | 
| 
      
 21 
     | 
    
         
            +
                      'company' => "Sun Microsystems, Inc." ),
         
     | 
| 
      
 22 
     | 
    
         
            +
                array('symbol' => "INTC", 'price' => 18.61, 'rate' =>  1.01,
         
     | 
| 
      
 23 
     | 
    
         
            +
                      'company' => "Intel Corporation" ),
         
     | 
| 
      
 24 
     | 
    
         
            +
                );
         
     | 
| 
      
 25 
     | 
    
         
            +
             
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            // stock symbol
         
     | 
| 
      
 28 
     | 
    
         
            +
            $symbol = NULL;
         
     | 
| 
      
 29 
     | 
    
         
            +
            if ($_REQUEST['symbol']) {
         
     | 
| 
      
 30 
     | 
    
         
            +
                $symbol = $_REQUEST['symbol'];
         
     | 
| 
      
 31 
     | 
    
         
            +
            } elseif ($argv[1]) {
         
     | 
| 
      
 32 
     | 
    
         
            +
                $symbol = $argv[1];
         
     | 
| 
      
 33 
     | 
    
         
            +
            } else {
         
     | 
| 
      
 34 
     | 
    
         
            +
                $symbol = NULL;
         
     | 
| 
      
 35 
     | 
    
         
            +
            }
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
            // filename
         
     | 
| 
      
 38 
     | 
    
         
            +
            if ($symbol) {
         
     | 
| 
      
 39 
     | 
    
         
            +
                $stock = NULL;
         
     | 
| 
      
 40 
     | 
    
         
            +
                foreach ($stocks as $arr) {
         
     | 
| 
      
 41 
     | 
    
         
            +
                    if ($arr['symbol'] == $symbol) {
         
     | 
| 
      
 42 
     | 
    
         
            +
                        $stock = $arr;
         
     | 
| 
      
 43 
     | 
    
         
            +
                        break;
         
     | 
| 
      
 44 
     | 
    
         
            +
                    }
         
     | 
| 
      
 45 
     | 
    
         
            +
                }
         
     | 
| 
      
 46 
     | 
    
         
            +
                $filename = 'content2.php';
         
     | 
| 
      
 47 
     | 
    
         
            +
            } else {
         
     | 
| 
      
 48 
     | 
    
         
            +
                $filename = 'content1.php';
         
     | 
| 
      
 49 
     | 
    
         
            +
            }
         
     | 
| 
      
 50 
     | 
    
         
            +
             
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
            // output
         
     | 
| 
      
 53 
     | 
    
         
            +
            include($filename);
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
            ?>
         
     | 
| 
         @@ -0,0 +1,77 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #!/usr/bin/env ruby
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            ## menu
         
     | 
| 
      
 4 
     | 
    
         
            +
            menulist = [
         
     | 
| 
      
 5 
     | 
    
         
            +
              { :label => 'Mail',     :url => '/cgi-bin/mail.cgi' },
         
     | 
| 
      
 6 
     | 
    
         
            +
              { :label => 'Calnedar', :url => '/cgi-bin/calendar.cgi' },
         
     | 
| 
      
 7 
     | 
    
         
            +
              { :label => 'Todo',     :url => '/cgi-bin/todo.cgi' },
         
     | 
| 
      
 8 
     | 
    
         
            +
              { :label => 'Stock',    :url => '/cgi-bin/stock.cgi' },
         
     | 
| 
      
 9 
     | 
    
         
            +
            ]
         
     | 
| 
      
 10 
     | 
    
         
            +
            #table = [
         
     | 
| 
      
 11 
     | 
    
         
            +
            #  ["Mail"     , "/cgi-bin/mail.cgi"],
         
     | 
| 
      
 12 
     | 
    
         
            +
            #  ["Calendar" , "/cgi-bin/calendar.cgi"],
         
     | 
| 
      
 13 
     | 
    
         
            +
            #  ["Todo"     , "/cgi-bin/todo.cgi"],
         
     | 
| 
      
 14 
     | 
    
         
            +
            #  ["Stock"    , "/cgi-bin/stock.cgi"],
         
     | 
| 
      
 15 
     | 
    
         
            +
            #]
         
     | 
| 
      
 16 
     | 
    
         
            +
            #@menulist = table.collect do |label, url|
         
     | 
| 
      
 17 
     | 
    
         
            +
            #  { :label=>label, :url=>url }
         
     | 
| 
      
 18 
     | 
    
         
            +
            #end
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            ## contents data
         
     | 
| 
      
 22 
     | 
    
         
            +
            stocks = [
         
     | 
| 
      
 23 
     | 
    
         
            +
              { :symbol => "AAPL", :price => 62.94, :rate => -0.23,
         
     | 
| 
      
 24 
     | 
    
         
            +
                :company => "Apple Computer, Inc." },
         
     | 
| 
      
 25 
     | 
    
         
            +
              { :symbol => "MSFT", :price => 22.53, :rate => 0.64,
         
     | 
| 
      
 26 
     | 
    
         
            +
                :company => "Microsoft Corp." },
         
     | 
| 
      
 27 
     | 
    
         
            +
              { :symbol => "ORCL", :price => 12.89, :rate => -2.02,
         
     | 
| 
      
 28 
     | 
    
         
            +
                :company => "Oracle Corporation" },
         
     | 
| 
      
 29 
     | 
    
         
            +
              { :symbol => "SUNW", :price =>  4.12, :rate => 0.28,
         
     | 
| 
      
 30 
     | 
    
         
            +
                :company => "Sun Microsystems, Inc." },
         
     | 
| 
      
 31 
     | 
    
         
            +
              { :symbol => "INTC", :price => 18.61, :rate => 1.01,
         
     | 
| 
      
 32 
     | 
    
         
            +
                :company => "Intel Corporation" },
         
     | 
| 
      
 33 
     | 
    
         
            +
            ]
         
     | 
| 
      
 34 
     | 
    
         
            +
            #table = [
         
     | 
| 
      
 35 
     | 
    
         
            +
            #  ["AAPL", 62.94,  1.23, "Apple Computer, Inc."  ],
         
     | 
| 
      
 36 
     | 
    
         
            +
            #  ["MSFT", 22.53,  0.44, "Microsoft Corp."       ],
         
     | 
| 
      
 37 
     | 
    
         
            +
            #  ["ORCL", 12.89, -2.02, "Oracle Corporation"    ],
         
     | 
| 
      
 38 
     | 
    
         
            +
            #  ["SUNW",  4.12,  0.28, "Sun Microsystems, Inc."],
         
     | 
| 
      
 39 
     | 
    
         
            +
            #]
         
     | 
| 
      
 40 
     | 
    
         
            +
            #@stocks = table.collect do |symbol, price, rate, company|
         
     | 
| 
      
 41 
     | 
    
         
            +
            #  { :symbol=>symbol, :price=>price, :rate=>rate, :company=>company }
         
     | 
| 
      
 42 
     | 
    
         
            +
            #end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
            ## page filename
         
     | 
| 
      
 46 
     | 
    
         
            +
            cgi = nil
         
     | 
| 
      
 47 
     | 
    
         
            +
            symbol = nil
         
     | 
| 
      
 48 
     | 
    
         
            +
            if ENV['SCRIPT_NAME']
         
     | 
| 
      
 49 
     | 
    
         
            +
              require 'cgi'
         
     | 
| 
      
 50 
     | 
    
         
            +
              cgi = CGI.new
         
     | 
| 
      
 51 
     | 
    
         
            +
              symbol = cgi.params['symbol'].first
         
     | 
| 
      
 52 
     | 
    
         
            +
            elsif ARGV[0]
         
     | 
| 
      
 53 
     | 
    
         
            +
              symbol = ARGV[0]
         
     | 
| 
      
 54 
     | 
    
         
            +
            end
         
     | 
| 
      
 55 
     | 
    
         
            +
            if symbol
         
     | 
| 
      
 56 
     | 
    
         
            +
              stock = stocks.find { |hash| hash[:symbol] == symbol }
         
     | 
| 
      
 57 
     | 
    
         
            +
              filename = 'content2.rhtml'
         
     | 
| 
      
 58 
     | 
    
         
            +
            else
         
     | 
| 
      
 59 
     | 
    
         
            +
              filename = 'content1.rhtml'
         
     | 
| 
      
 60 
     | 
    
         
            +
            end
         
     | 
| 
      
 61 
     | 
    
         
            +
             
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
            ## context object
         
     | 
| 
      
 64 
     | 
    
         
            +
            context = Object.new
         
     | 
| 
      
 65 
     | 
    
         
            +
            context.instance_variable_set("@menulist", menulist)
         
     | 
| 
      
 66 
     | 
    
         
            +
            context.instance_variable_set("@stocks", stocks)
         
     | 
| 
      
 67 
     | 
    
         
            +
            context.instance_variable_set("@stock", stock) if stock
         
     | 
| 
      
 68 
     | 
    
         
            +
            require 'erb'
         
     | 
| 
      
 69 
     | 
    
         
            +
            context.extend ERB::Util
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
             
     | 
| 
      
 72 
     | 
    
         
            +
            ## output
         
     | 
| 
      
 73 
     | 
    
         
            +
            str = File.open(filename) { |f| f.read() }
         
     | 
| 
      
 74 
     | 
    
         
            +
            trim_mode = 1
         
     | 
| 
      
 75 
     | 
    
         
            +
            erb = ERB.new(str, $SAFE, trim_mode)
         
     | 
| 
      
 76 
     | 
    
         
            +
            print cgi.header if cgi
         
     | 
| 
      
 77 
     | 
    
         
            +
            print context.instance_eval(erb.src, filename)
         
     | 
| 
         @@ -0,0 +1,36 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
             
     | 
| 
      
 2 
     | 
    
         
            +
            kwartz = kwartz -l rails
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            ALL = _form.rhtml layout.rhtml new.rhtml edit.rhtml show.rhtml list.rhtml
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            all:   $(ALL)
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            clean:
         
     | 
| 
      
 9 
     | 
    
         
            +
            	rm -f $(ALL)
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            check:
         
     | 
| 
      
 12 
     | 
    
         
            +
            	for i in $(ALL) ; do \
         
     | 
| 
      
 13 
     | 
    
         
            +
            	  cmd="erb -xT - $$i | ruby -ne 'print \$$line; \$$line=\$$_' | ruby -wc" ; \
         
     | 
| 
      
 14 
     | 
    
         
            +
            	  echo -n $$i ' ... '; \
         
     | 
| 
      
 15 
     | 
    
         
            +
            	  eval $$cmd; \
         
     | 
| 
      
 16 
     | 
    
         
            +
            	done
         
     | 
| 
      
 17 
     | 
    
         
            +
            #	  echo $$cmd ; \
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            _form.rhtml:   form.plogic form.html
         
     | 
| 
      
 20 
     | 
    
         
            +
            	$(kwartz) -x form_content -p form.plogic form.html > _form.rhtml
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
            layout.rhtml:  form.plogic form.html
         
     | 
| 
      
 23 
     | 
    
         
            +
            	$(kwartz) -p form.plogic form.html > layout.rhtml
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            new.rhtml:  new.html new.plogic form.html
         
     | 
| 
      
 26 
     | 
    
         
            +
            	$(kwartz) -x page_content -p new.plogic -i form.html new.html > new.rhtml
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
            edit.rhtml:  edit.html edit.plogic form.html
         
     | 
| 
      
 29 
     | 
    
         
            +
            	$(kwartz) -x page_content -p edit.plogic -i form.html edit.html > edit.rhtml
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            show.rhtml:  show.html show.plogic
         
     | 
| 
      
 32 
     | 
    
         
            +
            	$(kwartz) -x page_content -p show.plogic show.html > show.rhtml
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
            list.rhtml:  list.html list.plogic
         
     | 
| 
      
 35 
     | 
    
         
            +
            	$(kwartz) -x page_content -p list.plogic list.html > list.rhtml
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
             
     | 
| 
      
 2 
     | 
    
         
            +
            Just type 'make' and you'll get *.rhtml files.
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Manifest:
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              * form.html, form.plogic  -  form design file for new.rhtml and edit.rhtml,
         
     | 
| 
      
 8 
     | 
    
         
            +
                                             and presentation data/logic file for layout.rhtml
         
     | 
| 
      
 9 
     | 
    
         
            +
              * reader.plogic           -  common presentation logic for show.rhtml and list.rhtml
         
     | 
| 
      
 10 
     | 
    
         
            +
              * writer.plogic           -  common presentation logic for new.rhtml and edit.rhtml
         
     | 
| 
      
 11 
     | 
    
         
            +
              * layout.plogic           -  presentation logic for layout.rhtml
         
     | 
| 
      
 12 
     | 
    
         
            +
              * link_to.plogic          -  presentation logic for 'start_link_to' helper
         
     | 
| 
      
 13 
     | 
    
         
            +
              * application_helper.rb   -  helper module in which 'start_link_to' is defined
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
              * edit.html, edit.plogic  -  presentation data/logic file for edit.rhtml
         
     | 
| 
      
 16 
     | 
    
         
            +
              * new.html,  new.plogic   -  presentation data/logic file for new.rhtml
         
     | 
| 
      
 17 
     | 
    
         
            +
              * show.html, show.plogic  -  presentation data/logic file for show.rhtml
         
     | 
| 
      
 18 
     | 
    
         
            +
              * list.html, list.plogic  -  presentation data/logic file for list.rhtml
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,31 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Methods added to this helper will be available to all templates in the application.
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            module ApplicationHelper
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              ##
         
     | 
| 
      
 8 
     | 
    
         
            +
              ## print only start-tag
         
     | 
| 
      
 9 
     | 
    
         
            +
              ##
         
     | 
| 
      
 10 
     | 
    
         
            +
              ## ex.
         
     | 
| 
      
 11 
     | 
    
         
            +
              ##   <%= start_link_to :action=>'new' %>Create new member</a>
         
     | 
| 
      
 12 
     | 
    
         
            +
              ##    #=>  <a href="/member/new">Create new member</a>
         
     | 
| 
      
 13 
     | 
    
         
            +
              ##
         
     | 
| 
      
 14 
     | 
    
         
            +
              def start_link_to(options = {}, html_options = nil, *parameters_for_method_reference)
         
     | 
| 
      
 15 
     | 
    
         
            +
                s = link_to('', options, html_options, *parameters_for_method_reference)
         
     | 
| 
      
 16 
     | 
    
         
            +
                s.sub!(/<\/a>\z/, '')
         
     | 
| 
      
 17 
     | 
    
         
            +
              end
         
     | 
| 
      
 18 
     | 
    
         
            +
              alias anchor start_link_to
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
              ##
         
     | 
| 
      
 22 
     | 
    
         
            +
              ## print only start tag
         
     | 
| 
      
 23 
     | 
    
         
            +
              ##
         
     | 
| 
      
 24 
     | 
    
         
            +
              def start_link_to_remote(options = {}, html_options = {})
         
     | 
| 
      
 25 
     | 
    
         
            +
                s = link_to_remote(options, html_options)
         
     | 
| 
      
 26 
     | 
    
         
            +
                s.sub!(/<\/a>\z/, '')
         
     | 
| 
      
 27 
     | 
    
         
            +
              end
         
     | 
| 
      
 28 
     | 
    
         
            +
              alias anchor_remote start_link_to_remote
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            end
         
     |