ovto 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/CHANGELOG.md +5 -0
  4. data/Gemfile +3 -2
  5. data/Gemfile.lock +21 -21
  6. data/README.md +2 -2
  7. data/book/SUMMARY.md +1 -1
  8. data/book/api/fetch.md +3 -3
  9. data/book/api/pure_component.md +27 -0
  10. data/book/guides/install.md +76 -0
  11. data/book/guides/tutorial.md +3 -3
  12. data/book/ovtologo.png +0 -0
  13. data/docs/api/Ovto.html +18 -18
  14. data/docs/api/Ovto/Actions.html +1 -1
  15. data/docs/api/Ovto/App.html +1 -1
  16. data/docs/api/Ovto/Component.html +18 -10
  17. data/docs/api/Ovto/Component/MoreThanOneNode.html +1 -1
  18. data/docs/api/Ovto/PureComponent.html +368 -0
  19. data/docs/api/Ovto/PureComponent/StateIsNotAvailable.html +124 -0
  20. data/docs/api/Ovto/Runtime.html +1 -1
  21. data/docs/api/Ovto/State.html +1 -1
  22. data/docs/api/Ovto/State/MissingValue.html +1 -1
  23. data/docs/api/Ovto/State/UnknownKey.html +1 -1
  24. data/docs/api/Ovto/WiredActions.html +1 -1
  25. data/docs/api/_index.html +26 -4
  26. data/docs/api/actions.html +8 -8
  27. data/docs/api/app.html +8 -8
  28. data/docs/api/class_list.html +1 -1
  29. data/docs/api/component.html +8 -8
  30. data/docs/api/fetch.html +11 -11
  31. data/docs/api/file.README.html +75 -79
  32. data/docs/api/index.html +75 -79
  33. data/docs/api/method_list.html +43 -19
  34. data/docs/api/pure_component.md +27 -0
  35. data/docs/api/state.html +8 -8
  36. data/docs/api/top-level-namespace.html +1 -1
  37. data/docs/gitbook/gitbook.js +2 -2
  38. data/docs/gitbook/theme.js +1 -1
  39. data/docs/guides/debugging.html +8 -8
  40. data/docs/guides/development.html +8 -8
  41. data/docs/guides/install.html +426 -0
  42. data/docs/guides/tutorial.html +74 -65
  43. data/docs/index.html +10 -16
  44. data/docs/ovtologo.png +0 -0
  45. data/docs/search_index.json +1 -1
  46. data/examples/sinatra/Gemfile.lock +2 -2
  47. data/examples/static/Gemfile.lock +6 -10
  48. data/lib/ovto.rb +1 -0
  49. data/lib/ovto/component.rb +25 -12
  50. data/lib/ovto/fetch.rb +1 -1
  51. data/lib/ovto/pure_component.rb +22 -0
  52. data/lib/ovto/version.rb +1 -1
  53. data/ovto.gemspec +1 -1
  54. metadata +21 -5
@@ -7,7 +7,7 @@
7
7
  <title>Development · GitBook</title>
8
8
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
9
9
  <meta name="description" content="">
10
- <meta name="generator" content="GitBook 3.2.3">
10
+ <meta name="generator" content="GitBook 3.2.2">
11
11
 
12
12
 
13
13
 
@@ -100,12 +100,12 @@
100
100
 
101
101
  </li>
102
102
 
103
- <li class="chapter " data-level="1.2" data-path="../">
103
+ <li class="chapter " data-level="1.2" data-path="tutorial.html">
104
104
 
105
- <a href="../">
105
+ <a href="tutorial.html">
106
106
 
107
107
 
108
- Introduction
108
+ Getting Started
109
109
 
110
110
  </a>
111
111
 
@@ -113,12 +113,12 @@
113
113
 
114
114
  </li>
115
115
 
116
- <li class="chapter " data-level="1.3" data-path="tutorial.html">
116
+ <li class="chapter " data-level="1.3" data-path="install.html">
117
117
 
118
- <a href="tutorial.html">
118
+ <a href="install.html">
119
119
 
120
120
 
121
- Getting Started
121
+ Install
122
122
 
123
123
  </a>
124
124
 
