wee 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +75 -0
- data/README +17 -9
- data/Rakefile +2 -2
- data/TODO +20 -0
- data/benchmark/Makefile +14 -9
- data/benchmark/counter.rb +11 -30
- data/benchmark/report_req.rb +12 -0
- data/doc/rdoc/classes/Array.html +12 -12
- data/doc/rdoc/classes/Cache/StorageCache.html +38 -38
- data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +30 -30
- data/doc/rdoc/classes/Cache/Strategy/LFU.html +24 -24
- data/doc/rdoc/classes/Cache/Strategy/LRU.html +24 -24
- data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +24 -24
- data/doc/rdoc/classes/Enumerable.html +6 -6
- data/doc/rdoc/classes/Object.html +12 -12
- data/doc/rdoc/classes/OgApplication.html +126 -0
- data/doc/rdoc/classes/OgScaffolder.html +401 -0
- data/doc/rdoc/classes/OgSession.html +172 -0
- data/doc/rdoc/classes/String.html +12 -12
- data/doc/rdoc/classes/Struct.html +12 -12
- data/doc/rdoc/classes/Wee.html +5 -62
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +9 -9
- data/doc/rdoc/classes/Wee/Application.html +107 -39
- data/doc/rdoc/classes/Wee/Brush.html +22 -18
- data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +17 -11
- data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +18 -10
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +30 -64
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +8 -10
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +27 -79
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +146 -0
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +179 -65
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +16 -18
- data/doc/rdoc/classes/Wee/Brush/ImageTag.html +203 -0
- data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +17 -11
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +15 -15
- data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +147 -0
- data/doc/rdoc/classes/Wee/Brush/Page.html +17 -17
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +25 -50
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -38
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +15 -16
- data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +65 -50
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +14 -64
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/ToCallback.html +146 -0
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +40 -40
- data/doc/rdoc/classes/Wee/CallbackStream.html +18 -18
- data/doc/rdoc/classes/Wee/Canvas.html +24 -24
- data/doc/rdoc/classes/Wee/Component.html +232 -149
- data/doc/rdoc/classes/Wee/Component/OnAnswer.html +153 -0
- data/doc/rdoc/classes/Wee/Decoration.html +42 -42
- data/doc/rdoc/classes/Wee/Delegate.html +27 -27
- data/doc/rdoc/classes/Wee/ErrorResponse.html +12 -12
- data/doc/rdoc/classes/Wee/FormDecoration.html +148 -0
- data/doc/rdoc/classes/Wee/GenericResponse.html +6 -6
- data/doc/rdoc/classes/Wee/HtmlCanvas.html +296 -215
- data/doc/rdoc/classes/Wee/HtmlWriter.html +83 -81
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +21 -16
- data/doc/rdoc/classes/Wee/MessageBox.html +180 -0
- data/doc/rdoc/classes/Wee/PageDecoration.html +30 -30
- data/doc/rdoc/classes/Wee/Presenter.html +237 -69
- data/doc/rdoc/classes/Wee/RedirectResponse.html +6 -6
- data/doc/rdoc/classes/Wee/RefreshResponse.html +6 -6
- data/doc/rdoc/classes/Wee/Request.html +18 -18
- data/doc/rdoc/classes/Wee/RequestHandler.html +43 -39
- data/doc/rdoc/classes/Wee/Response.html +24 -24
- data/doc/rdoc/classes/Wee/Session.html +746 -72
- data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +18 -18
- data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
- data/doc/rdoc/classes/Wee/Utils.html +138 -2
- data/doc/rdoc/classes/Wee/Utils/LRUCache.html +7 -7
- data/doc/rdoc/classes/Wee/ValueHolder.html +18 -18
- data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +43 -68
- data/doc/rdoc/classes/Wee/WrapperDecoration.html +150 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +29 -15
- data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/application_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components_rb.html +4 -1
- data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/continuation/session_rb.html +110 -0
- data/doc/rdoc/files/lib/wee/continuation_rb.html +116 -0
- data/doc/rdoc/files/lib/wee/core/callback_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/component_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/presenter_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core_rb.html +3 -3
- data/doc/rdoc/files/lib/wee/databases/og_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/requesthandler_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/session_rb.html +1 -2
- data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/cache_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -8
- data/doc/rdoc/files/lib/wee/utils_rb.html +110 -0
- data/doc/rdoc/files/lib/wee_rb.html +1 -1
- data/doc/rdoc/fr_class_index.html +11 -1
- data/doc/rdoc/fr_file_index.html +8 -0
- data/doc/rdoc/fr_method_index.html +269 -228
- data/examples/calculator.rb +69 -0
- data/examples/calendar.rb +5 -17
- data/examples/example.rb +2 -2
- data/examples/hw.rb +17 -0
- data/examples/live-update.rb +45 -0
- data/examples/og-test.rb +51 -0
- data/lib/wee.rb +1 -1
- data/lib/wee/adaptors/webrick.rb +2 -0
- data/lib/wee/application.rb +16 -0
- data/lib/wee/components.rb +3 -0
- data/lib/wee/components/form_decoration.rb +7 -0
- data/{test → lib/wee}/components/messagebox.rb +1 -1
- data/lib/wee/components/page_decoration.rb +5 -5
- data/lib/wee/components/wrapper_decoration.rb +7 -0
- data/lib/wee/continuation.rb +5 -0
- data/lib/wee/continuation/core/component.rb +55 -0
- data/lib/wee/continuation/session.rb +217 -0
- data/lib/wee/core/callback.rb +11 -6
- data/lib/wee/core/component.rb +45 -33
- data/lib/wee/core/presenter.rb +68 -0
- data/lib/wee/databases/og.rb +114 -0
- data/lib/wee/renderer/html/brushes.rb +179 -98
- data/lib/wee/renderer/html/canvas.rb +37 -13
- data/lib/wee/renderer/html/writer.rb +34 -32
- data/lib/wee/requesthandler.rb +6 -3
- data/lib/wee/session.rb +73 -54
- data/lib/wee/utils.rb +5 -0
- data/lib/wee/utils/autoreload.rb +1 -1
- data/lib/wee/utils/cache.rb +0 -2
- data/lib/wee/utils/helper.rb +40 -8
- data/test/components/calltest-cont.rb +16 -0
- data/test/components/calltest.rb +15 -10
- data/test/stress.rb +31 -28
- data/test/stress_and_measure.rb +53 -0
- data/test/stressed_application.rb +15 -0
- data/test/test_html_writer.rb +9 -4
- metadata +236 -195
- data/benchmark/bench.sh +0 -24
|
@@ -86,7 +86,7 @@ for Ruby 1.8
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
89
|
+
<a href="#M000269">min_by</a>
|
|
90
90
|
</div>
|
|
91
91
|
</div>
|
|
92
92
|
|
|
@@ -108,19 +108,19 @@ for Ruby 1.8
|
|
|
108
108
|
<div id="methods">
|
|
109
109
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
110
110
|
|
|
111
|
-
<div id="method-
|
|
112
|
-
<a name="
|
|
111
|
+
<div id="method-M000269" class="method-detail">
|
|
112
|
+
<a name="M000269"></a>
|
|
113
113
|
|
|
114
114
|
<div class="method-heading">
|
|
115
|
-
<a href="#
|
|
115
|
+
<a href="#M000269" class="method-signature">
|
|
116
116
|
<span class="method-name">min_by</span><span class="method-args">(&block)</span>
|
|
117
117
|
</a>
|
|
118
118
|
</div>
|
|
119
119
|
|
|
120
120
|
<div class="method-description">
|
|
121
121
|
<p><a class="source-toggle" href="#"
|
|
122
|
-
onclick="toggleCode('
|
|
123
|
-
<div class="method-source-code" id="
|
|
122
|
+
onclick="toggleCode('M000269-source');return false;">[Source]</a></p>
|
|
123
|
+
<div class="method-source-code" id="M000269-source">
|
|
124
124
|
<pre>
|
|
125
125
|
<span class="ruby-comment cmt"># File lib/cache/cache.rb, line 4</span>
|
|
126
126
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">min_by</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
|
89
89
|
|
|
90
90
|
<div class="name-list">
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
91
|
+
<a href="#M000041">restore_snapshot</a>
|
|
92
|
+
<a href="#M000040">take_snapshot</a>
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
95
|
|
|
@@ -111,19 +111,19 @@
|
|
|
111
111
|
<div id="methods">
|
|
112
112
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
113
113
|
|
|
114
|
-
<div id="method-
|
|
115
|
-
<a name="
|
|
114
|
+
<div id="method-M000041" class="method-detail">
|
|
115
|
+
<a name="M000041"></a>
|
|
116
116
|
|
|
117
117
|
<div class="method-heading">
|
|
118
|
-
<a href="#
|
|
118
|
+
<a href="#M000041" class="method-signature">
|
|
119
119
|
<span class="method-name">restore_snapshot</span><span class="method-args">(snap)</span>
|
|
120
120
|
</a>
|
|
121
121
|
</div>
|
|
122
122
|
|
|
123
123
|
<div class="method-description">
|
|
124
124
|
<p><a class="source-toggle" href="#"
|
|
125
|
-
onclick="toggleCode('
|
|
126
|
-
<div class="method-source-code" id="
|
|
125
|
+
onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
|
|
126
|
+
<div class="method-source-code" id="M000041-source">
|
|
127
127
|
<pre>
|
|
128
128
|
<span class="ruby-comment cmt"># File lib/wee/snapshot_ext.rb, line 10</span>
|
|
129
129
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">restore_snapshot</span>(<span class="ruby-identifier">snap</span>)
|
|
@@ -136,19 +136,19 @@
|
|
|
136
136
|
</div>
|
|
137
137
|
</div>
|
|
138
138
|
|
|
139
|
-
<div id="method-
|
|
140
|
-
<a name="
|
|
139
|
+
<div id="method-M000040" class="method-detail">
|
|
140
|
+
<a name="M000040"></a>
|
|
141
141
|
|
|
142
142
|
<div class="method-heading">
|
|
143
|
-
<a href="#
|
|
143
|
+
<a href="#M000040" class="method-signature">
|
|
144
144
|
<span class="method-name">take_snapshot</span><span class="method-args">()</span>
|
|
145
145
|
</a>
|
|
146
146
|
</div>
|
|
147
147
|
|
|
148
148
|
<div class="method-description">
|
|
149
149
|
<p><a class="source-toggle" href="#"
|
|
150
|
-
onclick="toggleCode('
|
|
151
|
-
<div class="method-source-code" id="
|
|
150
|
+
onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
|
|
151
|
+
<div class="method-source-code" id="M000040-source">
|
|
152
152
|
<pre>
|
|
153
153
|
<span class="ruby-comment cmt"># File lib/wee/snapshot_ext.rb, line 2</span>
|
|
154
154
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">take_snapshot</span>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: OgApplication</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">OgApplication</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../files/lib/wee/databases/og_rb.html">
|
|
59
|
+
lib/wee/databases/og.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
<a href="Wee/Application.html">
|
|
69
|
+
Wee::Application
|
|
70
|
+
</a>
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
</table>
|
|
74
|
+
</div>
|
|
75
|
+
<!-- banner header -->
|
|
76
|
+
|
|
77
|
+
<div id="bodyContent">
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<div id="contextContent">
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
<!-- if includes -->
|
|
92
|
+
|
|
93
|
+
<div id="section">
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
<div id="attribute-list">
|
|
100
|
+
<h3 class="section-bar">Attributes</h3>
|
|
101
|
+
|
|
102
|
+
<div class="name-list">
|
|
103
|
+
<table>
|
|
104
|
+
<tr class="top-aligned-row context-row">
|
|
105
|
+
<td class="context-item-name">db</td>
|
|
106
|
+
<td class="context-item-value"> [RW] </td>
|
|
107
|
+
<td class="context-item-desc"></td>
|
|
108
|
+
</tr>
|
|
109
|
+
</table>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
<!-- if method_list -->
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
<div id="validator-badges">
|
|
122
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
</body>
|
|
126
|
+
</html>
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!DOCTYPE html
|
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
5
|
+
|
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
7
|
+
<head>
|
|
8
|
+
<title>Class: OgScaffolder</title>
|
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
12
|
+
<script type="text/javascript">
|
|
13
|
+
// <![CDATA[
|
|
14
|
+
|
|
15
|
+
function popupCode( url ) {
|
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function toggleCode( id ) {
|
|
20
|
+
if ( document.getElementById )
|
|
21
|
+
elem = document.getElementById( id );
|
|
22
|
+
else if ( document.all )
|
|
23
|
+
elem = eval( "document.all." + id );
|
|
24
|
+
else
|
|
25
|
+
return false;
|
|
26
|
+
|
|
27
|
+
elemStyle = elem.style;
|
|
28
|
+
|
|
29
|
+
if ( elemStyle.display != "block" ) {
|
|
30
|
+
elemStyle.display = "block"
|
|
31
|
+
} else {
|
|
32
|
+
elemStyle.display = "none"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Make codeblocks hidden by default
|
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
40
|
+
|
|
41
|
+
// ]]>
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
</head>
|
|
45
|
+
<body>
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
<div id="classHeader">
|
|
50
|
+
<table class="header-table">
|
|
51
|
+
<tr class="top-aligned-row">
|
|
52
|
+
<td><strong>Class</strong></td>
|
|
53
|
+
<td class="class-name-in-header">OgScaffolder</td>
|
|
54
|
+
</tr>
|
|
55
|
+
<tr class="top-aligned-row">
|
|
56
|
+
<td><strong>In:</strong></td>
|
|
57
|
+
<td>
|
|
58
|
+
<a href="../files/lib/wee/databases/og_rb.html">
|
|
59
|
+
lib/wee/databases/og.rb
|
|
60
|
+
</a>
|
|
61
|
+
<br />
|
|
62
|
+
</td>
|
|
63
|
+
</tr>
|
|
64
|
+
|
|
65
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
<a href="Wee/Component.html">
|
|
69
|
+
Wee::Component
|
|
70
|
+
</a>
|
|
71
|
+
</td>
|
|
72
|
+
</tr>
|
|
73
|
+
</table>
|
|
74
|
+
</div>
|
|
75
|
+
<!-- banner header -->
|
|
76
|
+
|
|
77
|
+
<div id="bodyContent">
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<div id="contextContent">
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div id="method-list">
|
|
88
|
+
<h3 class="section-bar">Methods</h3>
|
|
89
|
+
|
|
90
|
+
<div class="name-list">
|
|
91
|
+
<a href="#M000036">cancel</a>
|
|
92
|
+
<a href="#M000033">confirm_delete</a>
|
|
93
|
+
<a href="#M000038">create</a>
|
|
94
|
+
<a href="#M000032">delete</a>
|
|
95
|
+
<a href="#M000034">edit</a>
|
|
96
|
+
<a href="#M000031">new</a>
|
|
97
|
+
<a href="#M000037">refresh</a>
|
|
98
|
+
<a href="#M000039">render</a>
|
|
99
|
+
<a href="#M000035">save</a>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<!-- if includes -->
|
|
107
|
+
|
|
108
|
+
<div id="section">
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
<!-- if method_list -->
|
|
118
|
+
<div id="methods">
|
|
119
|
+
<h3 class="section-bar">Public Class methods</h3>
|
|
120
|
+
|
|
121
|
+
<div id="method-M000031" class="method-detail">
|
|
122
|
+
<a name="M000031"></a>
|
|
123
|
+
|
|
124
|
+
<div class="method-heading">
|
|
125
|
+
<a href="#M000031" class="method-signature">
|
|
126
|
+
<span class="method-name">new</span><span class="method-args">(domain_class)</span>
|
|
127
|
+
</a>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<div class="method-description">
|
|
131
|
+
<p><a class="source-toggle" href="#"
|
|
132
|
+
onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
|
|
133
|
+
<div class="method-source-code" id="M000031-source">
|
|
134
|
+
<pre>
|
|
135
|
+
<span class="ruby-comment cmt"># File lib/wee/databases/og.rb, line 18</span>
|
|
136
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">domain_class</span>)
|
|
137
|
+
<span class="ruby-keyword kw">super</span>()
|
|
138
|
+
<span class="ruby-ivar">@domain_class</span> = <span class="ruby-identifier">domain_class</span>
|
|
139
|
+
<span class="ruby-ivar">@attributes</span> = <span class="ruby-identifier">domain_class</span>.<span class="ruby-identifier">__props</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span>.<span class="ruby-identifier">name</span>}.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span> <span class="ruby-identifier">a</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'oid'</span>}
|
|
140
|
+
<span class="ruby-keyword kw">end</span>
|
|
141
|
+
</pre>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
147
|
+
|
|
148
|
+
<div id="method-M000036" class="method-detail">
|
|
149
|
+
<a name="M000036"></a>
|
|
150
|
+
|
|
151
|
+
<div class="method-heading">
|
|
152
|
+
<a href="#M000036" class="method-signature">
|
|
153
|
+
<span class="method-name">cancel</span><span class="method-args">()</span>
|
|
154
|
+
</a>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div class="method-description">
|
|
158
|
+
<p><a class="source-toggle" href="#"
|
|
159
|
+
onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
|
|
160
|
+
<div class="method-source-code" id="M000036-source">
|
|
161
|
+
<pre>
|
|
162
|
+
<span class="ruby-comment cmt"># File lib/wee/databases/og.rb, line 44</span>
|
|
163
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cancel</span>
|
|
164
|
+
<span class="ruby-ivar">@objs</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-ivar">@edit</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@edit</span> <span class="ruby-keyword kw">and</span> <span class="ruby-ivar">@edit</span>.<span class="ruby-identifier">oid</span>.<span class="ruby-identifier">nil?</span>
|
|
165
|
+
<span class="ruby-ivar">@edit</span> = <span class="ruby-keyword kw">nil</span>
|
|
166
|
+
<span class="ruby-keyword kw">end</span>
|
|
167
|
+
</pre>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<div id="method-M000033" class="method-detail">
|
|
173
|
+
<a name="M000033"></a>
|
|
174
|
+
|
|
175
|
+
<div class="method-heading">
|
|
176
|
+
<a href="#M000033" class="method-signature">
|
|
177
|
+
<span class="method-name">confirm_delete</span><span class="method-args">(confirmed, obj)</span>
|
|
178
|
+
</a>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<div class="method-description">
|
|
182
|
+
<p><a class="source-toggle" href="#"
|
|
183
|
+
onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
|
|
184
|
+
<div class="method-source-code" id="M000033-source">
|
|
185
|
+
<pre>
|
|
186
|
+
<span class="ruby-comment cmt"># File lib/wee/databases/og.rb, line 28</span>
|
|
187
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">confirm_delete</span>(<span class="ruby-identifier">confirmed</span>, <span class="ruby-identifier">obj</span>)
|
|
188
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">confirmed</span>
|
|
189
|
+
<span class="ruby-ivar">@objs</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">obj</span>)
|
|
190
|
+
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">delete!</span>
|
|
191
|
+
<span class="ruby-keyword kw">end</span>
|
|
192
|
+
<span class="ruby-keyword kw">end</span>
|
|
193
|
+
</pre>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
|
|
198
|
+
<div id="method-M000038" class="method-detail">
|
|
199
|
+
<a name="M000038"></a>
|
|
200
|
+
|
|
201
|
+
<div class="method-heading">
|
|
202
|
+
<a href="#M000038" class="method-signature">
|
|
203
|
+
<span class="method-name">create</span><span class="method-args">()</span>
|
|
204
|
+
</a>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<div class="method-description">
|
|
208
|
+
<p><a class="source-toggle" href="#"
|
|
209
|
+
onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
|
|
210
|
+
<div class="method-source-code" id="M000038-source">
|
|
211
|
+
<pre>
|
|
212
|
+
<span class="ruby-comment cmt"># File lib/wee/databases/og.rb, line 53</span>
|
|
213
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span>
|
|
214
|
+
<span class="ruby-ivar">@objs</span> <span class="ruby-operator"><<</span> (<span class="ruby-ivar">@edit</span> = <span class="ruby-ivar">@domain_class</span>.<span class="ruby-identifier">new</span>)
|
|
215
|
+
<span class="ruby-keyword kw">end</span>
|
|
216
|
+
</pre>
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
|
|
221
|
+
<div id="method-M000032" class="method-detail">
|
|
222
|
+
<a name="M000032"></a>
|
|
223
|
+
|
|
224
|
+
<div class="method-heading">
|
|
225
|
+
<a href="#M000032" class="method-signature">
|
|
226
|
+
<span class="method-name">delete</span><span class="method-args">(obj)</span>
|
|
227
|
+
</a>
|
|
228
|
+
</div>
|
|
229
|
+
|
|
230
|
+
<div class="method-description">
|
|
231
|
+
<p><a class="source-toggle" href="#"
|
|
232
|
+
onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
|
|
233
|
+
<div class="method-source-code" id="M000032-source">
|
|
234
|
+
<pre>
|
|
235
|
+
<span class="ruby-comment cmt"># File lib/wee/databases/og.rb, line 24</span>
|
|
236
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">obj</span>)
|
|
237
|
+
<span class="ruby-identifier">call</span> <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">MessageBox</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'Really delete?'</span>), <span class="ruby-identifier">:confirm_delete</span>, <span class="ruby-identifier">obj</span>
|
|
238
|
+
<span class="ruby-keyword kw">end</span>
|
|
239
|
+
</pre>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
|
|
244
|
+
<div id="method-M000034" class="method-detail">
|
|
245
|
+
<a name="M000034"></a>
|
|
246
|
+
|
|
247
|
+
<div class="method-heading">
|
|
248
|
+
<a href="#M000034" class="method-signature">
|
|
249
|
+
<span class="method-name">edit</span><span class="method-args">(obj)</span>
|
|
250
|
+
</a>
|
|
251
|
+
</div>
|
|
252
|
+
|
|
253
|
+
<div class="method-description">
|
|
254
|
+
<p><a class="source-toggle" href="#"
|
|
255
|
+
onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
|
|
256
|
+
<div class="method-source-code" id="M000034-source">
|
|
257
|
+
<pre>
|
|
258
|
+
<span class="ruby-comment cmt"># File lib/wee/databases/og.rb, line 35</span>
|
|
259
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">edit</span>(<span class="ruby-identifier">obj</span>)
|
|
260
|
+
<span class="ruby-ivar">@edit</span> = <span class="ruby-identifier">obj</span>
|
|
261
|
+
<span class="ruby-keyword kw">end</span>
|
|
262
|
+
</pre>
|
|
263
|
+
</div>
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
|
|
267
|
+
<div id="method-M000037" class="method-detail">
|
|
268
|
+
<a name="M000037"></a>
|
|
269
|
+
|
|
270
|
+
<div class="method-heading">
|
|
271
|
+
<a href="#M000037" class="method-signature">
|
|
272
|
+
<span class="method-name">refresh</span><span class="method-args">()</span>
|
|
273
|
+
</a>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
<div class="method-description">
|
|
277
|
+
<p><a class="source-toggle" href="#"
|
|
278
|
+
onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
|
|
279
|
+
<div class="method-source-code" id="M000037-source">
|
|
280
|
+
<pre>
|
|
281
|
+
<span class="ruby-comment cmt"># File lib/wee/databases/og.rb, line 49</span>
|
|
282
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">refresh</span>
|
|
283
|
+
<span class="ruby-ivar">@objs</span> = <span class="ruby-ivar">@domain_class</span>.<span class="ruby-identifier">all</span> <span class="ruby-operator">||</span> []
|
|
284
|
+
<span class="ruby-keyword kw">end</span>
|
|
285
|
+
</pre>
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
<div id="method-M000039" class="method-detail">
|
|
291
|
+
<a name="M000039"></a>
|
|
292
|
+
|
|
293
|
+
<div class="method-heading">
|
|
294
|
+
<a href="#M000039" class="method-signature">
|
|
295
|
+
<span class="method-name">render</span><span class="method-args">()</span>
|
|
296
|
+
</a>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<div class="method-description">
|
|
300
|
+
<p><a class="source-toggle" href="#"
|
|
301
|
+
onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
|
|
302
|
+
<div class="method-source-code" id="M000039-source">
|
|
303
|
+
<pre>
|
|
304
|
+
<span class="ruby-comment cmt"># File lib/wee/databases/og.rb, line 57</span>
|
|
305
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>
|
|
306
|
+
<span class="ruby-identifier">refresh</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@objs</span>.<span class="ruby-identifier">nil?</span>
|
|
307
|
+
|
|
308
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">h1</span> <span class="ruby-node">"#{ @domain_class } List"</span>
|
|
309
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">anchor</span>.<span class="ruby-identifier">callback</span> { <span class="ruby-identifier">refresh</span> }.<span class="ruby-identifier">with</span>(<span class="ruby-value str">"Refresh"</span>)
|
|
310
|
+
|
|
311
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">form</span> <span class="ruby-keyword kw">do</span>
|
|
312
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">table</span>.<span class="ruby-identifier">border</span>(<span class="ruby-value">1</span>).<span class="ruby-identifier">with</span> {
|
|
313
|
+
|
|
314
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">table_row</span>.<span class="ruby-identifier">with</span> {
|
|
315
|
+
<span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
|
316
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">table_header</span>.<span class="ruby-identifier">with</span> {
|
|
317
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">bold</span>(<span class="ruby-identifier">a</span>.<span class="ruby-identifier">capitalize</span>)
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">table_header</span>.<span class="ruby-identifier">with</span>(<span class="ruby-value str">" "</span>)
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
<span class="ruby-ivar">@objs</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">o</span><span class="ruby-operator">|</span>
|
|
324
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">table_row</span>.<span class="ruby-identifier">with</span> <span class="ruby-keyword kw">do</span>
|
|
325
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@edit</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">o</span>
|
|
326
|
+
|
|
327
|
+
<span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
|
|
328
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">table_data</span>.<span class="ruby-identifier">with</span> { <span class="ruby-identifier">r</span>.<span class="ruby-identifier">text_input</span>.<span class="ruby-identifier">callback</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">o</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">attr</span><span class="ruby-operator">+</span><span class="ruby-value str">"="</span>,<span class="ruby-identifier">v</span>) }.<span class="ruby-identifier">value</span>(<span class="ruby-identifier">o</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">attr</span>)) }
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">table_data</span>.<span class="ruby-identifier">with</span> {
|
|
332
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">submit_button</span>.<span class="ruby-identifier">callback</span> { <span class="ruby-identifier">save</span>(<span class="ruby-identifier">o</span>) }.<span class="ruby-identifier">value</span>(<span class="ruby-value str">"Save"</span>)
|
|
333
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">space</span>
|
|
334
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">submit_button</span>.<span class="ruby-identifier">callback</span> { <span class="ruby-identifier">cancel</span>() }.<span class="ruby-identifier">value</span>(<span class="ruby-value str">"Cancel"</span>)
|
|
335
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">space</span>
|
|
336
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">anchor</span>.<span class="ruby-identifier">callback</span> { <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">o</span>) }.<span class="ruby-identifier">with</span>(<span class="ruby-value str">"Delete"</span>)
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
<span class="ruby-keyword kw">else</span>
|
|
340
|
+
|
|
341
|
+
<span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">attr</span><span class="ruby-operator">|</span>
|
|
342
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">table_data</span>(<span class="ruby-identifier">o</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">attr</span>))
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">table_data</span>.<span class="ruby-identifier">with</span> {
|
|
346
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">anchor</span>.<span class="ruby-identifier">callback</span> { <span class="ruby-identifier">edit</span>(<span class="ruby-identifier">o</span>) }.<span class="ruby-identifier">with</span>(<span class="ruby-value str">"Edit"</span>)
|
|
347
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">space</span>
|
|
348
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">anchor</span>.<span class="ruby-identifier">callback</span> { <span class="ruby-identifier">delete</span>(<span class="ruby-identifier">o</span>) }.<span class="ruby-identifier">with</span>(<span class="ruby-value str">"Delete"</span>)
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
<span class="ruby-keyword kw">end</span>
|
|
352
|
+
<span class="ruby-keyword kw">end</span>
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
<span class="ruby-keyword kw">end</span>
|
|
356
|
+
|
|
357
|
+
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">anchor</span>.<span class="ruby-identifier">callback</span> { <span class="ruby-identifier">create</span>() }.<span class="ruby-identifier">with</span>(<span class="ruby-node">"Add new #{ @domain_class }"</span>)
|
|
358
|
+
|
|
359
|
+
<span class="ruby-keyword kw">end</span>
|
|
360
|
+
</pre>
|
|
361
|
+
</div>
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
364
|
+
|
|
365
|
+
<div id="method-M000035" class="method-detail">
|
|
366
|
+
<a name="M000035"></a>
|
|
367
|
+
|
|
368
|
+
<div class="method-heading">
|
|
369
|
+
<a href="#M000035" class="method-signature">
|
|
370
|
+
<span class="method-name">save</span><span class="method-args">(obj)</span>
|
|
371
|
+
</a>
|
|
372
|
+
</div>
|
|
373
|
+
|
|
374
|
+
<div class="method-description">
|
|
375
|
+
<p><a class="source-toggle" href="#"
|
|
376
|
+
onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
|
|
377
|
+
<div class="method-source-code" id="M000035-source">
|
|
378
|
+
<pre>
|
|
379
|
+
<span class="ruby-comment cmt"># File lib/wee/databases/og.rb, line 39</span>
|
|
380
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">save</span>(<span class="ruby-identifier">obj</span>)
|
|
381
|
+
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">save!</span>
|
|
382
|
+
<span class="ruby-ivar">@edit</span> = <span class="ruby-keyword kw">nil</span>
|
|
383
|
+
<span class="ruby-keyword kw">end</span>
|
|
384
|
+
</pre>
|
|
385
|
+
</div>
|
|
386
|
+
</div>
|
|
387
|
+
</div>
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
</div>
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
</div>
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
<div id="validator-badges">
|
|
397
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
398
|
+
</div>
|
|
399
|
+
|
|
400
|
+
</body>
|
|
401
|
+
</html>
|