ovto 0.4.1 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.gitmodules +3 -0
  4. data/CHANGELOG.md +15 -2
  5. data/Gemfile +2 -2
  6. data/Gemfile.lock +23 -27
  7. data/README.md +2 -2
  8. data/book/SUMMARY.md +3 -1
  9. data/book/api/actions.md +1 -1
  10. data/book/api/fetch.md +3 -3
  11. data/book/api/middleware.md +99 -0
  12. data/book/api/pure_component.md +30 -0
  13. data/book/guides/install.md +76 -0
  14. data/book/guides/tutorial.md +3 -3
  15. data/book/ovtologo.png +0 -0
  16. data/docs/api/Array.html +190 -0
  17. data/docs/api/Hash.html +196 -0
  18. data/docs/api/Ovto/Actions.html +132 -40
  19. data/docs/api/Ovto/App.html +254 -40
  20. data/docs/api/Ovto/Component/MoreThanOneNode.html +6 -6
  21. data/docs/api/Ovto/Component.html +102 -27
  22. data/docs/api/Ovto/Middleware/Actions.html +428 -0
  23. data/docs/api/Ovto/Middleware/Base.html +606 -0
  24. data/docs/api/Ovto/Middleware/Component.html +355 -0
  25. data/docs/api/Ovto/Middleware.html +288 -0
  26. data/docs/api/Ovto/PureComponent/StateIsNotAvailable.html +124 -0
  27. data/docs/api/Ovto/PureComponent.html +368 -0
  28. data/docs/api/Ovto/Runtime.html +7 -7
  29. data/docs/api/Ovto/State/MissingValue.html +6 -6
  30. data/docs/api/Ovto/State/{UnknownKey.html → UnknownStateKey.html} +11 -11
  31. data/docs/api/Ovto/State.html +59 -43
  32. data/docs/api/Ovto/WiredActionSet.html +636 -0
  33. data/docs/api/Ovto/WiredActions.html +78 -35
  34. data/docs/api/Ovto.html +226 -29
  35. data/docs/api/_index.html +99 -11
  36. data/docs/api/actions.html +36 -10
  37. data/docs/api/app.html +35 -9
  38. data/docs/api/class_list.html +3 -3
  39. data/docs/api/component.html +37 -11
  40. data/docs/api/css/style.css +2 -2
  41. data/docs/api/fetch.html +40 -14
  42. data/docs/api/file.README.html +8 -8
  43. data/docs/api/file_list.html +2 -2
  44. data/docs/api/frames.html +2 -2
  45. data/docs/api/index.html +8 -8
  46. data/docs/api/js/app.js +14 -3
  47. data/docs/api/method_list.html +318 -22
  48. data/docs/api/middleware.html +498 -0
  49. data/docs/api/pure_component.html +428 -0
  50. data/docs/api/state.html +35 -9
  51. data/docs/api/top-level-namespace.html +9 -7
  52. data/docs/gitbook/gitbook.js +2 -2
  53. data/docs/gitbook/theme.js +1 -1
  54. data/docs/guides/debugging.html +35 -9
  55. data/docs/guides/development.html +35 -9
  56. data/docs/guides/install.html +452 -0
  57. data/docs/guides/tutorial.html +101 -66
  58. data/docs/index.html +37 -17
  59. data/docs/ovtologo.png +0 -0
  60. data/docs/search_index.json +1 -1
  61. data/examples/sinatra/Gemfile +2 -0
  62. data/examples/sinatra/Gemfile.lock +33 -31
  63. data/examples/sinatra/app.rb +1 -4
  64. data/examples/sinatra/config.ru +6 -6
  65. data/examples/static/Gemfile.lock +10 -14
  66. data/lib/ovto/actions.rb +11 -0
  67. data/lib/ovto/app.rb +37 -13
  68. data/lib/ovto/component.rb +149 -73
  69. data/lib/ovto/fetch.rb +1 -1
  70. data/lib/ovto/middleware.rb +121 -0
  71. data/lib/ovto/pure_component.rb +22 -0
  72. data/lib/ovto/state.rb +13 -5
  73. data/lib/ovto/version.rb +1 -1
  74. data/lib/ovto/wired_action_set.rb +40 -0
  75. data/lib/ovto/wired_actions.rb +49 -11
  76. data/lib/ovto.rb +27 -0
  77. data/ovto.gemspec +1 -1
  78. metadata +35 -9