@@ -348,7 +348,7 @@
348
348
  <script>
349
349
  var gitbook = gitbook || [];
350
350
  gitbook.push(function() {
351
- gitbook.page.hasChanged({"page":{"title":"Development","level":"1.5.2","depth":2,"previous":{"title":"Debugging","level":"1.5.1","depth":2,"path":"guides/debugging.md","ref":"guides/debugging.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/development.md","mtime":"2018-05-24T07:03:24.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-19T03:51:35.766Z"},"basePath":"..","book":{"language":""}});
351
+ gitbook.page.hasChanged({"page":{"title":"Development","level":"1.5.2","depth":2,"previous":{"title":"Debugging","level":"1.5.1","depth":2,"path":"guides/debugging.md","ref":"guides/debugging.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/development.md","mtime":"2018-05-24T07:03:24.000Z","type":"markdown"},"gitbook":{"version":"3.2.2","time":"2019-08-07T16:14:36.732Z"},"basePath":"..","book":{"language":""}});
352
352
  });
353
353
  </script>
354
354
  </div>
@@ -0,0 +1,426 @@
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/fetch.html">
196
+
197
+ <a href="../api/fetch.html">
198
+
199
+
200
+ Ovto.fetch
201
+
202
+ </a>
203
+
204
+
205
+
206
+ </li>
207
+
208
+
209
+ </ul>
210
+
211
+ </li>
212
+
213
+ <li class="chapter " data-level="1.5" >
214
+
215
+ <span>
216
+
217
+
218
+ Guides
219
+
220
+ </span>
221
+
222
+
223
+
224
+ <ul class="articles">
225
+
226
+
227
+ <li class="chapter " data-level="1.5.1" data-path="debugging.html">
228
+
229
+ <a href="debugging.html">
230
+
231
+
232
+ Debugging
233
+
234
+ </a>
235
+
236
+
237
+
238
+ </li>
239
+
240
+ <li class="chapter " data-level="1.5.2" data-path="development.html">
241
+
242
+ <a href="development.html">
243
+
244
+
245
+ Development
246
+
247
+ </a>
248
+
249
+
250
+
251
+ </li>
252
+
253
+
254
+ </ul>
255
+
256
+ </li>
257
+
258
+
259
+
260
+
261
+ <li class="divider"></li>
262
+
263
+ <li>
264
+ <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
265
+ Published with GitBook
266
+ </a>
267
+ </li>
268
+ </ul>
269
+
270
+
271
+ </nav>
272
+
273
+
274
+ </div>
275
+
276
+ <div class="book-body">
277
+
278
+ <div class="body-inner">
279
+
280
+
281
+
282
+ <div class="book-header" role="navigation">
283
+
284
+
285
+ <!-- Title -->
286
+ <h1>
287
+ <i class="fa fa-circle-o-notch fa-spin"></i>
288
+ <a href=".." >Install</a>
289
+ </h1>
290
+ </div>
291
+
292
+
293
+
294
+
295
+ <div class="page-wrapper" tabindex="-1" role="main">
296
+ <div class="page-inner">
297
+
298
+ <div id="book-search-results">
299
+ <div class="search-noresults">
300
+
301
+ <section class="normal markdown-section">
302
+
303
+ <h1 id="install">Install</h1>
304
+ <h2 id="use-ovto-with-static-files">Use Ovto with static files</h2>
305
+ <pre><code>$ gem i ovto
306
+ $ ovto new myapp --static
307
+ </code></pre><h2 id="use-ovto-with-sinatra">Use Ovto with Sinatra</h2>
308
+ <pre><code>$ gem i ovto
309
+ $ ovto new myapp --sinatra
310
+ </code></pre><h2 id="install-ovto-into-rails-apps">Install Ovto into Rails apps</h2>
311
+ <p>Edit <code>Gemfile</code></p>
312
+ <pre><code class="lang-rb">gem <span class="hljs-string">&apos;opal-rails&apos;</span>
313
+ gem <span class="hljs-string">&apos;ovto&apos;</span>
314
+ </code></pre>
315
+ <p>Run <code>bundle install</code></p>
316
+ <p>Remove <code>app/assets/javascripts/application.js</code></p>
317
+ <p>Create <code>app/assets/javascripts/application.js.rb</code></p>
318
+ <pre><code class="lang-rb"><span class="hljs-keyword">require</span> <span class="hljs-string">&apos;opal&apos;</span>
319
+ <span class="hljs-keyword">require</span> <span class="hljs-string">&apos;rails-ujs&apos;</span>
320
+ <span class="hljs-keyword">require</span> <span class="hljs-string">&apos;activestorage&apos;</span>
321
+ <span class="hljs-keyword">require</span> <span class="hljs-string">&apos;turbolinks&apos;</span>
322
+ require_tree <span class="hljs-string">&apos;.&apos;</span>
323
+ </code></pre>
324
+ <p>Create <code>app/assets/javascripts/foo.js.rb</code> (file name is arbitrary)</p>
325
+ <pre><code class="lang-rb"><span class="hljs-keyword">require</span> <span class="hljs-string">&apos;ovto&apos;</span>
326
+
327
+ <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Foo</span> &lt; Ovto::App</span>
328
+ <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">State</span> &lt; Ovto::State</span>
329
+ <span class="hljs-keyword">end</span>
330
+
331
+ <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Actions</span> &lt; Ovto::Actions</span>
332
+ <span class="hljs-keyword">end</span>
333
+
334
+ <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MainComponent</span> &lt; Ovto::Component</span>
335
+ <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>
336
+ o <span class="hljs-string">&apos;h1&apos;</span>, <span class="hljs-string">&quot;HELLO&quot;</span>
337
+ <span class="hljs-keyword">end</span>
338
+ <span class="hljs-keyword">end</span>
339
+ <span class="hljs-keyword">end</span>
340
+ </code></pre>
341
+ <p>Edit <code>app/views/&lt;some controller/&lt;some view&gt;.html.erb</code></p>
342
+ <pre><code>&lt;div id=&apos;foo-app&apos;&gt;&lt;/div&gt;
343
+ &lt;%= opal_tag do %&gt;
344
+ Foo.run(id: &apos;foo-app&apos;)
345
+ &lt;% end %&gt;
346
+ </code></pre><p>This should render <code>HELLO</code> in the browser.</p>
347
+ <p>You also need to edit config/environments/production.rb like this before deploy it to production.</p>
348
+ <pre><code class="lang-rb"> <span class="hljs-comment">#config.assets.js_compressor = :uglifier</span>
349
+ config.assets.js_compressor = Uglifier.new(<span class="hljs-symbol">harmony:</span> <span class="hljs-keyword">true</span>)
350
+ </code></pre>
351
+
352
+
353
+ </section>
354
+
355
+ </div>
356
+ <div class="search-results">
357
+ <div class="has-results">
358
+
359
+ <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
360
+ <ul class="search-results-list"></ul>
361
+
362
+ </div>
363
+ <div class="no-results">
364
+
365
+ <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
366
+
367
+ </div>
368
+ </div>
369
+ </div>
370
+
371
+ </div>
372
+ </div>
373
+
374
+ </div>
375
+
376
+
377
+
378
+ <a href="tutorial.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: Getting Started">
379
+ <i class="fa fa-angle-left"></i>
380
+ </a>
381
+
382
+
383
+
384
+
385
+ </div>
386
+
387
+ <script>
388
+ var gitbook = gitbook || [];
389
+ gitbook.push(function() {
390
+ 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.fetch","level":"1.4.5","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":"2019-08-07T16:14:36.732Z"},"basePath":"..","book":{"language":""}});
391
+ });
392
+ </script>
393
+ </div>
394
+
395
+
396
+ <script src="../gitbook/gitbook.js"></script>
397
+ <script src="../gitbook/theme.js"></script>
398
+
399
+
400
+ <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
401
+
402
+
403
+
404
+ <script src="../gitbook/gitbook-plugin-search/search.js"></script>
405
+
406
+
407
+
408
+ <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
409
+
410
+
411
+
412
+ <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
413
+
414
+
415
+
416
+ <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
417
+
418
+
419
+
420
+ <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
421
+
422
+
423
+
424
+ </body>
425
+ </html>
426
+