runo 0.1.0 → 0.1.1
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/README.rdoc +6 -2
- data/lib/_parser.rb +4 -4
- data/lib/_storage/sequel.rb +1 -1
- data/lib/runo.rb +1 -1
- data/lib/set/dynamic.rb +1 -1
- data/skel/skin/_users/index.html +1 -1
- data/skel/skin/_users/summary.html +1 -1
- data/skel/skin/examples/blog/index.html +2 -2
- data/skel/skin/examples/blog/rss.xml +1 -1
- data/skel/skin/examples/contact/index.html +1 -1
- data/skel/skin/examples/contact/summary.html +2 -2
- data/skel/skin/examples/forum/index.html +2 -2
- data/skel/skin/examples/forum/summary.html +2 -2
- data/skel/skin/examples/index.html +2 -2
- data/skel/skin/index.html +1 -1
- data/t/skin/_users/index.html +1 -1
- data/t/skin/foo/index.html +4 -4
- data/t/skin/t_attachment/index.html +3 -3
- data/t/skin/t_contact/index.html +1 -1
- data/t/skin/t_file/index.html +2 -2
- data/t/skin/t_img/index.html +2 -2
- data/t/skin/t_select/index.html +1 -1
- data/t/skin/t_store/index.html +1 -1
- data/t/skin/t_summary/create.html +1 -1
- data/t/skin/t_summary/index.html +1 -1
- data/t/skin/t_summary/summary.html +1 -1
- data/t/test_parser.rb +115 -57
- data/t/test_runo_call.rb +5 -5
- data/t/test_set_complex.rb +19 -19
- data/t/test_set_dynamic.rb +15 -15
- data/t/test_set_folder.rb +6 -6
- data/t/test_set_static.rb +3 -3
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -3,10 +3,14 @@
|
|
3
3
|
Runo is the easiest web application framework ever.
|
4
4
|
You can make various apps such like blog, forum, contact form by putting single (or several) HTML file with a bit of special markups. The view rules. There is no model definition, no server restart, and no coding at all.
|
5
5
|
|
6
|
+
== Wiki
|
7
|
+
|
8
|
+
http://wiki.github.com/afunai/runo/
|
9
|
+
|
6
10
|
== Features
|
7
11
|
|
8
12
|
* Model / View / Controller defined dynamically by good old HTML.
|
9
|
-
* Any block tags (<ul>, <table> etc.) can be an "app", by adding a workflow class like "
|
13
|
+
* Any block tags (<ul>, <table> etc.) can be an "app", by adding a workflow class like "app-blog".
|
10
14
|
* The contents inside the app tag will be the "model".
|
11
15
|
* The model is defined by special tags, like "$(foo = text 1..32)" or "$(bar = select a,b,c)".
|
12
16
|
* You can make nested apps inside an app (e.g. blog comments inside a blog entry).
|
@@ -81,7 +85,7 @@ The content is: (You can just copy & paste, of course)
|
|
81
85
|
<body>
|
82
86
|
<h1><a href=".">fab forum</a></h1>
|
83
87
|
|
84
|
-
<ul id="main" class="
|
88
|
+
<ul id="main" class="app-forum">
|
85
89
|
<!-- 1..5 desc may_preview -->
|
86
90
|
<li>
|
87
91
|
<h2>$(title = text 32 1..32)</h2>
|
data/lib/_parser.rb
CHANGED
@@ -10,7 +10,7 @@ module Runo::Parser
|
|
10
10
|
def parse_html(html, action = :index, xml = false)
|
11
11
|
item = {}
|
12
12
|
|
13
|
-
html = gsub_block(html, 'runo-\w+') {|open, inner, close|
|
13
|
+
html = gsub_block(html, '(?:app|runo)-\w+') {|open, inner, close| # "runo" is obsolete at 0.1.1
|
14
14
|
id = open[/id="(.+?)"/i, 1] || 'main'
|
15
15
|
item[id] = parse_block(open, inner, close, action, xml)
|
16
16
|
"$(#{id})"
|
@@ -143,11 +143,11 @@ module Runo::Parser
|
|
143
143
|
|
144
144
|
def parse_block(open_tag, inner_html, close_tag, action = :index, xml = false)
|
145
145
|
open_tag.sub!(/id=".*?"/i, 'id="@(name)"')
|
146
|
-
workflow = open_tag[/class=(?:"|".*?\s)runo-(\w+)/, 1]
|
146
|
+
workflow = open_tag[/class=(?:"|".*?\s)(?:app|runo)-(\w+)/, 1] # "runo" is obsolete at 0.1.1
|
147
147
|
|
148
|
-
if inner_html =~ /<(
|
148
|
+
if inner_html =~ /<(?:\w+).+?class=(?:"|"[^"]*?\s)(model|body)(?:"|\s)/i # "body" is obsolete at 0.1.1
|
149
149
|
item_html = ''
|
150
|
-
sd_tmpl = gsub_block(inner_html,
|
150
|
+
sd_tmpl = gsub_block(inner_html, Regexp.last_match(1)) {|open, inner, close|
|
151
151
|
item_html = open + inner + close
|
152
152
|
'$()'
|
153
153
|
}
|
data/lib/_storage/sequel.rb
CHANGED
@@ -24,7 +24,7 @@ class Runo::Storage::Sequel < Runo::Storage
|
|
24
24
|
String :ext
|
25
25
|
String :owner
|
26
26
|
String :body
|
27
|
-
|
27
|
+
File :binary_body
|
28
28
|
primary_key :full_name
|
29
29
|
} unless @db.table_exists? :runo_main
|
30
30
|
Runo::Storage::File.traverse('/', Runo['skin_dir']) {|entry|
|
data/lib/runo.rb
CHANGED
data/lib/set/dynamic.rb
CHANGED
data/skel/skin/_users/index.html
CHANGED
@@ -23,13 +23,13 @@
|
|
23
23
|
</div>
|
24
24
|
|
25
25
|
<div id="center" class="column">
|
26
|
-
<ul id="main" class="
|
26
|
+
<ul id="main" class="app-blog">
|
27
27
|
<!-- 1..5 may_preview -->
|
28
28
|
<li>
|
29
29
|
<div class="label">$(title = text 32 1..32)</div>
|
30
30
|
<div class="ibody">
|
31
31
|
$(body = textarea-wiki 60*10 1..)
|
32
|
-
<div id="a" class="
|
32
|
+
<div id="a" class="app-attachment">$(f = img 64*64 1..9000)<br/></div>
|
33
33
|
<div>by $(_owner) @ $(_timestamp meta-timestamp can_update)</div>
|
34
34
|
$(.action_update)
|
35
35
|
</div>
|
@@ -21,14 +21,14 @@
|
|
21
21
|
</div>
|
22
22
|
|
23
23
|
<div id="center" class="column">
|
24
|
-
<table id="main" class="
|
24
|
+
<table id="main" class="app-contact summary" style="border: 1px solid black;">
|
25
25
|
<tr>
|
26
26
|
<th>Name</th>
|
27
27
|
<th>Email</th>
|
28
28
|
<th>Favorite</th>
|
29
29
|
<th>Rating</th>
|
30
30
|
</tr>
|
31
|
-
<tr class="
|
31
|
+
<tr class="model">
|
32
32
|
<td>$(name)</td>
|
33
33
|
<td>$(email)</td>
|
34
34
|
<td>$(favorite)</td>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
</div>
|
23
23
|
|
24
24
|
<div id="center" class="column">
|
25
|
-
<div id="main" class="
|
25
|
+
<div id="main" class="app-forum">
|
26
26
|
<!-- 1..10 may_preview desc -->
|
27
27
|
<table class="forum post">
|
28
28
|
<tr>
|
@@ -37,7 +37,7 @@
|
|
37
37
|
</td>
|
38
38
|
</tr>
|
39
39
|
</table>
|
40
|
-
<table id="replies" class="
|
40
|
+
<table id="replies" class="app-forum forum reply">
|
41
41
|
<!-- 1..5 -->
|
42
42
|
<tr title="reply,replies">
|
43
43
|
<th>
|
@@ -19,13 +19,13 @@
|
|
19
19
|
</div>
|
20
20
|
|
21
21
|
<div id="center" class="column">
|
22
|
-
<table id="main" class="
|
22
|
+
<table id="main" class="app-contact summary" style="border: 1px solid black;">
|
23
23
|
<tr>
|
24
24
|
<th>Subject</th>
|
25
25
|
<th>Author</th>
|
26
26
|
<th>Posted at</th>
|
27
27
|
</tr>
|
28
|
-
<tr class="
|
28
|
+
<tr class="model">
|
29
29
|
<td>$(subject)</td>
|
30
30
|
<td>$(_owner)</td>
|
31
31
|
<td>$(_timestamp)</td>
|
@@ -52,7 +52,7 @@
|
|
52
52
|
<dd>
|
53
53
|
This is an "everybody -> admin" type app.
|
54
54
|
Everybody other than root can post this form and only root can see the posted result.
|
55
|
-
The index.html
|
55
|
+
The index.html is a good sample of various items such like radio, select, checkbox etc.
|
56
56
|
</dd>
|
57
57
|
<dt><a href="./forum/">Forum</a></dt>
|
58
58
|
<dd>
|
@@ -61,7 +61,7 @@
|
|
61
61
|
Everybody who logged in can create a new post, or reply to a existing post.
|
62
62
|
</dd>
|
63
63
|
</dl>
|
64
|
-
<div id="main" class="
|
64
|
+
<div id="main" class="app-blog"></div>
|
65
65
|
<!-- $(main.action_create) -->
|
66
66
|
</div>
|
67
67
|
|
data/skel/skin/index.html
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
This is your homepage of the Runo app.<br />
|
28
28
|
You can play with <a href="./examples/">the examples</a> before making your first Runo app.
|
29
29
|
</p>
|
30
|
-
<div id="main" class="
|
30
|
+
<div id="main" class="app-blog"></div>
|
31
31
|
<!-- $(main.action_create) -->
|
32
32
|
</div>
|
33
33
|
|
data/t/skin/_users/index.html
CHANGED
data/t/skin/foo/index.html
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
<head><title>@(label)</title></head>
|
3
3
|
<body>
|
4
4
|
<h1>@(label)</h1>
|
5
|
-
<ul id="main" class="
|
5
|
+
<ul id="main" class="app-blog">
|
6
6
|
<li>
|
7
7
|
$(name = text 32 1..32 :'foo'): $(comment = text 64 1..64 :'bar!')
|
8
|
-
<ul id="files" class="
|
9
|
-
<ul id="replies" class="
|
8
|
+
<ul id="files" class="app-attachment"><li>$(file=text)</li></ul>
|
9
|
+
<ul id="replies" class="app-blog"><li>$(reply=text)</li></ul>
|
10
10
|
</li>
|
11
11
|
</ul>
|
12
|
-
<ul id="sub" class="
|
12
|
+
<ul id="sub" class="app-blog"><li>$(article=text)</li></ul>
|
13
13
|
</body>
|
14
14
|
</html>
|
@@ -2,11 +2,11 @@
|
|
2
2
|
<head><title>@(label)</title></head>
|
3
3
|
<body>
|
4
4
|
<h1>@(label)</h1>
|
5
|
-
<ul id="main" class="
|
5
|
+
<ul id="main" class="app-blog">
|
6
6
|
<li title="tArticle, tArticles">
|
7
7
|
$(comment=text)
|
8
|
-
<ul id="files" class="
|
9
|
-
<ul id="replies" class="
|
8
|
+
<ul id="files" class="app-attachment"><li>$(file=text 1..16)</li></ul>
|
9
|
+
<ul id="replies" class="app-blog"><li>$(reply=text)</li></ul>
|
10
10
|
</li>
|
11
11
|
</ul>
|
12
12
|
</body>
|
data/t/skin/t_contact/index.html
CHANGED
data/t/skin/t_file/index.html
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
<head><title>@(label)</title></head>
|
3
3
|
<body>
|
4
4
|
<h1>@(label)</h1>
|
5
|
-
<ul id="main" class="
|
5
|
+
<ul id="main" class="app-blog">
|
6
6
|
<li>
|
7
7
|
$(_timestamp = meta-timestamp can_edit)
|
8
8
|
$(foo = file 0..50)
|
9
9
|
$(bar = file 0..50)
|
10
|
-
<ul id="baz" class="
|
10
|
+
<ul id="baz" class="app-attachment">
|
11
11
|
$(qux = file 1..50)
|
12
12
|
</ul>
|
13
13
|
</li>
|
data/t/skin/t_img/index.html
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
<head><title>@(label)</title></head>
|
3
3
|
<body>
|
4
4
|
<h1>@(label)</h1>
|
5
|
-
<ul id="main" class="
|
5
|
+
<ul id="main" class="app-blog">
|
6
6
|
<li>
|
7
7
|
$(foo = img 32*32 1..5000 crop)
|
8
|
-
<ul id="baz" class="
|
8
|
+
<ul id="baz" class="app-attachment">
|
9
9
|
$(qux = img 16*16 1..5000 crop)
|
10
10
|
</ul>
|
11
11
|
</li>
|
data/t/skin/t_select/index.html
CHANGED
data/t/skin/t_store/index.html
CHANGED
data/t/skin/t_summary/index.html
CHANGED
data/t/test_parser.rb
CHANGED
@@ -368,7 +368,7 @@ _html
|
|
368
368
|
|
369
369
|
def test_parse_block_tag
|
370
370
|
result = Runo::Parser.parse_html <<'_html'
|
371
|
-
<ul class="
|
371
|
+
<ul class="app-blog" id="foo"><li>hello</li></ul>
|
372
372
|
_html
|
373
373
|
assert_equal(
|
374
374
|
{
|
@@ -377,7 +377,7 @@ _html
|
|
377
377
|
:workflow => 'blog',
|
378
378
|
:tmpl => {
|
379
379
|
:index => <<'_tmpl'.chomp,
|
380
|
-
<ul class="
|
380
|
+
<ul class="app-blog" id="@(name)">$()</ul>
|
381
381
|
$(.navi)$(.submit)$(.action_create)
|
382
382
|
_tmpl
|
383
383
|
},
|
@@ -400,7 +400,7 @@ _tmpl
|
|
400
400
|
)
|
401
401
|
|
402
402
|
result = Runo::Parser.parse_html <<'_html'
|
403
|
-
<ul class="
|
403
|
+
<ul class="app-blog" id="foo">
|
404
404
|
<li>hello</li>
|
405
405
|
</ul>
|
406
406
|
_html
|
@@ -411,7 +411,7 @@ _html
|
|
411
411
|
:workflow => 'blog',
|
412
412
|
:tmpl => {
|
413
413
|
:index => <<'_tmpl'.chomp,
|
414
|
-
<ul class="
|
414
|
+
<ul class="app-blog" id="@(name)">
|
415
415
|
$()</ul>
|
416
416
|
$(.navi)$(.submit)$(.action_create)
|
417
417
|
_tmpl
|
@@ -435,7 +435,7 @@ _tmpl
|
|
435
435
|
)
|
436
436
|
|
437
437
|
result = Runo::Parser.parse_html <<'_html'
|
438
|
-
hello <ul class="
|
438
|
+
hello <ul class="app-blog" id="foo"><li>hello</li></ul> world
|
439
439
|
_html
|
440
440
|
assert_equal(
|
441
441
|
{
|
@@ -444,7 +444,7 @@ _html
|
|
444
444
|
:workflow => 'blog',
|
445
445
|
:tmpl => {
|
446
446
|
:index => <<'_tmpl'.chomp,
|
447
|
-
<ul class="
|
447
|
+
<ul class="app-blog" id="@(name)">$()</ul>$(.navi)$(.submit)$(.action_create)
|
448
448
|
_tmpl
|
449
449
|
},
|
450
450
|
:item => {
|
@@ -468,13 +468,71 @@ _html
|
|
468
468
|
)
|
469
469
|
end
|
470
470
|
|
471
|
+
def test_parse_block_tag_obsolete_runo_class
|
472
|
+
result = Runo::Parser.parse_html <<'_html'
|
473
|
+
<ul class="runo-blog" id="foo"><li>hello</li></ul>
|
474
|
+
_html
|
475
|
+
assert_equal(
|
476
|
+
{
|
477
|
+
'foo' => {
|
478
|
+
:klass => 'set-dynamic',
|
479
|
+
:workflow => 'blog',
|
480
|
+
:tmpl => {
|
481
|
+
:index => <<'_html'.chomp,
|
482
|
+
<ul class="runo-blog" id="@(name)">$()</ul>
|
483
|
+
$(.navi)$(.submit)$(.action_create)
|
484
|
+
_html
|
485
|
+
},
|
486
|
+
:item => {
|
487
|
+
'default' => {
|
488
|
+
:label => nil,
|
489
|
+
:tmpl => {:index => '<li>hello</li>'},
|
490
|
+
:item => {},
|
491
|
+
},
|
492
|
+
},
|
493
|
+
},
|
494
|
+
},
|
495
|
+
result[:item],
|
496
|
+
'Parser.parse_html should be able to parse block runo tags'
|
497
|
+
)
|
498
|
+
end
|
499
|
+
|
500
|
+
def test_parse_block_tag_obsolete_body_class
|
501
|
+
result = Runo::Parser.parse_html <<'_html'
|
502
|
+
<ul class="app-blog" id="foo"><div>oops.</div><li class="body">hello</li></ul>
|
503
|
+
_html
|
504
|
+
assert_equal(
|
505
|
+
{
|
506
|
+
'foo' => {
|
507
|
+
:klass => 'set-dynamic',
|
508
|
+
:workflow => 'blog',
|
509
|
+
:tmpl => {
|
510
|
+
:index => <<'_html'.chomp,
|
511
|
+
<ul class="app-blog" id="@(name)"><div>oops.</div>$()</ul>
|
512
|
+
$(.navi)$(.submit)$(.action_create)
|
513
|
+
_html
|
514
|
+
},
|
515
|
+
:item => {
|
516
|
+
'default' => {
|
517
|
+
:label => nil,
|
518
|
+
:tmpl => {:index => '<li class="body">hello</li>'},
|
519
|
+
:item => {},
|
520
|
+
},
|
521
|
+
},
|
522
|
+
},
|
523
|
+
},
|
524
|
+
result[:item],
|
525
|
+
'Parser.parse_html should be able to parse block runo tags'
|
526
|
+
)
|
527
|
+
end
|
528
|
+
|
471
529
|
def test_look_a_like_block_tag
|
472
530
|
result = Runo::Parser.parse_html <<'_html'
|
473
|
-
hello <ul class="not-
|
531
|
+
hello <ul class="not-app-blog" id="foo"><li>hello</li></ul> world
|
474
532
|
_html
|
475
533
|
assert_equal(
|
476
534
|
{:index => <<'_tmpl'},
|
477
|
-
hello <ul class="not-
|
535
|
+
hello <ul class="not-app-blog" id="foo"><li>hello</li></ul> world
|
478
536
|
_tmpl
|
479
537
|
result[:tmpl],
|
480
538
|
"Parser.parse_html[:tmpl] should skip a class which does not start with 'runo'"
|
@@ -484,9 +542,9 @@ _tmpl
|
|
484
542
|
def test_block_tags_with_options
|
485
543
|
result = Runo::Parser.parse_html <<'_html'
|
486
544
|
hello
|
487
|
-
<table class="
|
545
|
+
<table class="app-blog" id="foo">
|
488
546
|
<!-- 1..20 barbaz -->
|
489
|
-
<tbody class="
|
547
|
+
<tbody class="model"><!-- qux --><tr><th>$(bar=text)</th><th>$(baz=text)</th></tr></tbody>
|
490
548
|
</table>
|
491
549
|
world
|
492
550
|
_html
|
@@ -500,7 +558,7 @@ _html
|
|
500
558
|
:workflow => 'blog',
|
501
559
|
:tmpl => {
|
502
560
|
:index => <<'_tmpl'.chomp,
|
503
|
-
<table class="
|
561
|
+
<table class="app-blog" id="@(name)">
|
504
562
|
<!-- 1..20 barbaz -->
|
505
563
|
$() </table>
|
506
564
|
$(.navi)$(.submit)$(.action_create)
|
@@ -511,7 +569,7 @@ _tmpl
|
|
511
569
|
:label => nil,
|
512
570
|
:tmpl => {
|
513
571
|
:index => <<'_tmpl',
|
514
|
-
<tbody class="
|
572
|
+
<tbody class="model"><!-- qux --><tr><th>$(.a_update)$(bar)</a></th><th>$(baz)$(.hidden)</th></tr></tbody>
|
515
573
|
_tmpl
|
516
574
|
},
|
517
575
|
:item => {
|
@@ -523,16 +581,16 @@ _tmpl
|
|
523
581
|
},
|
524
582
|
},
|
525
583
|
result[:item],
|
526
|
-
'Parser.parse_html should aware of <tbody class="
|
584
|
+
'Parser.parse_html should aware of <tbody class="model">'
|
527
585
|
)
|
528
586
|
end
|
529
587
|
|
530
588
|
def test_block_tags_with_tbody
|
531
589
|
result = Runo::Parser.parse_html <<'_html'
|
532
590
|
hello
|
533
|
-
<table class="
|
591
|
+
<table class="app-blog" id="foo">
|
534
592
|
<thead><tr><th>BAR</th><th>BAZ</th></tr></thead>
|
535
|
-
<tbody class="
|
593
|
+
<tbody class="model"><tr><th>$(bar=text)</th><th>$(baz=text)</th></tr></tbody>
|
536
594
|
</table>
|
537
595
|
world
|
538
596
|
_html
|
@@ -543,7 +601,7 @@ _html
|
|
543
601
|
:workflow => 'blog',
|
544
602
|
:tmpl => {
|
545
603
|
:index => <<'_tmpl'.chomp,
|
546
|
-
<table class="
|
604
|
+
<table class="app-blog" id="@(name)">
|
547
605
|
<thead><tr><th>BAR</th><th>BAZ</th></tr></thead>
|
548
606
|
$() </table>
|
549
607
|
$(.navi)$(.submit)$(.action_create)
|
@@ -554,7 +612,7 @@ _tmpl
|
|
554
612
|
:label => nil,
|
555
613
|
:tmpl => {
|
556
614
|
:index => <<'_tmpl',
|
557
|
-
<tbody class="
|
615
|
+
<tbody class="model"><tr><th>$(.a_update)$(bar)</a></th><th>$(baz)$(.hidden)</th></tr></tbody>
|
558
616
|
_tmpl
|
559
617
|
},
|
560
618
|
:item => {
|
@@ -566,7 +624,7 @@ _tmpl
|
|
566
624
|
},
|
567
625
|
},
|
568
626
|
result[:item],
|
569
|
-
'Parser.parse_html should aware of <tbody class="
|
627
|
+
'Parser.parse_html should aware of <tbody class="model">'
|
570
628
|
)
|
571
629
|
assert_equal(
|
572
630
|
{:index => <<'_tmpl'},
|
@@ -580,9 +638,9 @@ _tmpl
|
|
580
638
|
|
581
639
|
def test_parse_xml
|
582
640
|
result = Runo::Parser.parse_xml <<'_html'
|
583
|
-
<channel class="
|
641
|
+
<channel class="app-rss">
|
584
642
|
<link>@(href)</link>
|
585
|
-
<item class="
|
643
|
+
<item class="model">
|
586
644
|
<title>$(title)</title>
|
587
645
|
</item>
|
588
646
|
</channel>
|
@@ -625,7 +683,7 @@ _xml
|
|
625
683
|
|
626
684
|
def test_parse_item_label
|
627
685
|
result = Runo::Parser.parse_html <<'_html'
|
628
|
-
<ul class="
|
686
|
+
<ul class="app-blog" id="foo"><li title="Greeting">hello</li></ul>
|
629
687
|
_html
|
630
688
|
assert_equal(
|
631
689
|
'Greeting',
|
@@ -634,7 +692,7 @@ _html
|
|
634
692
|
)
|
635
693
|
|
636
694
|
result = Runo::Parser.parse_html <<'_html'
|
637
|
-
<ul class="
|
695
|
+
<ul class="app-blog" id="foo"><!-- foo --><li title="Greeting">hello</li></ul>
|
638
696
|
_html
|
639
697
|
assert_equal(
|
640
698
|
'Greeting',
|
@@ -643,7 +701,7 @@ _html
|
|
643
701
|
)
|
644
702
|
|
645
703
|
result = Runo::Parser.parse_html <<'_html'
|
646
|
-
<ul class="
|
704
|
+
<ul class="app-blog" id="foo"><!-- foo --><li><div title="Foo">hello</div></li></ul>
|
647
705
|
_html
|
648
706
|
assert_nil(
|
649
707
|
result[:item]['foo'][:item]['default'][:label],
|
@@ -653,7 +711,7 @@ _html
|
|
653
711
|
|
654
712
|
def test_parse_item_label_plural
|
655
713
|
result = Runo::Parser.parse_html <<'_html'
|
656
|
-
<ul class="
|
714
|
+
<ul class="app-blog" id="foo"><li title="tEntry, tEntries">hello</li></ul>
|
657
715
|
_html
|
658
716
|
assert_equal(
|
659
717
|
'tEntry',
|
@@ -667,7 +725,7 @@ _html
|
|
667
725
|
)
|
668
726
|
|
669
727
|
result = Runo::Parser.parse_html <<'_html'
|
670
|
-
<ul class="
|
728
|
+
<ul class="app-blog" id="foo"><li title="tFooFoo, BarBar, BazBaz">hello</li></ul>
|
671
729
|
_html
|
672
730
|
assert_equal(
|
673
731
|
'tFooFoo',
|
@@ -681,7 +739,7 @@ _html
|
|
681
739
|
)
|
682
740
|
|
683
741
|
result = Runo::Parser.parse_html <<'_html'
|
684
|
-
<ul class="
|
742
|
+
<ul class="app-blog" id="foo"><li title="tQux">hello</li></ul>
|
685
743
|
_html
|
686
744
|
assert_equal(
|
687
745
|
'tQux',
|
@@ -698,9 +756,9 @@ _html
|
|
698
756
|
def test_block_tags_with_nested_tbody
|
699
757
|
result = Runo::Parser.parse_html <<'_html'
|
700
758
|
hello
|
701
|
-
<table class="
|
759
|
+
<table class="app-blog" id="foo">
|
702
760
|
<thead><tr><th>BAR</th><th>BAZ</th></tr></thead>
|
703
|
-
<tbody class="
|
761
|
+
<tbody class="model"><tbody><tr><th>$(bar=text)</th><th>$(baz=text)</th></tr></tbody></tbody>
|
704
762
|
</table>
|
705
763
|
world
|
706
764
|
_html
|
@@ -711,7 +769,7 @@ _html
|
|
711
769
|
:workflow => 'blog',
|
712
770
|
:tmpl => {
|
713
771
|
:index => <<'_tmpl'.chomp,
|
714
|
-
<table class="
|
772
|
+
<table class="app-blog" id="@(name)">
|
715
773
|
<thead><tr><th>BAR</th><th>BAZ</th></tr></thead>
|
716
774
|
$() </table>
|
717
775
|
$(.navi)$(.submit)$(.action_create)
|
@@ -722,7 +780,7 @@ _tmpl
|
|
722
780
|
:label => nil,
|
723
781
|
:tmpl => {
|
724
782
|
:index => <<'_tmpl',
|
725
|
-
<tbody class="
|
783
|
+
<tbody class="model"><tbody><tr><th>$(.a_update)$(bar)</a></th><th>$(baz)$(.hidden)</th></tr></tbody></tbody>
|
726
784
|
_tmpl
|
727
785
|
},
|
728
786
|
:item => {
|
@@ -734,15 +792,15 @@ _tmpl
|
|
734
792
|
},
|
735
793
|
},
|
736
794
|
result[:item],
|
737
|
-
'Parser.parse_html should aware of nested <tbody class="
|
795
|
+
'Parser.parse_html should aware of nested <tbody class="model">'
|
738
796
|
)
|
739
797
|
end
|
740
798
|
|
741
799
|
def test_nested_block_tags
|
742
800
|
result = Runo::Parser.parse_html <<'_html'
|
743
|
-
<ul class="
|
801
|
+
<ul class="app-blog" id="foo">
|
744
802
|
<li>
|
745
|
-
<ul class="
|
803
|
+
<ul class="app-blog" id="bar"><li>baz</li></ul>
|
746
804
|
</li>
|
747
805
|
</ul>
|
748
806
|
_html
|
@@ -753,7 +811,7 @@ _html
|
|
753
811
|
:workflow => 'blog',
|
754
812
|
:tmpl => {
|
755
813
|
:index => <<'_tmpl'.chomp,
|
756
|
-
<ul class="
|
814
|
+
<ul class="app-blog" id="@(name)">
|
757
815
|
$()</ul>
|
758
816
|
$(.navi)$(.submit)$(.action_create)
|
759
817
|
_tmpl
|
@@ -773,7 +831,7 @@ _tmpl
|
|
773
831
|
:workflow => 'blog',
|
774
832
|
:tmpl => {
|
775
833
|
:index => <<'_tmpl'.chomp,
|
776
|
-
<ul class="
|
834
|
+
<ul class="app-blog" id="@(name)">$()</ul>
|
777
835
|
$(.navi)$(.submit)$(.action_create)
|
778
836
|
_tmpl
|
779
837
|
},
|
@@ -804,7 +862,7 @@ _tmpl
|
|
804
862
|
result = Runo::Parser.parse_html <<'_html'
|
805
863
|
<html>
|
806
864
|
<h1>$(title=text 32)</h1>
|
807
|
-
<ul id="foo" class="
|
865
|
+
<ul id="foo" class="app-blog">
|
808
866
|
<li>
|
809
867
|
$(subject=text 64)
|
810
868
|
$(body=textarea 72*10)
|
@@ -821,7 +879,7 @@ _html
|
|
821
879
|
:workflow => 'blog',
|
822
880
|
:tmpl => {
|
823
881
|
:index => <<'_tmpl'.chomp,
|
824
|
-
<ul id="@(name)" class="
|
882
|
+
<ul id="@(name)" class="app-blog">
|
825
883
|
$() </ul>
|
826
884
|
$(.navi)$(.submit)$(.action_create)
|
827
885
|
_tmpl
|
@@ -1035,7 +1093,7 @@ _tmpl
|
|
1035
1093
|
def test_action_tmpl_in_ss
|
1036
1094
|
result = Runo::Parser.parse_html <<'_html'
|
1037
1095
|
<html>
|
1038
|
-
<ul id="foo" class="
|
1096
|
+
<ul id="foo" class="app-blog">
|
1039
1097
|
<li>$(subject=text)</li>
|
1040
1098
|
</ul>
|
1041
1099
|
<div class="foo-navi">bar</div>
|
@@ -1061,7 +1119,7 @@ _tmpl
|
|
1061
1119
|
def test_action_tmpl_in_ss_with_nil_id
|
1062
1120
|
result = Runo::Parser.parse_html <<'_html'
|
1063
1121
|
<html>
|
1064
|
-
<ul id="main" class="
|
1122
|
+
<ul id="main" class="app-blog">
|
1065
1123
|
<li>$(subject=text)</li>
|
1066
1124
|
</ul>
|
1067
1125
|
<div class="navi">bar</div>
|
@@ -1087,7 +1145,7 @@ _tmpl
|
|
1087
1145
|
def test_action_tmpl_in_ss_with_non_existent_id
|
1088
1146
|
result = Runo::Parser.parse_html <<'_html'
|
1089
1147
|
<html>
|
1090
|
-
<ul id="main" class="
|
1148
|
+
<ul id="main" class="app-blog">
|
1091
1149
|
<li>$(subject=text)</li>
|
1092
1150
|
</ul>
|
1093
1151
|
<div class="non_existent-navi">bar</div>
|
@@ -1111,7 +1169,7 @@ _tmpl
|
|
1111
1169
|
def test_action_tmpl_in_ss_with_nested_action_tmpl
|
1112
1170
|
result = Runo::Parser.parse_html <<'_html'
|
1113
1171
|
<html>
|
1114
|
-
<ul id="foo" class="
|
1172
|
+
<ul id="foo" class="app-blog">
|
1115
1173
|
<li>$(subject=text)</li>
|
1116
1174
|
</ul>
|
1117
1175
|
<div class="foo-navi"><span class="navi_prev">prev</span></div>
|
@@ -1132,7 +1190,7 @@ _html
|
|
1132
1190
|
assert_equal(
|
1133
1191
|
{
|
1134
1192
|
:index => <<'_html'.chomp,
|
1135
|
-
<ul id="@(name)" class="
|
1193
|
+
<ul id="@(name)" class="app-blog">
|
1136
1194
|
$() </ul>
|
1137
1195
|
$(.submit)$(.action_create)
|
1138
1196
|
_html
|
@@ -1147,7 +1205,7 @@ _html
|
|
1147
1205
|
|
1148
1206
|
result = Runo::Parser.parse_html <<'_html'
|
1149
1207
|
<html>
|
1150
|
-
<ul id="foo" class="
|
1208
|
+
<ul id="foo" class="app-blog">
|
1151
1209
|
<li>$(subject=text)</li>
|
1152
1210
|
</ul>
|
1153
1211
|
<div class="foo-navi"><span class="bar-navi_prev">prev</span></div>
|
@@ -1162,8 +1220,8 @@ _html
|
|
1162
1220
|
|
1163
1221
|
def test_action_tmpl_in_sd
|
1164
1222
|
result = Runo::Parser.parse_html <<'_html'
|
1165
|
-
<ul id="foo" class="
|
1166
|
-
<li class="
|
1223
|
+
<ul id="foo" class="app-blog">
|
1224
|
+
<li class="model">$(text)</li>
|
1167
1225
|
<div class="navi">bar</div>
|
1168
1226
|
</ul>
|
1169
1227
|
_html
|
@@ -1183,8 +1241,8 @@ _html
|
|
1183
1241
|
|
1184
1242
|
def test_action_tmpl_in_sd_with_nested_action_tmpl
|
1185
1243
|
result = Runo::Parser.parse_html <<'_html'
|
1186
|
-
<ul id="foo" class="
|
1187
|
-
<li class="
|
1244
|
+
<ul id="foo" class="app-blog">
|
1245
|
+
<li class="model">$(text)</li>
|
1188
1246
|
<div class="navi"><span class="navi_prev">prev</span></div>
|
1189
1247
|
</ul>
|
1190
1248
|
_html
|
@@ -1204,8 +1262,8 @@ _html
|
|
1204
1262
|
|
1205
1263
|
def test_supplement_sd
|
1206
1264
|
result = Runo::Parser.parse_html <<'_html'
|
1207
|
-
<ul id="foo" class="
|
1208
|
-
<li class="
|
1265
|
+
<ul id="foo" class="app-blog">
|
1266
|
+
<li class="model">$(text)</li>
|
1209
1267
|
</ul>
|
1210
1268
|
_html
|
1211
1269
|
assert_match(
|
@@ -1215,9 +1273,9 @@ _html
|
|
1215
1273
|
)
|
1216
1274
|
|
1217
1275
|
result = Runo::Parser.parse_html <<'_html'
|
1218
|
-
<ul id="foo" class="
|
1276
|
+
<ul id="foo" class="app-blog">
|
1219
1277
|
<div class="navi">bar</div>
|
1220
|
-
<li class="
|
1278
|
+
<li class="model">$(text)</li>
|
1221
1279
|
</ul>
|
1222
1280
|
_html
|
1223
1281
|
assert_no_match(
|
@@ -1228,8 +1286,8 @@ _html
|
|
1228
1286
|
|
1229
1287
|
result = Runo::Parser.parse_html <<'_html'
|
1230
1288
|
<div class="foo-navi">bar</div>
|
1231
|
-
<ul id="foo" class="
|
1232
|
-
<li class="
|
1289
|
+
<ul id="foo" class="app-blog">
|
1290
|
+
<li class="model">$(text)</li>
|
1233
1291
|
</ul>
|
1234
1292
|
_html
|
1235
1293
|
assert_no_match(
|
@@ -1241,8 +1299,8 @@ _html
|
|
1241
1299
|
|
1242
1300
|
def test_supplement_ss
|
1243
1301
|
result = Runo::Parser.parse_html <<'_html'
|
1244
|
-
<ul id="foo" class="
|
1245
|
-
<li class="
|
1302
|
+
<ul id="foo" class="app-blog">
|
1303
|
+
<li class="model">$(text)</li>
|
1246
1304
|
</ul>
|
1247
1305
|
_html
|
1248
1306
|
assert_match(
|
@@ -1252,8 +1310,8 @@ _html
|
|
1252
1310
|
)
|
1253
1311
|
|
1254
1312
|
result = Runo::Parser.parse_html <<'_html'
|
1255
|
-
<ul id="foo" class="
|
1256
|
-
<li class="
|
1313
|
+
<ul id="foo" class="app-blog">
|
1314
|
+
<li class="model">$(text) $(.action_update)</li>
|
1257
1315
|
</ul>
|
1258
1316
|
_html
|
1259
1317
|
assert_no_match(
|
data/t/test_runo_call.rb
CHANGED
@@ -100,7 +100,7 @@ class TC_Runo_Call < Test::Unit::TestCase
|
|
100
100
|
<h1></h1>
|
101
101
|
<form id="form_main" method="post" enctype="multipart/form-data" action="/t_contact/1234567890.0123/update.html">
|
102
102
|
<input name="_token" type="hidden" value="#{Runo.token}" />
|
103
|
-
<ul id="main" class="
|
103
|
+
<ul id="main" class="app-contact">
|
104
104
|
<li><a><span class="text"><input type="text" name="_001-name" value="foo" size="32" /></span></a>: <span class="text"><input type="text" name="_001-comment" value="bar!" size="64" /></span></li>
|
105
105
|
</ul>
|
106
106
|
<div class="submit">
|
@@ -208,7 +208,7 @@ _html
|
|
208
208
|
<head><base href="http:///t_summary/" /><title>summary</title></head>
|
209
209
|
<body>
|
210
210
|
<h1>summary</h1>
|
211
|
-
<table id="main" class="
|
211
|
+
<table id="main" class="app-blog">
|
212
212
|
<tr><td><a href="/t_summary/20100326/1/read_detail.html">frank</a></td><td>hi.</td></tr>
|
213
213
|
</table>
|
214
214
|
</body>
|
@@ -227,7 +227,7 @@ _html
|
|
227
227
|
<head><base href="http:///t_summary/" /><title>index</title></head>
|
228
228
|
<body>
|
229
229
|
<h1>index</h1>
|
230
|
-
<ul id="main" class="
|
230
|
+
<ul id="main" class="app-blog">
|
231
231
|
<li><a>frank</a>: hi.</li>
|
232
232
|
</ul>
|
233
233
|
</body>
|
@@ -250,7 +250,7 @@ _html
|
|
250
250
|
<h1>index</h1>
|
251
251
|
<form id="form_main" method="post" enctype="multipart/form-data" action="/t_summary/#{tid}/update.html">
|
252
252
|
<input name="_token" type="hidden" value="#{Runo.token}" />
|
253
|
-
<ul id="main" class="
|
253
|
+
<ul id="main" class="app-blog">
|
254
254
|
<li><a><span class="text"><input type="text" name="20100326_0001-name" value="frank" size="32" /></span></a>: <span class="text"><input type="text" name="20100326_0001-comment" value="hi." size="64" /></span></li>
|
255
255
|
</ul>
|
256
256
|
<div class="submit">
|
@@ -807,7 +807,7 @@ _html
|
|
807
807
|
</ul>
|
808
808
|
<form id="form_main" method="post" enctype="multipart/form-data" action="/#{tid}/update.html">
|
809
809
|
<input name="_token" type="hidden" value="#{Runo.token}" />
|
810
|
-
<ul id="main" class="
|
810
|
+
<ul id="main" class="app-blog">
|
811
811
|
<li><a>fz</a>: howdy.<input type="hidden" name="_1.action" value="create" /></li>
|
812
812
|
</ul>
|
813
813
|
<div class="submit">
|
data/t/test_set_complex.rb
CHANGED
@@ -44,7 +44,7 @@ class TC_Set_Complex < Test::Unit::TestCase
|
|
44
44
|
:group => ['roy', 'don'],
|
45
45
|
:tmpl => {
|
46
46
|
:index => <<'_tmpl'.chomp,
|
47
|
-
<ul id="@(name)" class="
|
47
|
+
<ul id="@(name)" class="app-pipco">
|
48
48
|
$()</ul>
|
49
49
|
$(.navi)$(.submit)$(.action_create)
|
50
50
|
_tmpl
|
@@ -53,10 +53,10 @@ _tmpl
|
|
53
53
|
'default' => Runo::Parser.parse_html(<<'_html')
|
54
54
|
<li id="@(name)">
|
55
55
|
$(name = tomago 32 :'nobody'): $(comment = tomago 64 :'hello.')
|
56
|
-
<ul id="files" class="
|
56
|
+
<ul id="files" class="app-attachment">
|
57
57
|
<li id="@(name)">$(file = tomago :'foo.jpg')</li>
|
58
58
|
</ul>
|
59
|
-
<ul id="replies" class="
|
59
|
+
<ul id="replies" class="app-pipco">
|
60
60
|
<li id="@(name)">$(reply = tomago :'hi.')</li>
|
61
61
|
</ul>
|
62
62
|
$(replies.vegetable)
|
@@ -127,24 +127,24 @@ _html
|
|
127
127
|
)
|
128
128
|
assert_equal(
|
129
129
|
<<'_html',
|
130
|
-
<ul id="main" class="
|
130
|
+
<ul id="main" class="app-pipco">
|
131
131
|
<li id="main-20091123_0001">
|
132
132
|
'CZ'(action=read, p_action=read): 'oops'(action=read, p_action=read)
|
133
|
-
<ul id="main-20091123_0001-files" class="
|
133
|
+
<ul id="main-20091123_0001-files" class="app-attachment">
|
134
134
|
<li id="main-20091123_0001-files-20091123_0001">'carl1.jpg'(action=read, p_action=read)</li>
|
135
135
|
<li id="main-20091123_0001-files-20091123_0002">'carl2.jpg'(action=read, p_action=read)</li>
|
136
136
|
</ul>
|
137
|
-
<ul id="main-20091123_0001-replies" class="
|
137
|
+
<ul id="main-20091123_0001-replies" class="app-pipco">
|
138
138
|
<li id="main-20091123_0001-replies-20091125_0001"><a href="/20091123_0001/replies/20091125/1/update.html">'howdy.'(action=read, p_action=read)</a></li>
|
139
139
|
</ul>
|
140
140
|
'potato'
|
141
141
|
</li>
|
142
142
|
<li id="main-20091123_0002">
|
143
143
|
'RE'(action=read, p_action=read): 'wee'(action=read, p_action=read)
|
144
|
-
<ul id="main-20091123_0002-files" class="
|
144
|
+
<ul id="main-20091123_0002-files" class="app-attachment">
|
145
145
|
<li id="main-20091123_0002-files-20091123_0001">'roy.png'(action=read, p_action=read)</li>
|
146
146
|
</ul>
|
147
|
-
<ul id="main-20091123_0002-replies" class="
|
147
|
+
<ul id="main-20091123_0002-replies" class="app-pipco">
|
148
148
|
<li id="main-20091123_0002-replies-20091125_0001"><a href="/20091123_0002/replies/20091125/1/update.html">'ho ho.'(action=read, p_action=read)</a></li>
|
149
149
|
<li id="main-20091123_0002-replies-20091125_0002"><a href="/20091123_0002/replies/20091125/2/update.html">'oops.'(action=read, p_action=read)</a></li>
|
150
150
|
</ul>
|
@@ -183,10 +183,10 @@ _html
|
|
183
183
|
)
|
184
184
|
assert_equal(
|
185
185
|
<<'_html',
|
186
|
-
<ul id="main" class="
|
186
|
+
<ul id="main" class="app-pipco">
|
187
187
|
<li id="main-20091123_0001">
|
188
188
|
'CZ'(action=update, p_action=update): 'oops'(action=update, p_action=update)
|
189
|
-
<ul id="main-20091123_0001-files" class="
|
189
|
+
<ul id="main-20091123_0001-files" class="app-attachment">
|
190
190
|
<li id="main-20091123_0001-files-20091123_0001">'carl1.jpg'(action=update, p_action=update)[d]</li>
|
191
191
|
<li id="main-20091123_0001-files-20091123_0002">'carl2.jpg'(action=update, p_action=update)[d]</li>
|
192
192
|
<li id="main-20091123_0001-files-_001">'foo.jpg'(action=create, p_action=create)[c]</li>
|
@@ -194,7 +194,7 @@ _html
|
|
194
194
|
</li>
|
195
195
|
<li id="main-20091123_0002">
|
196
196
|
'RE'(action=update, p_action=update): 'wee'(action=update, p_action=update)
|
197
|
-
<ul id="main-20091123_0002-files" class="
|
197
|
+
<ul id="main-20091123_0002-files" class="app-attachment">
|
198
198
|
<li id="main-20091123_0002-files-20091123_0001">'roy.png'(action=update, p_action=update)[d]</li>
|
199
199
|
<li id="main-20091123_0002-files-_001">'foo.jpg'(action=create, p_action=create)[c]</li>
|
200
200
|
</ul>
|
@@ -243,26 +243,26 @@ _html
|
|
243
243
|
)
|
244
244
|
assert_equal(
|
245
245
|
<<_html,
|
246
|
-
<ul id="main" class="
|
246
|
+
<ul id="main" class="app-pipco">
|
247
247
|
<li id="main-20091123_0001">
|
248
248
|
'CZ'(action=read, p_action=read): 'oops'(action=read, p_action=read)
|
249
|
-
<ul id="main-20091123_0001-files" class="
|
249
|
+
<ul id="main-20091123_0001-files" class="app-attachment">
|
250
250
|
<li id="main-20091123_0001-files-20091123_0001">'carl1.jpg'(action=read, p_action=read)</li>
|
251
251
|
<li id="main-20091123_0001-files-20091123_0002">'carl2.jpg'(action=read, p_action=read)</li>
|
252
252
|
</ul>
|
253
|
-
<ul id="main-20091123_0001-replies" class="
|
253
|
+
<ul id="main-20091123_0001-replies" class="app-pipco">
|
254
254
|
<li id="main-20091123_0001-replies-20091125_0001"><a href="/20091123_0001/replies/20091125/1/update.html">'howdy.'(action=read, p_action=read)</a></li>
|
255
255
|
</ul>
|
256
256
|
'potato'
|
257
257
|
</li>
|
258
258
|
<li id="main-20091123_0002">
|
259
259
|
'RE'(action=read, p_action=read): 'wee'(action=read, p_action=read)
|
260
|
-
<ul id="main-20091123_0002-files" class="
|
260
|
+
<ul id="main-20091123_0002-files" class="app-attachment">
|
261
261
|
<li id="main-20091123_0002-files-20091123_0001">'roy.png'(action=read, p_action=read)</li>
|
262
262
|
</ul>
|
263
263
|
<form id="form_main-20091123_0002-replies" method="post" enctype="multipart/form-data" action="/20091123_0002/replies/123.45/update.html">
|
264
264
|
<input name="_token" type="hidden" value="#{Runo.token}" />
|
265
|
-
<ul id="main-20091123_0002-replies" class="
|
265
|
+
<ul id="main-20091123_0002-replies" class="app-pipco">
|
266
266
|
<li id="main-20091123_0002-replies-20091125_0002"><a>'oops.'(action=update, p_action=update)</a></li>
|
267
267
|
</ul>
|
268
268
|
[replies-update]
|
@@ -286,15 +286,15 @@ _html
|
|
286
286
|
)
|
287
287
|
assert_equal(
|
288
288
|
<<_html,
|
289
|
-
<ul id="main" class="
|
289
|
+
<ul id="main" class="app-pipco">
|
290
290
|
<li id="main-20091123_0002">
|
291
291
|
'RE'(action=read, p_action=read): 'wee'(action=read, p_action=read)
|
292
|
-
<ul id="main-20091123_0002-files" class="
|
292
|
+
<ul id="main-20091123_0002-files" class="app-attachment">
|
293
293
|
<li id="main-20091123_0002-files-20091123_0001">'roy.png'(action=read, p_action=read)</li>
|
294
294
|
</ul>
|
295
295
|
<form id="form_main-20091123_0002-replies" method="post" enctype="multipart/form-data" action="/20091123_0002/replies/123.45/update.html">
|
296
296
|
<input name="_token" type="hidden" value="#{Runo.token}" />
|
297
|
-
<ul id="main-20091123_0002-replies" class="
|
297
|
+
<ul id="main-20091123_0002-replies" class="app-pipco">
|
298
298
|
<li id="main-20091123_0002-replies-20091125_0002"><a>'oops.'(action=update, p_action=update)</a></li>
|
299
299
|
</ul>
|
300
300
|
[replies-update]
|
data/t/test_set_dynamic.rb
CHANGED
@@ -15,7 +15,7 @@ class TC_Set_Dynamic < Test::Unit::TestCase
|
|
15
15
|
:group => ['roy', 'don'],
|
16
16
|
:tmpl => {
|
17
17
|
:index => <<'_tmpl'.chomp,
|
18
|
-
<ul id="foo" class="
|
18
|
+
<ul id="foo" class="app-blog">
|
19
19
|
$()</ul>
|
20
20
|
$(.submit)
|
21
21
|
_tmpl
|
@@ -231,7 +231,7 @@ _html
|
|
231
231
|
@sd.each {|item| item[:tmpl][:action_update] = '' }
|
232
232
|
assert_equal(
|
233
233
|
<<'_html',
|
234
|
-
<ul id="foo" class="
|
234
|
+
<ul id="foo" class="app-blog">
|
235
235
|
<li>frank: bar</li>
|
236
236
|
<li>carl: baz</li>
|
237
237
|
</ul>
|
@@ -241,7 +241,7 @@ _html
|
|
241
241
|
)
|
242
242
|
assert_equal(
|
243
243
|
<<'_html',
|
244
|
-
<ul id="foo" class="
|
244
|
+
<ul id="foo" class="app-blog">
|
245
245
|
<li>carl: baz</li>
|
246
246
|
</ul>
|
247
247
|
_html
|
@@ -258,7 +258,7 @@ _html
|
|
258
258
|
}
|
259
259
|
assert_equal(
|
260
260
|
<<'_html',
|
261
|
-
<ul id="foo" class="
|
261
|
+
<ul id="foo" class="app-blog">
|
262
262
|
<li>moo!: moo!</li>
|
263
263
|
</ul>
|
264
264
|
[foo-update]
|
@@ -293,7 +293,7 @@ _html
|
|
293
293
|
|
294
294
|
assert_equal(
|
295
295
|
<<'_html',
|
296
|
-
<ul id="foo" class="
|
296
|
+
<ul id="foo" class="app-blog">
|
297
297
|
</ul>
|
298
298
|
_html
|
299
299
|
@sd.get(:action => :read),
|
@@ -302,7 +302,7 @@ _html
|
|
302
302
|
|
303
303
|
assert_equal(
|
304
304
|
<<'_html',
|
305
|
-
<ul id="foo" class="
|
305
|
+
<ul id="foo" class="app-blog">
|
306
306
|
<li><span class="text"><input type="text" name="name" value="" size="16" /></span>: <span class="text"><input type="text" name="comment" value="" size="64" /></span></li>
|
307
307
|
</ul>
|
308
308
|
[foo-update]
|
@@ -320,7 +320,7 @@ _html
|
|
320
320
|
)
|
321
321
|
assert_equal(
|
322
322
|
<<'_html',
|
323
|
-
<ul id="foo" class="
|
323
|
+
<ul id="foo" class="app-blog">
|
324
324
|
<li>frank: bar<input type="hidden" name="20100330_1234.action" value="howdy" /></li>
|
325
325
|
</ul>
|
326
326
|
[foo-preview.howdy]
|
@@ -332,7 +332,7 @@ _html
|
|
332
332
|
|
333
333
|
def test_get_by_self_reference
|
334
334
|
ss = Runo::Set::Static.new(
|
335
|
-
:html => '<ul class="
|
335
|
+
:html => '<ul class="app-attachment"><li class="model"></li>$(.pipco)</ul>'
|
336
336
|
)
|
337
337
|
sd = ss.item('main')
|
338
338
|
def sd._g_submit(arg)
|
@@ -349,7 +349,7 @@ _html
|
|
349
349
|
sd[:tmpl][:pipco] = '<foo>$(.jawaka)</foo>'
|
350
350
|
sd[:tmpl][:jawaka] = nil
|
351
351
|
assert_equal(
|
352
|
-
'<ul class="
|
352
|
+
'<ul class="app-attachment"><foo>JAWAKA</foo></ul>',
|
353
353
|
ss.get,
|
354
354
|
'Set::Dynamic#_get_by_self_reference should work via [:parent]._get_by_tmpl()'
|
355
355
|
)
|
@@ -357,7 +357,7 @@ _html
|
|
357
357
|
sd[:tmpl][:pipco] = '<foo>$(.jawaka)</foo>'
|
358
358
|
sd[:tmpl][:jawaka] = 'via tmpl'
|
359
359
|
assert_equal(
|
360
|
-
'<ul class="
|
360
|
+
'<ul class="app-attachment"><foo>JAWAKA</foo></ul>',
|
361
361
|
ss.get,
|
362
362
|
'Set::Dynamic#_get_by_self_reference should not recur'
|
363
363
|
)
|
@@ -388,7 +388,7 @@ _html
|
|
388
388
|
|
389
389
|
def test_get_by_self_reference_via_parent_tmpl
|
390
390
|
ss = Runo::Set::Static.new(
|
391
|
-
:html => '$(main.action_pipco)<ul class="
|
391
|
+
:html => '$(main.action_pipco)<ul class="app-attachment"></ul>'
|
392
392
|
)
|
393
393
|
sd = ss.item('main')
|
394
394
|
def sd._g_submit(arg)
|
@@ -399,12 +399,12 @@ _html
|
|
399
399
|
sd[:tmpl][:navi] = ''
|
400
400
|
|
401
401
|
assert_equal(
|
402
|
-
'PIPCO<ul class="
|
402
|
+
'PIPCO<ul class="app-attachment"></ul>',
|
403
403
|
ss.get,
|
404
404
|
'Set::Dynamic#_get_by_self_reference should work via [:parent]._get_by_tmpl()'
|
405
405
|
)
|
406
406
|
assert_equal(
|
407
|
-
'<ul class="
|
407
|
+
'<ul class="app-attachment"></ul>',
|
408
408
|
ss.get('main' => {:action => :create}),
|
409
409
|
'Set::Dynamic#_get_by_self_reference should hide unused items via [:parent]._get_by_tmpl()'
|
410
410
|
)
|
@@ -412,7 +412,7 @@ _html
|
|
412
412
|
|
413
413
|
def test_get_by_self_reference_multiple_vars
|
414
414
|
ss = Runo::Set::Static.new(
|
415
|
-
:html => '<ul class="
|
415
|
+
:html => '<ul class="app-attachment">$(.pipco)<li class="model">$(foo=text)</li></ul>'
|
416
416
|
)
|
417
417
|
sd = ss.item('main')
|
418
418
|
def sd._g_pipco(arg)
|
@@ -421,7 +421,7 @@ _html
|
|
421
421
|
sd[:tmpl][:navi] = ''
|
422
422
|
|
423
423
|
assert_equal(
|
424
|
-
'<ul class="
|
424
|
+
'<ul class="app-attachment">PIPCO</ul>',
|
425
425
|
ss.get,
|
426
426
|
'Set::Dynamic#_get_by_self_reference should not be affected by previous $(.action)'
|
427
427
|
)
|
data/t/test_set_folder.rb
CHANGED
@@ -250,7 +250,7 @@ _html
|
|
250
250
|
|
251
251
|
assert_equal(
|
252
252
|
<<'_html'.chomp,
|
253
|
-
<ul id="@(name)" class="
|
253
|
+
<ul id="@(name)" class="app-blog">
|
254
254
|
$()</ul>
|
255
255
|
$(.navi)$(.submit)$(.action_create)
|
256
256
|
_html
|
@@ -259,7 +259,7 @@ _html
|
|
259
259
|
)
|
260
260
|
assert_equal(
|
261
261
|
<<'_html'.chomp,
|
262
|
-
<table id="@(name)" class="
|
262
|
+
<table id="@(name)" class="app-blog">
|
263
263
|
$()</table>
|
264
264
|
$(.navi)$(.submit)$(.action_create)
|
265
265
|
_html
|
@@ -307,7 +307,7 @@ _html
|
|
307
307
|
<head><base href="/t_summary/" /><title>summary</title></head>
|
308
308
|
<body>
|
309
309
|
<h1>summary</h1>
|
310
|
-
<table id="main" class="
|
310
|
+
<table id="main" class="app-blog">
|
311
311
|
<tr><td><a href="/t_summary/20100326/1/read_detail.html">frank</a></td><td>hi.</td></tr>
|
312
312
|
</table>
|
313
313
|
<div class="action_create"><a href="/t_summary/create.html">create new entry...</a></div>
|
@@ -325,7 +325,7 @@ _html
|
|
325
325
|
<head><base href="/t_summary/" /><title>index</title></head>
|
326
326
|
<body>
|
327
327
|
<h1>index</h1>
|
328
|
-
<ul id="main" class="
|
328
|
+
<ul id="main" class="app-blog">
|
329
329
|
<li><a href="/t_summary/20100326/1/update.html">frank</a>: hi.</li>
|
330
330
|
</ul>
|
331
331
|
<div class="action_create"><a href="/t_summary/create.html">create new entry...</a></div>
|
@@ -351,7 +351,7 @@ _html
|
|
351
351
|
<h1>index</h1>
|
352
352
|
<form id="form_main" method="post" enctype="multipart/form-data" action="/t_summary/12345.012/update.html">
|
353
353
|
<input name="_token" type="hidden" value="#{Runo.token}" />
|
354
|
-
<ul id="main" class="
|
354
|
+
<ul id="main" class="app-blog">
|
355
355
|
<li><a><span class="text"><input type="text" name="20100326_0001-name" value="frank" size="32" /></span></a>: <span class="text"><input type="text" name="20100326_0001-comment" value="hi." size="64" /></span></li>
|
356
356
|
</ul>
|
357
357
|
<div class="submit">
|
@@ -380,7 +380,7 @@ _html
|
|
380
380
|
<head><base href="/t_summary/" /><title>create</title></head>
|
381
381
|
<body>
|
382
382
|
<h1>create</h1>
|
383
|
-
<ul id="main" class="
|
383
|
+
<ul id="main" class="app-blog">
|
384
384
|
<li>main-create</li>
|
385
385
|
</ul>
|
386
386
|
<div class="submit">
|
data/t/test_set_static.rb
CHANGED
@@ -17,7 +17,7 @@ class TC_Set_Static < Test::Unit::TestCase
|
|
17
17
|
ss = Runo::Set::Static.new(:html => <<'_html')
|
18
18
|
<html>
|
19
19
|
<h1>$(title text 32)</h1>
|
20
|
-
<ul id="foo" class="
|
20
|
+
<ul id="foo" class="app-blog">
|
21
21
|
<li title="Diary">
|
22
22
|
$(subject text 64)
|
23
23
|
$(body textarea 72*10)
|
@@ -34,7 +34,7 @@ _html
|
|
34
34
|
:workflow => 'blog',
|
35
35
|
:tmpl => {
|
36
36
|
:index => <<'_tmpl'.chomp,
|
37
|
-
<ul id="@(name)" class="
|
37
|
+
<ul id="@(name)" class="app-blog">
|
38
38
|
$() </ul>
|
39
39
|
$(.navi)$(.submit)$(.action_create)
|
40
40
|
_tmpl
|
@@ -111,7 +111,7 @@ _html
|
|
111
111
|
ss = Runo::Set::Static.new(:html => <<'_html')
|
112
112
|
<html>
|
113
113
|
<h1>$(title = text 32)</h1>
|
114
|
-
<ul id="main" class="
|
114
|
+
<ul id="main" class="app-attachment">
|
115
115
|
<li>hi</li>
|
116
116
|
</ul>
|
117
117
|
</html>
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Akira FUNAI
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-07-
|
17
|
+
date: 2010-07-06 00:00:00 +09:00
|
18
18
|
default_executable: runo
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|