flok 0.0.102 → 0.0.103

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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +3 -0
  3. data/app/drivers/chrome/pipe.rb +66 -51
  4. data/app/drivers/chrome/src/controller.js +20 -1
  5. data/app/drivers/chrome/src/hook.js +10 -12
  6. data/app/drivers/chrome/src/net.js +4 -4
  7. data/app/drivers/chrome/src/sockio.js +2 -2
  8. data/app/drivers/chrome/src/ui.js +18 -15
  9. data/app/kern/mod/event.js +3 -1
  10. data/app/kern/mod/hook.js +13 -1
  11. data/app/kern/mod/ui.js +71 -0
  12. data/docs/controllers.md +14 -0
  13. data/docs/dispatch.md +4 -2
  14. data/docs/kernel_api.md +1 -0
  15. data/docs/kernel_handbook/find_view.md +34 -0
  16. data/docs/kernel_handbook/hooks.md +12 -1
  17. data/docs/mod/controller.md +5 -2
  18. data/docs/mod/hook.md +4 -3
  19. data/docs/mod/persist.md +1 -1
  20. data/docs/mod/ui.md +1 -0
  21. data/docs/user_handbook/hooks.md +38 -14
  22. data/flok.gemspec +2 -0
  23. data/lib/flok/user_compiler.rb +18 -2
  24. data/lib/flok/user_compiler_templates/ctable.js.erb +1 -0
  25. data/lib/flok/user_hook_generators/goto.rb +32 -4
  26. data/lib/flok/version.rb +1 -1
  27. data/spec/env/iface.rb +38 -0
  28. data/spec/env/kern.rb +4 -0
  29. data/spec/iface/driver/controller_spec.rb +25 -6
  30. data/spec/iface/driver/dispatch_spec.rb +7 -0
  31. data/spec/iface/driver/hook_spec.rb +83 -7
  32. data/spec/iface/driver/net_spec.rb +50 -41
  33. data/spec/iface/driver/persist_spec.rb +47 -4
  34. data/spec/iface/driver/ping_spec.rb +1 -1
  35. data/spec/iface/driver/rtc_spec.rb +2 -2
  36. data/spec/iface/driver/sockio_spec.rb +4 -3
  37. data/spec/iface/driver/timer_spec.rb +20 -0
  38. data/spec/iface/driver/ui_spec.rb +27 -4
  39. data/spec/kern/assets/find_view/controller0.rb +24 -0
  40. data/spec/kern/assets/find_view/controller1.rb +35 -0
  41. data/spec/kern/assets/find_view/controller1a.rb +37 -0
  42. data/spec/kern/assets/find_view/controller2.rb +23 -0
  43. data/spec/kern/assets/find_view/controller3.rb +38 -0
  44. data/spec/kern/assets/find_view/controller4.rb +38 -0
  45. data/spec/kern/assets/find_view/controller5.rb +52 -0
  46. data/spec/kern/assets/find_view/controller6.rb +37 -0
  47. data/spec/kern/assets/find_view/controller7.rb +37 -0
  48. data/spec/kern/assets/find_view/controller8.rb +53 -0
  49. data/spec/kern/assets/find_view/controller9.rb +67 -0
  50. data/spec/kern/assets/hook_entry_points/controller0.rb +13 -1
  51. data/spec/kern/assets/push_count.rb +42 -0
  52. data/spec/kern/controller_spec.rb +34 -0
  53. data/spec/kern/find_view_spec.rb +269 -0
  54. data/spec/kern/hook_entry_points_and_manifest_spec.rb +60 -0
  55. data/spec/kern/hook_user_generators_spec.rb +100 -0
  56. data/spec/lib/helpers.rb +1 -2
  57. metadata +58 -2