@@ -0,0 +1,452 @@
1
+
2
+ <!DOCTYPE HTML>
3
+ <html lang="" >
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
7
+ <title>Install · GitBook</title>
8
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
9
+ <meta name="description" content="">
10
+ <meta name="generator" content="GitBook 3.2.2">
11
+
12
+
13
+
14
+
15
+ <link rel="stylesheet" href="../gitbook/style.css">
16
+
17
+
18
+
19
+
20
+ <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
21
+
22
+
23
+
24
+ <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
25
+
26
+
27
+
28
+ <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+ <meta name="HandheldFriendly" content="true"/>
53
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
54
+ <meta name="apple-mobile-web-app-capable" content="yes">
55
+ <meta name="apple-mobile-web-app-status-bar-style" content="black">
56
+ <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
57
+ <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">
58
+
59
+
60
+
61
+ <link rel="prev" href="tutorial.html" />
62
+
63
+
64
+ </head>
65
+ <body>
66
+
67
+ <div class="book">
68
+ <div class="book-summary">
69
+
70
+
71
+ <div id="book-search-input" role="search">
72
+ <input type="text" placeholder="Type to search" />
73
+ </div>
74
+
75
+
76
+ <nav role="navigation">
77
+
78
+
79
+
80
+ <ul class="summary">
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ <li class="chapter " data-level="1.1" data-path="../">
91
+
92
+ <a href="../">
93
+
94
+
95
+ Introduction
96
+
97
+ </a>
98
+
99
+
100
+
101
+ </li>
102
+
103
+ <li class="chapter " data-level="1.2" data-path="tutorial.html">
104
+
105
+ <a href="tutorial.html">
106
+
107
+
108
+ Getting Started
109
+
110
+ </a>
111
+
112
+
113
+
114
+ </li>
115
+
116
+ <li class="chapter active" data-level="1.3" data-path="install.html">
117
+
118
+ <a href="install.html">
119
+
120
+
121
+ Install
122
+
123
+ </a>
124
+
125
+
126
+
127
+ </li>
128
+
129
+ <li class="chapter " data-level="1.4" >
130
+
131
+ <span>
132
+
133
+
134
+ API
135
+
136
+ </span>
137
+
138
+
139
+
140
+ <ul class="articles">
141
+
142
+
143
+ <li class="chapter " data-level="1.4.1" data-path="../api/app.html">
144
+
145
+ <a href="../api/app.html">
146
+
147
+
148
+ Ovto::App
149
+
150
+ </a>
151
+
152
+
153
+
154
+ </li>
155
+
156
+ <li class="chapter " data-level="1.4.2" data-path="../api/state.html">
157
+
158
+ <a href="../api/state.html">
159
+
160
+
161
+ Ovto::State
162
+
163
+ </a>
164
+
165
+
166
+
167
+ </li>
168
+
169
+ <li class="chapter " data-level="1.4.3" data-path="../api/actions.html">
170
+
171
+ <a href="../api/actions.html">
172
+
173
+
174
+ Ovto::Actions
175
+
176
+ </a>
177
+
178
+
179
+
180
+ </li>
181
+
182
+ <li class="chapter " data-level="1.4.4" data-path="../api/component.html">
183
+
184
+ <a href="../api/component.html">
185
+
186
+
187
+ Ovto::Component
188
+
189
+ </a>
190
+
191
+
192
+
193
+ </li>
194
+
195
+ <li class="chapter " data-level="1.4.5" data-path="../api/pure_component.html">
196
+
197
+ <a href="../api/pure_component.html">
198
+
199
+
200
+ Ovto::PureComponent
201
+
202
+ </a>
203
+
204
+
205
+
206
+ </li>
207
+
208
+ <li class="chapter " data-level="1.4.6" data-path="../api/middleware.html">
209
+
210
+ <a href="../api/middleware.html">
211
+
212
+
213
+ Ovto::Middleware
214
+
215
+ </a>
216
+
217
+
218
+
219
+ </li>
220
+
221
+ <li class="chapter " data-level="1.4.7" data-path="../api/fetch.html">
222
+
223
+ <a href="../api/fetch.html">
224
+
225
+
226
+ Ovto.fetch
227
+
228
+ </a>
229
+
230
+
231
+
232
+ </li>
233
+
234
+
235
+ </ul>
236
+
237
+ </li>
238
+
239
+ <li class="chapter " data-level="1.5" >
240
+
241
+ <span>
242
+
243
+
244
+ Guides
245
+
246
+ </span>
247
+
248
+
249
+
250
+ <ul class="articles">
251
+
252
+
253
+ <li class="chapter " data-level="1.5.1" data-path="debugging.html">
254
+
255
+ <a href="debugging.html">
256
+
257
+
258
+ Debugging
259
+
260
+ </a>
261
+
262
+
263
+
264
+ </li>
265
+
266
+ <li class="chapter " data-level="1.5.2" data-path="development.html">
267
+
268
+ <a href="development.html">
269
+
270
+
271
+ Development
272
+
273
+ </a>
274
+
275
+
276
+
277
+ </li>
278
+
279
+
280
+ </ul>
281
+
282
+ </li>
283
+
284
+
285
+
286
+
287
+ <li class="divider"></li>
288
+
289
+ <li>
290
+ <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
291
+ Published with GitBook
292
+ </a>
293
+ </li>
294
+ </ul>
295
+
296
+
297
+ </nav>
298
+
299
+
300
+ </div>
301
+
302
+ <div class="book-body">
303
+
304
+ <div class="body-inner">
305
+
306
+
307
+
308
+ <div class="book-header" role="navigation">
309
+
310
+
311
+ <!-- Title -->
312
+ <h1>
313
+ <i class="fa fa-circle-o-notch fa-spin"></i>
314
+ <a href=".." >Install</a>
315
+ </h1>
316
+ </div>
317
+
318
+
319
+
320
+
321
+ <div class="page-wrapper" tabindex="-1" role="main">
322
+ <div class="page-inner">
323
+
324
+ <div id="book-search-results">
325
+ <div class="search-noresults">
326
+
327
+ <section class="normal markdown-section">
328
+
329
+ <h1 id="install">Install</h1>
330
+ <h2 id="use-ovto-with-static-files">Use Ovto with static files</h2>
331
+ <pre><code>$ gem i ovto
332
+ $ ovto new myapp --static
333
+ </code></pre><h2 id="use-ovto-with-sinatra">Use Ovto with Sinatra</h2>
334
+ <pre><code>$ gem i ovto
335
+ $ ovto new myapp --sinatra
336
+ </code></pre><h2 id="install-ovto-into-rails-apps">Install Ovto into Rails apps</h2>
337
+ <p>Edit <code>Gemfile</code></p>
338
+ <pre><code class="lang-rb">gem <span class="hljs-string">&apos;opal-rails&apos;</span>
339
+ gem <span class="hljs-string">&apos;ovto&apos;</span>
340
+ </code></pre>
341
+ <p>Run <code>bundle install</code></p>
342
+ <p>Remove <code>app/assets/javascripts/application.js</code></p>
343
+ <p>Create <code>app/assets/javascripts/application.js.rb</code></p>
344
+ <pre><code class="lang-rb"><span class="hljs-keyword">require</span> <span class="hljs-string">&apos;opal&apos;</span>
345
+ <span class="hljs-keyword">require</span> <span class="hljs-string">&apos;rails-ujs&apos;</span>
346
+ <span class="hljs-keyword">require</span> <span class="hljs-string">&apos;activestorage&apos;</span>
347
+ <span class="hljs-keyword">require</span> <span class="hljs-string">&apos;turbolinks&apos;</span>
348
+ require_tree <span class="hljs-string">&apos;.&apos;</span>
349
+ </code></pre>
350
+ <p>Create <code>app/assets/javascripts/foo.js.rb</code> (file name is arbitrary)</p>
351
+ <pre><code class="lang-rb"><span class="hljs-keyword">require</span> <span class="hljs-string">&apos;ovto&apos;</span>
352
+
353
+ <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Foo</span> &lt; Ovto::App</span>
354
+ <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">State</span> &lt; Ovto::State</span>
355
+ <span class="hljs-keyword">end</span>
356
+
357
+ <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Actions</span> &lt; Ovto::Actions</span>
358
+ <span class="hljs-keyword">end</span>
359
+
360
+ <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MainComponent</span> &lt; Ovto::Component</span>
361
+ <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">render</span><span class="hljs-params">(<span class="hljs-symbol">state:</span>)</span></span>
362
+ o <span class="hljs-string">&apos;h1&apos;</span>, <span class="hljs-string">&quot;HELLO&quot;</span>
363
+ <span class="hljs-keyword">end</span>
364
+ <span class="hljs-keyword">end</span>
365
+ <span class="hljs-keyword">end</span>
366
+ </code></pre>
367
+ <p>Edit <code>app/views/&lt;some controller/&lt;some view&gt;.html.erb</code></p>
368
+ <pre><code>&lt;div id=&apos;foo-app&apos;&gt;&lt;/div&gt;
369
+ &lt;%= opal_tag do %&gt;
370
+ Foo.run(id: &apos;foo-app&apos;)
371
+ &lt;% end %&gt;
372
+ </code></pre><p>This should render <code>HELLO</code> in the browser.</p>
373
+ <p>You also need to edit config/environments/production.rb like this before deploy it to production.</p>
374
+ <pre><code class="lang-rb"> <span class="hljs-comment">#config.assets.js_compressor = :uglifier</span>
375
+ config.assets.js_compressor = Uglifier.new(<span class="hljs-symbol">harmony:</span> <span class="hljs-keyword">true</span>)
376
+ </code></pre>
377
+
378
+
379
+ </section>
380
+
381
+ </div>
382
+ <div class="search-results">
383
+ <div class="has-results">
384
+
385
+ <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
386
+ <ul class="search-results-list"></ul>
387
+
388
+ </div>
389
+ <div class="no-results">
390
+
391
+ <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
392
+
393
+ </div>
394
+ </div>
395
+ </div>
396
+
397
+ </div>
398
+ </div>
399
+
400
+ </div>
401
+
402
+
403
+
404
+ <a href="tutorial.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: Getting Started">
405
+ <i class="fa fa-angle-left"></i>
406
+ </a>
407
+
408
+
409
+
410
+
411
+ </div>
412
+
413
+ <script>
414
+ var gitbook = gitbook || [];
415
+ gitbook.push(function() {
416
+ gitbook.page.hasChanged({"page":{"title":"Install","level":"1.3","depth":1,"next":{"title":"API","level":"1.4","depth":1,"ref":"","articles":[{"title":"Ovto::App","level":"1.4.1","depth":2,"path":"api/app.md","ref":"api/app.md","articles":[]},{"title":"Ovto::State","level":"1.4.2","depth":2,"path":"api/state.md","ref":"api/state.md","articles":[]},{"title":"Ovto::Actions","level":"1.4.3","depth":2,"path":"api/actions.md","ref":"api/actions.md","articles":[]},{"title":"Ovto::Component","level":"1.4.4","depth":2,"path":"api/component.md","ref":"api/component.md","articles":[]},{"title":"Ovto::PureComponent","level":"1.4.5","depth":2,"path":"api/pure_component.md","ref":"api/pure_component.md","articles":[]},{"title":"Ovto::Middleware","level":"1.4.6","depth":2,"path":"api/middleware.md","ref":"api/middleware.md","articles":[]},{"title":"Ovto.fetch","level":"1.4.7","depth":2,"path":"api/fetch.md","ref":"api/fetch.md","articles":[]}]},"previous":{"title":"Getting Started","level":"1.2","depth":1,"path":"guides/tutorial.md","ref":"guides/tutorial.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"guides/install.md","mtime":"2019-04-20T11:57:47.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2020-02-29T14:26:27.632Z"},"basePath":"..","book":{"language":""}});
417
+ });
418
+ </script>
419
+ </div>
420
+
421
+
422
+ <script src="../gitbook/gitbook.js"></script>
423
+ <script src="../gitbook/theme.js"></script>
424
+
425
+
426
+ <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
427
+
428
+
429
+
430
+ <script src="../gitbook/gitbook-plugin-search/search.js"></script>
431
+
432
+
433
+
434
+ <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
435
+
436
+
437
+
438
+ <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
439
+
440
+
441
+
442
+ <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
443
+
444
+
445
+
446
+ <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
447
+
448
+
449
+
450
+ </body>
451
+ </html>
452
+