ovto 0.5.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/CHANGELOG.md +14 -2
- data/Gemfile +2 -3
- data/Gemfile.lock +23 -27
- data/book/SUMMARY.md +2 -0
- data/book/api/actions.md +1 -1
- data/book/api/middleware.md +99 -0
- data/book/api/pure_component.md +3 -0
- data/docs/api/Array.html +190 -0
- data/docs/api/Hash.html +196 -0
- data/docs/api/Ovto/Actions.html +128 -40
- data/docs/api/Ovto/App.html +254 -40
- data/docs/api/Ovto/Component/MoreThanOneNode.html +6 -6
- data/docs/api/Ovto/Component.html +96 -29
- data/docs/api/Ovto/Middleware/Actions.html +428 -0
- data/docs/api/Ovto/Middleware/Base.html +605 -0
- data/docs/api/Ovto/Middleware/Component.html +354 -0
- data/docs/api/Ovto/Middleware.html +286 -0
- data/docs/api/Ovto/PureComponent/StateIsNotAvailable.html +6 -6
- data/docs/api/Ovto/PureComponent.html +11 -11
- data/docs/api/Ovto/Runtime.html +7 -7
- data/docs/api/Ovto/State/MissingValue.html +6 -6
- data/docs/api/Ovto/State/{UnknownKey.html → UnknownStateKey.html} +11 -11
- data/docs/api/Ovto/State.html +59 -43
- data/docs/api/Ovto/WiredActionSet.html +636 -0
- data/docs/api/Ovto/WiredActions.html +78 -35
- data/docs/api/Ovto.html +223 -30
- data/docs/api/_index.html +77 -11
- data/docs/api/actions.html +29 -3
- data/docs/api/app.html +28 -2
- data/docs/api/class_list.html +3 -3
- data/docs/api/component.html +30 -4
- data/docs/api/css/style.css +3 -2
- data/docs/api/fetch.html +30 -4
- data/docs/api/file.README.html +76 -78
- data/docs/api/file_list.html +2 -2
- data/docs/api/frames.html +2 -2
- data/docs/api/index.html +76 -78
- data/docs/api/js/app.js +14 -3
- data/docs/api/method_list.html +303 -31
- data/docs/api/middleware.html +498 -0
- data/docs/api/pure_component.html +428 -0
- data/docs/api/state.html +28 -2
- data/docs/api/top-level-namespace.html +11 -9
- data/docs/guides/debugging.html +28 -2
- data/docs/guides/development.html +28 -2
- data/docs/guides/install.html +28 -2
- data/docs/guides/tutorial.html +28 -2
- data/docs/index.html +28 -2
- data/docs/search_index.json +1 -1
- data/examples/sinatra/Gemfile +2 -0
- data/examples/sinatra/Gemfile.lock +32 -30
- data/examples/sinatra/app.rb +1 -4
- data/examples/sinatra/config.ru +6 -6
- data/examples/static/Gemfile.lock +9 -9
- data/lib/ovto/actions.rb +11 -0
- data/lib/ovto/app.rb +37 -13
- data/lib/ovto/component.rb +130 -67
- data/lib/ovto/middleware.rb +121 -0
- data/lib/ovto/pure_component.rb +1 -1
- data/lib/ovto/state.rb +13 -5
- data/lib/ovto/version.rb +1 -1
- data/lib/ovto/wired_action_set.rb +40 -0
- data/lib/ovto/wired_actions.rb +49 -11
- data/lib/ovto.rb +26 -0
- data/ovto.gemspec +1 -1
- metadata +21 -11
- data/docs/api/pure_component.md +0 -27
data/docs/api/file.README.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "README";
|
19
19
|
relpath = '';
|
20
20
|
</script>
|
@@ -57,101 +57,99 @@
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
</div>
|
59
59
|
|
60
|
-
<div id="content"><div id='filecontents'
|
60
|
+
<div id="content"><div id='filecontents'>
|
61
|
+
<h1 id="label-Ovto">Ovto</h1>
|
61
62
|
|
62
63
|
<p>Client-side web framework for Opal</p>
|
63
64
|
|
64
|
-
<p><img src="ovtologo.png"
|
65
|
-
|
66
|
-
<h2>Documents</h2>
|
67
|
-
|
68
|
-
<
|
69
|
-
|
70
|
-
<
|
71
|
-
</ul>
|
72
|
-
|
73
|
-
<h2>Example</h2>
|
74
|
-
|
75
|
-
<p><img src="screenshot.png"
|
76
|
-
|
77
|
-
<pre class="code
|
78
|
-
|
79
|
-
class MyApp
|
80
|
-
class State
|
81
|
-
item
|
82
|
-
|
83
|
-
def fahrenheit
|
84
|
-
(celsius
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
class Actions
|
89
|
-
def set_celsius(value
|
90
|
-
return {celsius
|
91
|
-
end
|
92
|
-
|
93
|
-
def set_fahrenheit(value
|
94
|
-
new_celsius = (value
|
95
|
-
return {celsius
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
class MainComponent
|
100
|
-
def render
|
101
|
-
o
|
102
|
-
o
|
103
|
-
o
|
104
|
-
type
|
105
|
-
onchange
|
106
|
-
value
|
107
|
-
}
|
108
|
-
o
|
109
|
-
o
|
110
|
-
type
|
111
|
-
onchange
|
112
|
-
value
|
113
|
-
}
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
MyApp
|
65
|
+
<p><img src="ovtologo.png"></p>
|
66
|
+
|
67
|
+
<h2 id="label-Documents">Documents</h2>
|
68
|
+
<ul><li>
|
69
|
+
<p><a href="https://yhara.github.io/ovto/docs/">Book</a></p>
|
70
|
+
</li><li>
|
71
|
+
<p><a href="https://yhara.github.io/ovto/api/">yardoc</a></p>
|
72
|
+
</li></ul>
|
73
|
+
|
74
|
+
<h2 id="label-Example">Example</h2>
|
75
|
+
|
76
|
+
<p><img src="screenshot.png"></p>
|
77
|
+
|
78
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ovto</span><span class='tstring_end'>'</span></span>
|
79
|
+
|
80
|
+
<span class='kw'>class</span> <span class='const'>MyApp</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="Ovto.html" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/App.html" title="Ovto::App (class)">App</a></span></span>
|
81
|
+
<span class='kw'>class</span> <span class='const'>State</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="Ovto.html" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/State.html" title="Ovto::State (class)">State</a></span></span>
|
82
|
+
<span class='id identifier rubyid_item'>item</span> <span class='symbol'>:celsius</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='int'>0</span>
|
83
|
+
|
84
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_fahrenheit'>fahrenheit</span>
|
85
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_celsius'>celsius</span> <span class='op'>*</span> <span class='int'>9</span> <span class='op'>/</span> <span class='float'>5.0</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='int'>32</span>
|
86
|
+
<span class='kw'>end</span>
|
87
|
+
<span class='kw'>end</span>
|
88
|
+
|
89
|
+
<span class='kw'>class</span> <span class='const'>Actions</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="Ovto.html" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/Actions.html" title="Ovto::Actions (class)">Actions</a></span></span>
|
90
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_celsius'>set_celsius</span><span class='lparen'>(</span><span class='label'>value:</span><span class='rparen'>)</span>
|
91
|
+
<span class='kw'>return</span> <span class='lbrace'>{</span><span class='label'>celsius:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span>
|
92
|
+
<span class='kw'>end</span>
|
93
|
+
|
94
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_fahrenheit'>set_fahrenheit</span><span class='lparen'>(</span><span class='label'>value:</span><span class='rparen'>)</span>
|
95
|
+
<span class='id identifier rubyid_new_celsius'>new_celsius</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span> <span class='op'>-</span> <span class='int'>32</span><span class='rparen'>)</span> <span class='op'>*</span> <span class='int'>5</span> <span class='op'>/</span> <span class='float'>9.0</span>
|
96
|
+
<span class='kw'>return</span> <span class='lbrace'>{</span><span class='label'>celsius:</span> <span class='id identifier rubyid_new_celsius'>new_celsius</span><span class='rbrace'>}</span>
|
97
|
+
<span class='kw'>end</span>
|
98
|
+
<span class='kw'>end</span>
|
99
|
+
|
100
|
+
<span class='kw'>class</span> <span class='const'>MainComponent</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="Ovto.html" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/Component.html" title="Ovto::Component (class)">Component</a></span></span>
|
101
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span>
|
102
|
+
<span class='id identifier rubyid_o'>o</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>div</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span>
|
103
|
+
<span class='id identifier rubyid_o'>o</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>span</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Celcius:</span><span class='tstring_end'>'</span></span>
|
104
|
+
<span class='id identifier rubyid_o'>o</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>input</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
|
105
|
+
<span class='label'>type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
106
|
+
<span class='label'>onchange:</span> <span class='tlambda'>-></span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='rparen'>)</span><span class='tlambeg'>{</span> <span class='id identifier rubyid_actions'>actions</span><span class='period'>.</span><span class='id identifier rubyid_set_celsius'>set_celsius</span><span class='lparen'>(</span><span class='label'>value:</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
107
|
+
<span class='label'>value:</span> <span class='id identifier rubyid_state'>state</span><span class='period'>.</span><span class='id identifier rubyid_celsius'>celsius</span>
|
108
|
+
<span class='rbrace'>}</span>
|
109
|
+
<span class='id identifier rubyid_o'>o</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>span</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Fahrenheit:</span><span class='tstring_end'>'</span></span>
|
110
|
+
<span class='id identifier rubyid_o'>o</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>input</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
|
111
|
+
<span class='label'>type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
112
|
+
<span class='label'>onchange:</span> <span class='tlambda'>-></span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='rparen'>)</span><span class='tlambeg'>{</span> <span class='id identifier rubyid_actions'>actions</span><span class='period'>.</span><span class='id identifier rubyid_set_fahrenheit'>set_fahrenheit</span><span class='lparen'>(</span><span class='label'>value:</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
113
|
+
<span class='label'>value:</span> <span class='id identifier rubyid_state'>state</span><span class='period'>.</span><span class='id identifier rubyid_fahrenheit'>fahrenheit</span>
|
114
|
+
<span class='rbrace'>}</span>
|
115
|
+
<span class='kw'>end</span>
|
116
|
+
<span class='kw'>end</span>
|
117
|
+
<span class='kw'>end</span>
|
118
|
+
<span class='kw'>end</span>
|
119
|
+
|
120
|
+
<span class='const'>MyApp</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='label'>id:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ovto</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
120
121
|
</code></pre>
|
121
122
|
|
122
123
|
<p>See the <a href="https://yhara.github.io/ovto/docs/guides/tutorial.html">book</a> for details.</p>
|
123
124
|
|
124
|
-
<h2>Setup</h2>
|
125
|
+
<h2 id="label-Setup">Setup</h2>
|
125
126
|
|
126
|
-
<h3>Static</h3>
|
127
|
+
<h3 id="label-Static">Static</h3>
|
127
128
|
|
128
|
-
<p><a href="./examples/static">./examples/static</a> demonstrates how to convert Ovto app
|
129
|
-
into a .js file.</p>
|
129
|
+
<p><a href="./examples/static">./examples/static</a> demonstrates how to convert Ovto app into a .js file.</p>
|
130
130
|
|
131
|
-
<h3>Ovto + Sinatra</h3>
|
131
|
+
<h3 id="label-Ovto+-2B+Sinatra">Ovto + Sinatra</h3>
|
132
132
|
|
133
|
-
<p><a href="./examples/sinatra">./examples/sinatra</a> demonstrates how to serve Ovto app
|
134
|
-
from Sinatra.</p>
|
133
|
+
<p><a href="./examples/sinatra">./examples/sinatra</a> demonstrates how to serve Ovto app from Sinatra.</p>
|
135
134
|
|
136
|
-
<h3>Ovto + Rails</h3>
|
135
|
+
<h3 id="label-Ovto+-2B+Rails">Ovto + Rails</h3>
|
137
136
|
|
138
137
|
<p><a href="https://github.com/yhara/vision">yhara/vision</a> is a working example of using Ovto with Rails 5.</p>
|
139
138
|
|
140
|
-
<h2>Acknowledgements</h2>
|
139
|
+
<h2 id="label-Acknowledgements">Acknowledgements</h2>
|
140
|
+
<ul><li>
|
141
|
+
<p><a href="https://github.com/hyperapp/hyperapp">hyperapp</a></p>
|
142
|
+
</li></ul>
|
141
143
|
|
142
|
-
<
|
143
|
-
<li><a href="https://github.com/hyperapp/hyperapp">hyperapp</a></li>
|
144
|
-
</ul>
|
144
|
+
<h2 id="label-Contact">Contact</h2>
|
145
145
|
|
146
|
-
<
|
147
|
-
|
148
|
-
<p><a href="https://github.com/yhara/ovto/issues">https://github.com/yhara/ovto/issues</a></p>
|
146
|
+
<p><a href="https://github.com/yhara/ovto/issues">github.com/yhara/ovto/issues</a></p>
|
149
147
|
</div></div>
|
150
148
|
|
151
149
|
<div id="footer">
|
152
|
-
Generated on
|
150
|
+
Generated on Fri Oct 22 08:18:17 2021 by
|
153
151
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
154
|
-
0.9.
|
152
|
+
0.9.26 (ruby-3.0.2).
|
155
153
|
</div>
|
156
154
|
|
157
155
|
</div>
|
data/docs/api/file_list.html
CHANGED
@@ -4,9 +4,9 @@
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
5
|
<meta charset="utf-8" />
|
6
6
|
|
7
|
-
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen"
|
7
|
+
<link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" />
|
8
8
|
|
9
|
-
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen"
|
9
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" />
|
10
10
|
|
11
11
|
|
12
12
|
|
data/docs/api/frames.html
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8">
|
5
|
-
<title>Documentation by YARD 0.9.
|
5
|
+
<title>Documentation by YARD 0.9.26</title>
|
6
6
|
</head>
|
7
|
-
<script type="text/javascript"
|
7
|
+
<script type="text/javascript">
|
8
8
|
var match = unescape(window.location.hash).match(/^#!(.+)/);
|
9
9
|
var name = match ? match[1] : 'index.html';
|
10
10
|
name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
|
data/docs/api/index.html
CHANGED
@@ -6,15 +6,15 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.9.
|
9
|
+
— Documentation by YARD 0.9.26
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
13
|
-
<link rel="stylesheet" href="css/style.css" type="text/css"
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
14
|
|
15
|
-
<link rel="stylesheet" href="css/common.css" type="text/css"
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
16
|
|
17
|
-
<script type="text/javascript"
|
17
|
+
<script type="text/javascript">
|
18
18
|
pathId = "README";
|
19
19
|
relpath = '';
|
20
20
|
</script>
|
@@ -57,101 +57,99 @@
|
|
57
57
|
<div class="clear"></div>
|
58
58
|
</div>
|
59
59
|
|
60
|
-
<div id="content"><div id='filecontents'
|
60
|
+
<div id="content"><div id='filecontents'>
|
61
|
+
<h1 id="label-Ovto">Ovto</h1>
|
61
62
|
|
62
63
|
<p>Client-side web framework for Opal</p>
|
63
64
|
|
64
|
-
<p><img src="ovtologo.png"
|
65
|
-
|
66
|
-
<h2>Documents</h2>
|
67
|
-
|
68
|
-
<
|
69
|
-
|
70
|
-
<
|
71
|
-
</ul>
|
72
|
-
|
73
|
-
<h2>Example</h2>
|
74
|
-
|
75
|
-
<p><img src="screenshot.png"
|
76
|
-
|
77
|
-
<pre class="code
|
78
|
-
|
79
|
-
class MyApp
|
80
|
-
class State
|
81
|
-
item
|
82
|
-
|
83
|
-
def fahrenheit
|
84
|
-
(celsius
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
class Actions
|
89
|
-
def set_celsius(value
|
90
|
-
return {celsius
|
91
|
-
end
|
92
|
-
|
93
|
-
def set_fahrenheit(value
|
94
|
-
new_celsius = (value
|
95
|
-
return {celsius
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
class MainComponent
|
100
|
-
def render
|
101
|
-
o
|
102
|
-
o
|
103
|
-
o
|
104
|
-
type
|
105
|
-
onchange
|
106
|
-
value
|
107
|
-
}
|
108
|
-
o
|
109
|
-
o
|
110
|
-
type
|
111
|
-
onchange
|
112
|
-
value
|
113
|
-
}
|
114
|
-
end
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
MyApp
|
65
|
+
<p><img src="ovtologo.png"></p>
|
66
|
+
|
67
|
+
<h2 id="label-Documents">Documents</h2>
|
68
|
+
<ul><li>
|
69
|
+
<p><a href="https://yhara.github.io/ovto/docs/">Book</a></p>
|
70
|
+
</li><li>
|
71
|
+
<p><a href="https://yhara.github.io/ovto/api/">yardoc</a></p>
|
72
|
+
</li></ul>
|
73
|
+
|
74
|
+
<h2 id="label-Example">Example</h2>
|
75
|
+
|
76
|
+
<p><img src="screenshot.png"></p>
|
77
|
+
|
78
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ovto</span><span class='tstring_end'>'</span></span>
|
79
|
+
|
80
|
+
<span class='kw'>class</span> <span class='const'>MyApp</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="Ovto.html" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/App.html" title="Ovto::App (class)">App</a></span></span>
|
81
|
+
<span class='kw'>class</span> <span class='const'>State</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="Ovto.html" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/State.html" title="Ovto::State (class)">State</a></span></span>
|
82
|
+
<span class='id identifier rubyid_item'>item</span> <span class='symbol'>:celsius</span><span class='comma'>,</span> <span class='label'>default:</span> <span class='int'>0</span>
|
83
|
+
|
84
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_fahrenheit'>fahrenheit</span>
|
85
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_celsius'>celsius</span> <span class='op'>*</span> <span class='int'>9</span> <span class='op'>/</span> <span class='float'>5.0</span><span class='rparen'>)</span> <span class='op'>+</span> <span class='int'>32</span>
|
86
|
+
<span class='kw'>end</span>
|
87
|
+
<span class='kw'>end</span>
|
88
|
+
|
89
|
+
<span class='kw'>class</span> <span class='const'>Actions</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="Ovto.html" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/Actions.html" title="Ovto::Actions (class)">Actions</a></span></span>
|
90
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_celsius'>set_celsius</span><span class='lparen'>(</span><span class='label'>value:</span><span class='rparen'>)</span>
|
91
|
+
<span class='kw'>return</span> <span class='lbrace'>{</span><span class='label'>celsius:</span> <span class='id identifier rubyid_value'>value</span><span class='rbrace'>}</span>
|
92
|
+
<span class='kw'>end</span>
|
93
|
+
|
94
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_set_fahrenheit'>set_fahrenheit</span><span class='lparen'>(</span><span class='label'>value:</span><span class='rparen'>)</span>
|
95
|
+
<span class='id identifier rubyid_new_celsius'>new_celsius</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_value'>value</span> <span class='op'>-</span> <span class='int'>32</span><span class='rparen'>)</span> <span class='op'>*</span> <span class='int'>5</span> <span class='op'>/</span> <span class='float'>9.0</span>
|
96
|
+
<span class='kw'>return</span> <span class='lbrace'>{</span><span class='label'>celsius:</span> <span class='id identifier rubyid_new_celsius'>new_celsius</span><span class='rbrace'>}</span>
|
97
|
+
<span class='kw'>end</span>
|
98
|
+
<span class='kw'>end</span>
|
99
|
+
|
100
|
+
<span class='kw'>class</span> <span class='const'>MainComponent</span> <span class='op'><</span> <span class='const'><span class='object_link'><a href="Ovto.html" title="Ovto (module)">Ovto</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Ovto/Component.html" title="Ovto::Component (class)">Component</a></span></span>
|
101
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_render'>render</span>
|
102
|
+
<span class='id identifier rubyid_o'>o</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>div</span><span class='tstring_end'>'</span></span> <span class='kw'>do</span>
|
103
|
+
<span class='id identifier rubyid_o'>o</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>span</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Celcius:</span><span class='tstring_end'>'</span></span>
|
104
|
+
<span class='id identifier rubyid_o'>o</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>input</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
|
105
|
+
<span class='label'>type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
106
|
+
<span class='label'>onchange:</span> <span class='tlambda'>-></span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='rparen'>)</span><span class='tlambeg'>{</span> <span class='id identifier rubyid_actions'>actions</span><span class='period'>.</span><span class='id identifier rubyid_set_celsius'>set_celsius</span><span class='lparen'>(</span><span class='label'>value:</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
107
|
+
<span class='label'>value:</span> <span class='id identifier rubyid_state'>state</span><span class='period'>.</span><span class='id identifier rubyid_celsius'>celsius</span>
|
108
|
+
<span class='rbrace'>}</span>
|
109
|
+
<span class='id identifier rubyid_o'>o</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>span</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Fahrenheit:</span><span class='tstring_end'>'</span></span>
|
110
|
+
<span class='id identifier rubyid_o'>o</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>input</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='lbrace'>{</span>
|
111
|
+
<span class='label'>type:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>text</span><span class='tstring_end'>'</span></span><span class='comma'>,</span>
|
112
|
+
<span class='label'>onchange:</span> <span class='tlambda'>-></span><span class='lparen'>(</span><span class='id identifier rubyid_e'>e</span><span class='rparen'>)</span><span class='tlambeg'>{</span> <span class='id identifier rubyid_actions'>actions</span><span class='period'>.</span><span class='id identifier rubyid_set_fahrenheit'>set_fahrenheit</span><span class='lparen'>(</span><span class='label'>value:</span> <span class='id identifier rubyid_e'>e</span><span class='period'>.</span><span class='id identifier rubyid_target'>target</span><span class='period'>.</span><span class='id identifier rubyid_value'>value</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='comma'>,</span>
|
113
|
+
<span class='label'>value:</span> <span class='id identifier rubyid_state'>state</span><span class='period'>.</span><span class='id identifier rubyid_fahrenheit'>fahrenheit</span>
|
114
|
+
<span class='rbrace'>}</span>
|
115
|
+
<span class='kw'>end</span>
|
116
|
+
<span class='kw'>end</span>
|
117
|
+
<span class='kw'>end</span>
|
118
|
+
<span class='kw'>end</span>
|
119
|
+
|
120
|
+
<span class='const'>MyApp</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='label'>id:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ovto</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
120
121
|
</code></pre>
|
121
122
|
|
122
123
|
<p>See the <a href="https://yhara.github.io/ovto/docs/guides/tutorial.html">book</a> for details.</p>
|
123
124
|
|
124
|
-
<h2>Setup</h2>
|
125
|
+
<h2 id="label-Setup">Setup</h2>
|
125
126
|
|
126
|
-
<h3>Static</h3>
|
127
|
+
<h3 id="label-Static">Static</h3>
|
127
128
|
|
128
|
-
<p><a href="./examples/static">./examples/static</a> demonstrates how to convert Ovto app
|
129
|
-
into a .js file.</p>
|
129
|
+
<p><a href="./examples/static">./examples/static</a> demonstrates how to convert Ovto app into a .js file.</p>
|
130
130
|
|
131
|
-
<h3>Ovto + Sinatra</h3>
|
131
|
+
<h3 id="label-Ovto+-2B+Sinatra">Ovto + Sinatra</h3>
|
132
132
|
|
133
|
-
<p><a href="./examples/sinatra">./examples/sinatra</a> demonstrates how to serve Ovto app
|
134
|
-
from Sinatra.</p>
|
133
|
+
<p><a href="./examples/sinatra">./examples/sinatra</a> demonstrates how to serve Ovto app from Sinatra.</p>
|
135
134
|
|
136
|
-
<h3>Ovto + Rails</h3>
|
135
|
+
<h3 id="label-Ovto+-2B+Rails">Ovto + Rails</h3>
|
137
136
|
|
138
137
|
<p><a href="https://github.com/yhara/vision">yhara/vision</a> is a working example of using Ovto with Rails 5.</p>
|
139
138
|
|
140
|
-
<h2>Acknowledgements</h2>
|
139
|
+
<h2 id="label-Acknowledgements">Acknowledgements</h2>
|
140
|
+
<ul><li>
|
141
|
+
<p><a href="https://github.com/hyperapp/hyperapp">hyperapp</a></p>
|
142
|
+
</li></ul>
|
141
143
|
|
142
|
-
<
|
143
|
-
<li><a href="https://github.com/hyperapp/hyperapp">hyperapp</a></li>
|
144
|
-
</ul>
|
144
|
+
<h2 id="label-Contact">Contact</h2>
|
145
145
|
|
146
|
-
<
|
147
|
-
|
148
|
-
<p><a href="https://github.com/yhara/ovto/issues">https://github.com/yhara/ovto/issues</a></p>
|
146
|
+
<p><a href="https://github.com/yhara/ovto/issues">github.com/yhara/ovto/issues</a></p>
|
149
147
|
</div></div>
|
150
148
|
|
151
149
|
<div id="footer">
|
152
|
-
Generated on
|
150
|
+
Generated on Fri Oct 22 08:18:17 2021 by
|
153
151
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
154
|
-
0.9.
|
152
|
+
0.9.26 (ruby-3.0.2).
|
155
153
|
</div>
|
156
154
|
|
157
155
|
</div>
|
data/docs/api/js/app.js
CHANGED
@@ -171,6 +171,7 @@ function generateTOC() {
|
|
171
171
|
var counter = 0;
|
172
172
|
var tags = ['h2', 'h3', 'h4', 'h5', 'h6'];
|
173
173
|
var i;
|
174
|
+
var curli;
|
174
175
|
if ($('#filecontents h1').length > 1) tags.unshift('h1');
|
175
176
|
for (i = 0; i < tags.length; i++) { tags[i] = '#filecontents ' + tags[i]; }
|
176
177
|
var lastTag = parseInt(tags[0][1], 10);
|
@@ -190,15 +191,25 @@ function generateTOC() {
|
|
190
191
|
}
|
191
192
|
if (thisTag > lastTag) {
|
192
193
|
for (i = 0; i < thisTag - lastTag; i++) {
|
193
|
-
|
194
|
+
if ( typeof(curli) == "undefined" ) {
|
195
|
+
curli = $('<li/>');
|
196
|
+
toc.append(curli);
|
197
|
+
}
|
198
|
+
toc = $('<ol/>');
|
199
|
+
curli.append(toc);
|
200
|
+
curli = undefined;
|
194
201
|
}
|
195
202
|
}
|
196
203
|
if (thisTag < lastTag) {
|
197
|
-
for (i = 0; i < lastTag - thisTag; i++)
|
204
|
+
for (i = 0; i < lastTag - thisTag; i++) {
|
205
|
+
toc = toc.parent();
|
206
|
+
toc = toc.parent();
|
207
|
+
}
|
198
208
|
}
|
199
209
|
var title = $(this).attr('toc-title');
|
200
210
|
if (typeof(title) == "undefined") title = $(this).text();
|
201
|
-
|
211
|
+
curli =$('<li><a href="#' + this.id + '">' + title + '</a></li>');
|
212
|
+
toc.append(curli);
|
202
213
|
lastTag = thisTag;
|
203
214
|
});
|
204
215
|
if (!show) return;
|