@@ -0,0 +1,24 @@
1
+ controller :my_controller do
2
+ spots "content"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+
8
+ find_view_res = find_view(__base__, {
9
+ "my_controller2": {
10
+ "__leaf__": "foo"
11
+ }
12
+ });
13
+ }
14
+ end
15
+ end
16
+
17
+ controller :my_controller2 do
18
+ action :index do
19
+ on_entry %{
20
+ my_controller2_base = __base__;
21
+ }
22
+ end
23
+ end
24
+
@@ -0,0 +1,35 @@
1
+ controller :my_controller do
2
+ spots "content", "alt"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+ Embed("my_controller3", "alt", {});
8
+
9
+ find_view_res = find_view(__base__, {
10
+ "my_controller2": {
11
+ "__leaf__": "foo"
12
+ },
13
+ "my_controller3": {
14
+ "__leaf__": "foo2"
15
+ }
16
+ });
17
+ }
18
+ end
19
+ end
20
+
21
+ controller :my_controller2 do
22
+ action :index do
23
+ on_entry %{
24
+ my_controller2_base = __base__;
25
+ }
26
+ end
27
+ end
28
+
29
+ controller :my_controller3 do
30
+ action :index do
31
+ on_entry %{
32
+ my_controller3_base = __base__;
33
+ }
34
+ end
35
+ end
@@ -0,0 +1,37 @@
1
+ controller :my_controller do
2
+ spots "content", "alt"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+
8
+ find_view_res = find_view(__base__, {
9
+ "my_controller2": {
10
+ "__leaf__": "foo",
11
+ "my_controller3": {
12
+ "__leaf__": "foo2"
13
+ }
14
+ },
15
+ });
16
+ }
17
+ end
18
+ end
19
+
20
+ controller :my_controller2 do
21
+ spots "content"
22
+
23
+ action :index do
24
+ on_entry %{
25
+ my_controller2_base = __base__;
26
+ Embed("my_controller3", "content", {});
27
+ }
28
+ end
29
+ end
30
+
31
+ controller :my_controller3 do
32
+ action :index do
33
+ on_entry %{
34
+ my_controller3_base = __base__;
35
+ }
36
+ end
37
+ end
@@ -0,0 +1,23 @@
1
+ controller :my_controller do
2
+ spots "content"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+
8
+ find_view_res = find_view(__base__, {
9
+ ".": {
10
+ "__leaf__": "foo"
11
+ }
12
+ });
13
+ }
14
+ end
15
+ end
16
+
17
+ controller :my_controller2 do
18
+ action :index do
19
+ on_entry %{
20
+ my_controller2_base = __base__;
21
+ }
22
+ end
23
+ end
@@ -0,0 +1,38 @@
1
+ controller :my_controller do
2
+ spots "content"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+
8
+ find_view_res = find_view(__base__, {
9
+ "my_controller2": {
10
+ ".": {
11
+ "__leaf__": "foo"
12
+ }
13
+ }
14
+ });
15
+ }
16
+ end
17
+ end
18
+
19
+ controller :my_controller2 do
20
+ spots "content"
21
+
22
+ action :index do
23
+ on_entry %{
24
+ my_controller2_base = __base__;
25
+
26
+ Embed("my_controller3", "content", {});
27
+ }
28
+ end
29
+ end
30
+
31
+ controller :my_controller3 do
32
+ action :index do
33
+ on_entry %{
34
+ my_controller3_base = __base__;
35
+ }
36
+ end
37
+ end
38
+
@@ -0,0 +1,38 @@
1
+ controller :my_controller do
2
+ spots "content"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+
8
+ find_view_res = find_view(__base__, {
9
+ ".": {
10
+ "my_controller3": {
11
+ "__leaf__": "foo"
12
+ }
13
+ }
14
+ });
15
+ }
16
+ end
17
+ end
18
+
19
+ controller :my_controller2 do
20
+ spots "content"
21
+
22
+ action :index do
23
+ on_entry %{
24
+ my_controller2_base = __base__;
25
+
26
+ Embed("my_controller3", "content", {});
27
+ }
28
+ end
29
+ end
30
+
31
+ controller :my_controller3 do
32
+ action :index do
33
+ on_entry %{
34
+ my_controller3_base = __base__;
35
+ }
36
+ end
37
+ end
38
+
@@ -0,0 +1,52 @@
1
+ controller :my_controller do
2
+ spots "content"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+
8
+ find_view_res = find_view(__base__, {
9
+ "+": {
10
+ "my_controller4": {
11
+ "__leaf__": "foo"
12
+ }
13
+ }
14
+ });
15
+ }
16
+ end
17
+ end
18
+
19
+ controller :my_controller2 do
20
+ spots "content"
21
+
22
+ action :index do
23
+ on_entry %{
24
+ my_controller2_base = __base__;
25
+
26
+ Embed("my_controller3", "content", {});
27
+ }
28
+ end
29
+ end
30
+
31
+ controller :my_controller3 do
32
+ spots "content"
33
+
34
+ action :index do
35
+ on_entry %{
36
+ my_controller3_base = __base__;
37
+
38
+ Embed("my_controller4", "content", {});
39
+ }
40
+ end
41
+ end
42
+
43
+ controller :my_controller4 do
44
+ action :index do
45
+ on_entry %{
46
+ my_controller4_base = __base__;
47
+ }
48
+ end
49
+ end
50
+
51
+
52
+
@@ -0,0 +1,37 @@
1
+ controller :my_controller do
2
+ spots "content"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+
8
+ find_view_res = find_view(__base__, {
9
+ "+": {
10
+ ".": {
11
+ "__leaf__": "foo"
12
+ }
13
+ }
14
+ });
15
+ }
16
+ end
17
+ end
18
+
19
+ controller :my_controller2 do
20
+ spots "content"
21
+
22
+ action :index do
23
+ on_entry %{
24
+ my_controller2_base = __base__;
25
+
26
+ Embed("my_controller3", "content", {});
27
+ }
28
+ end
29
+ end
30
+
31
+ controller :my_controller3 do
32
+ action :index do
33
+ on_entry %{
34
+ my_controller3_base = __base__;
35
+ }
36
+ end
37
+ end
@@ -0,0 +1,37 @@
1
+ controller :my_controller do
2
+ spots "content"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+
8
+ find_view_res = find_view(__base__, {
9
+ "+": {
10
+ ".": {
11
+ "__leaf__": "foo"
12
+ }
13
+ }
14
+ });
15
+ }
16
+ end
17
+ end
18
+
19
+ controller :my_controller2 do
20
+ spots "content"
21
+
22
+ action :index do
23
+ on_entry %{
24
+ my_controller2_base = __base__;
25
+
26
+ Embed("my_controller3", "content", {});
27
+ }
28
+ end
29
+ end
30
+
31
+ controller :my_controller3 do
32
+ action :index do
33
+ on_entry %{
34
+ my_controller3_base = __base__;
35
+ }
36
+ end
37
+ end
@@ -0,0 +1,53 @@
1
+ controller :my_controller do
2
+ spots "content"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+
8
+ find_view_res = find_view(__base__, {
9
+ ".": {
10
+ "__leaf__": "foo1",
11
+ "+": {
12
+ ".": {
13
+ "__leaf__": "foo2"
14
+ }
15
+ }
16
+ }
17
+ });
18
+ }
19
+ end
20
+ end
21
+
22
+ controller :my_controller2 do
23
+ spots "content"
24
+
25
+ action :index do
26
+ on_entry %{
27
+ my_controller2_base = __base__;
28
+
29
+ Embed("my_controller3", "content", {});
30
+ }
31
+ end
32
+ end
33
+
34
+ controller :my_controller3 do
35
+ spots "content"
36
+
37
+ action :index do
38
+ on_entry %{
39
+ my_controller3_base = __base__;
40
+
41
+ Embed("my_controller4", "content", {});
42
+ }
43
+ end
44
+ end
45
+
46
+ controller :my_controller4 do
47
+ action :index do
48
+ on_entry %{
49
+ my_controller4_base = __base__;
50
+ }
51
+ end
52
+ end
53
+
@@ -0,0 +1,67 @@
1
+ controller :my_controller do
2
+ spots "content"
3
+
4
+ action :index do
5
+ on_entry %{
6
+ Embed("my_controller2", "content", {});
7
+
8
+ find_view_res = find_view(__base__, {
9
+ ".": {
10
+ ".": {
11
+ "__leaf__": "foo1",
12
+ "+": {
13
+ ".": {
14
+ "__leaf__": "foo2"
15
+ }
16
+ }
17
+ }
18
+ }
19
+ });
20
+ }
21
+ end
22
+ end
23
+
24
+ controller :my_controller2 do
25
+ spots "content"
26
+
27
+ action :index do
28
+ on_entry %{
29
+ my_controller2_base = __base__;
30
+
31
+ Embed("my_controller3", "content", {});
32
+ }
33
+ end
34
+ end
35
+
36
+ controller :my_controller3 do
37
+ spots "content"
38
+
39
+ action :index do
40
+ on_entry %{
41
+ my_controller3_base = __base__;
42
+
43
+ Embed("my_controller4", "content", {});
44
+ }
45
+ end
46
+ end
47
+
48
+ controller :my_controller4 do
49
+ spots "content"
50
+
51
+ action :index do
52
+ on_entry %{
53
+ my_controller4_base = __base__;
54
+
55
+ Embed("my_controller5", "content", {});
56
+ }
57
+ end
58
+ end
59
+
60
+ controller :my_controller5 do
61
+ action :index do
62
+ on_entry %{
63
+ my_controller5_base = __base__;
64
+ }
65
+ end
66
+ end
67
+