scarpe 0.2.0 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (239) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +4 -0
  3. data/.yardopts +11 -0
  4. data/Gemfile +3 -0
  5. data/Gemfile.lock +112 -0
  6. data/README.md +31 -24
  7. data/Rakefile +13 -1
  8. data/docs/yard/catscradle.md +44 -0
  9. data/docs/yard/template/default/fulldoc/html/setup.rb +13 -0
  10. data/docs/yard/template/default/layout/html/setup.rb +9 -0
  11. data/examples/background_with_image.rb +16 -0
  12. data/examples/bloopsaphone/working/bronx_army_knife.rb +66 -0
  13. data/examples/bloopsaphone/working/morning_serenity.rb +21 -0
  14. data/examples/bloopsaphone/working/simpsons_theme_song_by_why.rb +6 -4
  15. data/examples/button_go_away.rb +1 -1
  16. data/examples/check.rb +18 -0
  17. data/examples/clear_and_append.rb +24 -0
  18. data/examples/download_and_show_image.rb +28 -0
  19. data/examples/edit_box.rb +3 -5
  20. data/examples/fonts.rb +2 -2
  21. data/examples/get_headers.rb +10 -0
  22. data/examples/highlander.rb +2 -0
  23. data/examples/link.rb +2 -2
  24. data/examples/local_fonts.rb +4 -0
  25. data/examples/local_images.rb +4 -0
  26. data/examples/motion_events.rb +20 -0
  27. data/examples/parse_xl_funnies.rb +58 -0
  28. data/examples/radio/radio.rb +16 -0
  29. data/examples/radio/radio_groups.rb +18 -0
  30. data/examples/radio/radio_same_slot.rb +6 -0
  31. data/examples/ruby_racer.rb +13 -15
  32. data/examples/selfitude.rb +18 -0
  33. data/examples/shapes/shapes_fill.rb +4 -3
  34. data/examples/shoes_school.rb +2 -4
  35. data/examples/show_hide.rb +6 -0
  36. data/examples/skip_ci/change_my_audio_source.rb +21 -0
  37. data/examples/skip_ci/guitar_fretboard.rb +137 -0
  38. data/examples/video.rb +10 -0
  39. data/exe/scarpe +42 -66
  40. data/fonts/Pacifico.ttf +0 -0
  41. data/lacci/Gemfile +22 -0
  42. data/lacci/Gemfile.lock +72 -0
  43. data/lacci/Rakefile +12 -0
  44. data/lacci/lacci.gemspec +37 -0
  45. data/lacci/lib/lacci/scarpe_cli.rb +70 -0
  46. data/lacci/lib/lacci/scarpe_core.rb +21 -0
  47. data/lacci/lib/lacci/version.rb +13 -0
  48. data/lacci/lib/shoes/app.rb +264 -0
  49. data/{lib/scarpe → lacci/lib/shoes}/background.rb +1 -1
  50. data/{lib/scarpe → lacci/lib/shoes}/border.rb +1 -1
  51. data/{lib/scarpe → lacci/lib/shoes}/colors.rb +1 -1
  52. data/lacci/lib/shoes/constants.rb +29 -0
  53. data/{lib/scarpe → lacci/lib/shoes}/display_service.rb +40 -45
  54. data/lacci/lib/shoes/download.rb +123 -0
  55. data/lacci/lib/shoes/log.rb +71 -0
  56. data/lacci/lib/shoes/spacing.rb +9 -0
  57. data/{lib/scarpe → lacci/lib/shoes}/widget.rb +63 -43
  58. data/{lib/scarpe → lacci/lib/shoes/widgets}/alert.rb +3 -3
  59. data/{lib/scarpe → lacci/lib/shoes/widgets}/arc.rb +7 -5
  60. data/{lib/scarpe → lacci/lib/shoes/widgets}/button.rb +3 -3
  61. data/lacci/lib/shoes/widgets/check.rb +28 -0
  62. data/lacci/lib/shoes/widgets/document_root.rb +20 -0
  63. data/{lib/scarpe → lacci/lib/shoes/widgets}/edit_box.rb +10 -5
  64. data/{lib/scarpe → lacci/lib/shoes/widgets}/edit_line.rb +2 -2
  65. data/lacci/lib/shoes/widgets/flow.rb +22 -0
  66. data/lacci/lib/shoes/widgets/font.rb +14 -0
  67. data/{lib/scarpe → lacci/lib/shoes/widgets}/image.rb +3 -7
  68. data/lacci/lib/shoes/widgets/line.rb +18 -0
  69. data/{lib/scarpe → lacci/lib/shoes/widgets}/link.rb +2 -2
  70. data/{lib/scarpe → lacci/lib/shoes/widgets}/list_box.rb +2 -2
  71. data/{lib/scarpe → lacci/lib/shoes/widgets}/para.rb +4 -26
  72. data/lacci/lib/shoes/widgets/radio.rb +35 -0
  73. data/lacci/lib/shoes/widgets/shape.rb +37 -0
  74. data/lacci/lib/shoes/widgets/slot.rb +75 -0
  75. data/{lib/scarpe → lacci/lib/shoes/widgets}/span.rb +2 -2
  76. data/lacci/lib/shoes/widgets/stack.rb +24 -0
  77. data/{lib/scarpe → lacci/lib/shoes/widgets}/star.rb +6 -9
  78. data/lacci/lib/shoes/widgets/subscription_item.rb +60 -0
  79. data/lacci/lib/shoes/widgets/text_widget.rb +51 -0
  80. data/lacci/lib/shoes/widgets/video.rb +15 -0
  81. data/lacci/lib/shoes/widgets.rb +29 -0
  82. data/lacci/lib/shoes.rb +127 -0
  83. data/lacci/test/test_colors.rb +39 -0
  84. data/lacci/test/test_helper.rb +9 -0
  85. data/lacci/test/test_lacci.rb +9 -0
  86. data/lib/scarpe/cats_cradle.rb +249 -0
  87. data/lib/scarpe/evented_assertions.rb +88 -0
  88. data/lib/scarpe/version.rb +1 -1
  89. data/lib/scarpe/wv/alert.rb +3 -2
  90. data/lib/scarpe/wv/app.rb +30 -8
  91. data/lib/scarpe/wv/arc.rb +5 -6
  92. data/lib/scarpe/wv/background.rb +10 -1
  93. data/lib/scarpe/wv/border.rb +5 -3
  94. data/lib/scarpe/wv/button.rb +11 -9
  95. data/lib/scarpe/wv/check.rb +29 -0
  96. data/lib/scarpe/wv/control_interface.rb +14 -20
  97. data/lib/scarpe/wv/control_interface_test.rb +13 -28
  98. data/lib/scarpe/wv/document_root.rb +3 -45
  99. data/lib/scarpe/wv/edit_box.rb +5 -7
  100. data/lib/scarpe/wv/edit_line.rb +2 -2
  101. data/lib/scarpe/wv/flow.rb +10 -20
  102. data/lib/scarpe/wv/font.rb +36 -0
  103. data/lib/scarpe/wv/html.rb +3 -2
  104. data/lib/scarpe/wv/image.rb +7 -2
  105. data/lib/scarpe/wv/line.rb +4 -7
  106. data/lib/scarpe/wv/link.rb +1 -0
  107. data/lib/scarpe/wv/list_box.rb +3 -3
  108. data/lib/scarpe/wv/para.rb +16 -14
  109. data/lib/scarpe/wv/radio.rb +34 -0
  110. data/lib/scarpe/wv/shape.rb +44 -8
  111. data/lib/scarpe/wv/slot.rb +81 -0
  112. data/lib/scarpe/wv/spacing.rb +1 -1
  113. data/lib/scarpe/wv/span.rb +10 -8
  114. data/lib/scarpe/wv/stack.rb +10 -30
  115. data/lib/scarpe/wv/star.rb +11 -12
  116. data/lib/scarpe/wv/subscription_item.rb +50 -0
  117. data/lib/scarpe/wv/video.rb +34 -0
  118. data/lib/scarpe/wv/web_wrangler.rb +238 -58
  119. data/lib/scarpe/wv/webview_local_display.rb +27 -5
  120. data/lib/scarpe/wv/webview_relay_display.rb +18 -119
  121. data/lib/scarpe/wv/webview_relay_util.rb +143 -0
  122. data/lib/scarpe/wv/widget.rb +80 -11
  123. data/lib/scarpe/wv/wv_display_worker.rb +17 -4
  124. data/lib/scarpe/wv.rb +33 -4
  125. data/lib/scarpe/wv_local.rb +1 -1
  126. data/lib/scarpe/wv_relay.rb +1 -1
  127. data/lib/scarpe.rb +3 -32
  128. data/scarpe-components/.gitignore +1 -0
  129. data/scarpe-components/Gemfile +22 -0
  130. data/scarpe-components/README.md +35 -0
  131. data/scarpe-components/Rakefile +12 -0
  132. data/scarpe-components/lib/scarpe/components/base64.rb +29 -0
  133. data/scarpe-components/lib/scarpe/components/file_helpers.rb +65 -0
  134. data/scarpe-components/lib/scarpe/components/modular_logger.rb +113 -0
  135. data/scarpe-components/lib/scarpe/components/print_logger.rb +43 -0
  136. data/{lib/scarpe → scarpe-components/lib/scarpe/components}/promises.rb +102 -35
  137. data/scarpe-components/lib/scarpe/components/segmented_file_loader.rb +170 -0
  138. data/scarpe-components/lib/scarpe/components/unit_test_helpers.rb +217 -0
  139. data/scarpe-components/lib/scarpe/components/version.rb +7 -0
  140. data/scarpe-components/scarpe-components.gemspec +38 -0
  141. data/scarpe-components/test/test_components.rb +9 -0
  142. data/scarpe-components/test/test_helper.rb +23 -0
  143. data/scarpe-components/test/test_promises.rb +260 -0
  144. data/scarpe-components/test/test_segmented_app_files.rb +182 -0
  145. data/{lib/scarpe → spikes}/glibui/widget.rb +2 -2
  146. data/{lib/scarpe → spikes}/glibui.rb +1 -1
  147. data/templates/basic_class_template.erb +1 -1
  148. data/templates/class_template_with_event_bind.erb +1 -1
  149. data/templates/class_template_with_shapes.erb +1 -1
  150. data/templates/webview_template.erb +0 -3
  151. metadata +165 -117
  152. data/examples/fill.rb +0 -25
  153. data/examples/legacy/not_checked/shoes-contrib/basic/class-book.yaml +0 -387
  154. data/examples/legacy/not_checked/shoes-contrib/good/good-clock.rb +0 -51
  155. data/examples/legacy/not_checked/shoes-contrib/good/good-follow.rb +0 -26
  156. data/examples/legacy/not_checked/shoes-contrib/good/good-reminder.rb +0 -174
  157. data/examples/legacy/not_checked/shoes-contrib/good/good-vjot.rb +0 -56
  158. data/examples/legacy/not_checked/shoes-contrib/simple/simple-timer.rb +0 -13
  159. data/examples/legacy/not_checked/shoes-dep-samples/good-clock.rb +0 -51
  160. data/examples/legacy/not_checked/shoes-dep-samples/good-follow.rb +0 -26
  161. data/examples/legacy/not_checked/shoes-dep-samples/good-reminder.rb +0 -174
  162. data/examples/legacy/not_checked/shoes-dep-samples/good-vjot.rb +0 -56
  163. data/examples/legacy/not_checked/shoes-dep-samples/simple-accordion.rb +0 -75
  164. data/examples/legacy/not_checked/shoes-dep-samples/simple-anim-shapes.rb +0 -17
  165. data/examples/legacy/not_checked/shoes-dep-samples/simple-anim-text.rb +0 -13
  166. data/examples/legacy/not_checked/shoes-dep-samples/simple-arc.rb +0 -23
  167. data/examples/legacy/not_checked/shoes-dep-samples/simple-bounce.rb +0 -24
  168. data/examples/legacy/not_checked/shoes-dep-samples/simple-calc.rb +0 -70
  169. data/examples/legacy/not_checked/shoes-dep-samples/simple-chipmunk.rb +0 -26
  170. data/examples/legacy/not_checked/shoes-dep-samples/simple-control-sizes.rb +0 -24
  171. data/examples/legacy/not_checked/shoes-dep-samples/simple-curve.rb +0 -26
  172. data/examples/legacy/not_checked/shoes-dep-samples/simple-dialogs.rb +0 -29
  173. data/examples/legacy/not_checked/shoes-dep-samples/simple-draw.rb +0 -13
  174. data/examples/legacy/not_checked/shoes-dep-samples/simple-editor.rb +0 -28
  175. data/examples/legacy/not_checked/shoes-dep-samples/simple-form.rb +0 -28
  176. data/examples/legacy/not_checked/shoes-dep-samples/simple-form.shy +0 -0
  177. data/examples/legacy/not_checked/shoes-dep-samples/simple-mask.rb +0 -21
  178. data/examples/legacy/not_checked/shoes-dep-samples/simple-menu.rb +0 -31
  179. data/examples/legacy/not_checked/shoes-dep-samples/simple-menu1.rb +0 -35
  180. data/examples/legacy/not_checked/shoes-dep-samples/simple-rubygems.rb +0 -29
  181. data/examples/legacy/not_checked/shoes-dep-samples/simple-slide.rb +0 -45
  182. data/examples/legacy/not_checked/shoes-dep-samples/simple-sphere.rb +0 -28
  183. data/examples/legacy/not_checked/shoes-dep-samples/simple-sqlite3.rb +0 -13
  184. data/examples/legacy/not_checked/shoes-dep-samples/simple-timer.rb +0 -13
  185. data/examples/legacy/not_checked/shoes-dep-samples/simple-video.rb +0 -13
  186. data/examples/legacy/not_checked/simple/anim-text.rb +0 -13
  187. data/examples/legacy/not_checked/simple/arc.rb +0 -23
  188. data/examples/legacy/not_checked/simple/bounce.rb +0 -24
  189. data/examples/legacy/not_checked/simple/chipmunk.rb +0 -26
  190. data/examples/legacy/not_checked/simple/curve.rb +0 -26
  191. data/examples/legacy/not_checked/simple/dialogs.rb +0 -29
  192. data/examples/legacy/not_checked/simple/downloader.rb +0 -40
  193. data/examples/legacy/not_checked/simple/draw.rb +0 -13
  194. data/examples/legacy/not_checked/simple/mask.rb +0 -21
  195. data/examples/legacy/not_checked/simple/slide.rb +0 -45
  196. data/examples/legacy/not_checked/simple/sphere.rb +0 -28
  197. data/lib/constants.rb +0 -5
  198. data/lib/scarpe/app.rb +0 -78
  199. data/lib/scarpe/document_root.rb +0 -20
  200. data/lib/scarpe/fill.rb +0 -23
  201. data/lib/scarpe/flow.rb +0 -19
  202. data/lib/scarpe/line.rb +0 -25
  203. data/lib/scarpe/logger.rb +0 -155
  204. data/lib/scarpe/shape.rb +0 -19
  205. data/lib/scarpe/spacing.rb +0 -9
  206. data/lib/scarpe/stack.rb +0 -70
  207. data/lib/scarpe/text_widget.rb +0 -42
  208. data/lib/scarpe/unit_test_helpers.rb +0 -163
  209. data/lib/scarpe/widgets.rb +0 -30
  210. data/lib/scarpe/wv/fill.rb +0 -30
  211. data/lib/scarpe/wv/shape_helper.rb +0 -44
  212. /data/{lib/scarpe → spikes}/glibui/README.md +0 -0
  213. /data/{lib/scarpe → spikes}/glibui/alert.rb +0 -0
  214. /data/{lib/scarpe → spikes}/glibui/app.rb +0 -0
  215. /data/{lib/scarpe → spikes}/glibui/background.rb +0 -0
  216. /data/{lib/scarpe → spikes}/glibui/border.rb +0 -0
  217. /data/{lib/scarpe → spikes}/glibui/button.rb +0 -0
  218. /data/{lib/scarpe → spikes}/glibui/dimensions.rb +0 -0
  219. /data/{lib/scarpe → spikes}/glibui/document_root.rb +0 -0
  220. /data/{lib/scarpe → spikes}/glibui/edit_box.rb +0 -0
  221. /data/{lib/scarpe → spikes}/glibui/edit_line.rb +0 -0
  222. /data/{lib/scarpe → spikes}/glibui/flow.rb +0 -0
  223. /data/{lib/scarpe → spikes}/glibui/html.rb +0 -0
  224. /data/{lib/scarpe → spikes}/glibui/image.rb +0 -0
  225. /data/{lib/scarpe → spikes}/glibui/link.rb +0 -0
  226. /data/{lib/scarpe → spikes}/glibui/local_display.rb +0 -0
  227. /data/{lib/scarpe → spikes}/glibui/para.rb +0 -0
  228. /data/{lib/scarpe → spikes}/glibui/spacing.rb +0 -0
  229. /data/{lib/scarpe → spikes}/glibui/stack.rb +0 -0
  230. /data/{lib/scarpe → spikes}/glibui/text_widget.rb +0 -0
  231. /data/{lib/scarpe → spikes}/libui/alert.rb +0 -0
  232. /data/{lib/scarpe → spikes}/libui/button.rb +0 -0
  233. /data/{lib/scarpe → spikes}/libui/colors.rb +0 -0
  234. /data/{lib/scarpe → spikes}/libui/core.rb +0 -0
  235. /data/{lib/scarpe → spikes}/libui/flow.rb +0 -0
  236. /data/{lib/scarpe → spikes}/libui/libui.rb +0 -0
  237. /data/{lib/scarpe → spikes}/libui/notepad.md +0 -0
  238. /data/{lib/scarpe → spikes}/libui/para.rb +0 -0
  239. /data/{lib/scarpe → spikes}/libui/stack.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f63189c37a79d9554abab1dd9c13da663a93f8b707dd3f7edb2df364e65bd945
4
- data.tar.gz: 3c4c0b12d0ac82da8ecde49c44e0895ca13e68358c8976176b8a3975b41f3fdf
3
+ metadata.gz: b07033a939f5503cea0f357a5ac67f0df01833038c433933c4dd2984bcd15b76
4
+ data.tar.gz: cc633f8adfe627f260e06371feae6d1b152f28c279db62576c82f5c16a44e1be
5
5
  SHA512:
6
- metadata.gz: db4f552cbcd76b41289ea9c352019bb6c9482107b11f8d917a176e9f73be03fc6f1b38be4dd59e798240c5187ba28cee38fbb3f31199ce7c6ff8006099289034
7
- data.tar.gz: ac28e8ce531585cdac81ff721331e6232c328cae19dda3bc229914c597eb8d1f9f6ed21324fca465d7786c16958b54867162d73b0ef302d3233260bf11a56e97
6
+ metadata.gz: 105ea36e4f41d00d1e67ce3ff68cefac8195cc692225133e90382c770c2bfe393ee50c827b5feff0873f9d34cb54b35a11cf7e75994ec10b62d35f72ee0adb37
7
+ data.tar.gz: ff5b648210d7d24e9114e3850529c10999091215aa5f7576e4ee26544797cb98e1f6a51642f39c4b638b7f4a55525bc463188a678265d4ff13f01a5af8d0f931
data/.rubocop.yml CHANGED
@@ -8,6 +8,7 @@ AllCops:
8
8
  - 'bin/**/*'
9
9
  - 'exe/**/*'
10
10
  - 'examples/**/*'
11
+ - 'docs/**/*'
11
12
 
12
13
  Layout/LineLength:
13
14
  Max: 150
@@ -82,3 +83,6 @@ Style/ReturnNil:
82
83
 
83
84
  Style/ClassAndModuleChildren:
84
85
  Enabled: false
86
+
87
+ Layout/EmptyLineBetweenDefs:
88
+ Enabled: false
data/.yardopts CHANGED
@@ -1,3 +1,14 @@
1
1
  --markup-provider=redcarpet
2
2
  --markup=markdown
3
+ --protected
4
+ --no-private
5
+ --template-path docs/yard/template
6
+ --tag incompatibility:"Incompatibilities with Shoes"
7
+ --exclude lib/scarpe/libui
8
+ --exclude lib/scarpe/glibui
9
+ lib/**/*.rb
10
+ lacci/lib/**/*.rb
11
+ -
12
+ docs/yard/*.md
13
+ docs/static/manual.md
3
14
 
data/Gemfile CHANGED
@@ -5,6 +5,9 @@ source "https://rubygems.org"
5
5
  # Specify your gem's dependencies in scarpe.gemspec
6
6
  gemspec
7
7
 
8
+ gem "lacci", path: "lacci"
9
+ gem "scarpe-components", path: "scarpe-components"
10
+
8
11
  gem "bloops", "~> 0.5" #path: "../bloopsaphone" #git: "https://github.com/scarpe-team/bloopsaphone"
9
12
  gem "rake", "~> 13.0"
10
13
 
data/Gemfile.lock ADDED
@@ -0,0 +1,112 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ scarpe (0.2.1)
5
+ bloops (~> 0.5)
6
+ fastimage
7
+ lacci
8
+ logging (~> 2.3.1)
9
+ nokogiri
10
+ scarpe-components
11
+ sqlite3
12
+ webview_ruby (~> 0.1.1)
13
+
14
+ PATH
15
+ remote: lacci
16
+ specs:
17
+ lacci (0.2.1)
18
+
19
+ PATH
20
+ remote: scarpe-components
21
+ specs:
22
+ scarpe-components (0.2.1)
23
+
24
+ GEM
25
+ remote: https://rubygems.org/
26
+ specs:
27
+ ansi (1.5.0)
28
+ ast (2.4.2)
29
+ bloops (0.5)
30
+ builder (3.2.4)
31
+ debug (1.8.0)
32
+ irb (>= 1.5.0)
33
+ reline (>= 0.3.1)
34
+ fastimage (2.2.7)
35
+ ffi (1.15.5)
36
+ ffi-compiler (1.0.1)
37
+ ffi (>= 1.0.0)
38
+ rake
39
+ io-console (0.6.0)
40
+ irb (1.6.4)
41
+ reline (>= 0.3.0)
42
+ json (2.6.3)
43
+ little-plugger (1.1.4)
44
+ logging (2.3.1)
45
+ little-plugger (~> 1.1)
46
+ multi_json (~> 1.14)
47
+ minitest (5.18.0)
48
+ minitest-reporters (1.6.0)
49
+ ansi
50
+ builder
51
+ minitest (>= 5.0)
52
+ ruby-progressbar
53
+ multi_json (1.15.0)
54
+ nokogiri (1.15.2-x86_64-darwin)
55
+ racc (~> 1.4)
56
+ parallel (1.22.1)
57
+ parser (3.2.1.0)
58
+ ast (~> 2.4.1)
59
+ racc (1.7.1)
60
+ rainbow (3.1.1)
61
+ rake (13.0.6)
62
+ redcarpet (3.6.0)
63
+ regexp_parser (2.7.0)
64
+ reline (0.3.4)
65
+ io-console (~> 0.5)
66
+ rexml (3.2.5)
67
+ rubocop (1.46.0)
68
+ json (~> 2.3)
69
+ parallel (~> 1.10)
70
+ parser (>= 3.2.0.0)
71
+ rainbow (>= 2.2.2, < 4.0)
72
+ regexp_parser (>= 1.8, < 3.0)
73
+ rexml (>= 3.2.5, < 4.0)
74
+ rubocop-ast (>= 1.26.0, < 2.0)
75
+ ruby-progressbar (~> 1.7)
76
+ unicode-display_width (>= 2.4.0, < 3.0)
77
+ rubocop-ast (1.26.0)
78
+ parser (>= 3.2.1.0)
79
+ rubocop-shopify (2.12.0)
80
+ rubocop (~> 1.44)
81
+ ruby-progressbar (1.11.0)
82
+ sqlite3 (1.6.3-x86_64-darwin)
83
+ unicode-display_width (2.4.2)
84
+ webrick (1.7.0)
85
+ webview_ruby (0.1.2)
86
+ ffi
87
+ ffi-compiler
88
+ rake
89
+ yard (0.9.28)
90
+ webrick (~> 1.7.0)
91
+
92
+ PLATFORMS
93
+ x86_64-darwin-19
94
+ x86_64-darwin-22
95
+ x86_64-linux
96
+
97
+ DEPENDENCIES
98
+ bloops (~> 0.5)
99
+ debug
100
+ lacci!
101
+ minitest (~> 5.0)
102
+ minitest-reporters
103
+ rake (~> 13.0)
104
+ redcarpet
105
+ rubocop (~> 1.21)
106
+ rubocop-shopify
107
+ scarpe!
108
+ scarpe-components!
109
+ yard
110
+
111
+ BUNDLED WITH
112
+ 2.4.10
data/README.md CHANGED
@@ -9,11 +9,11 @@
9
9
 
10
10
  "Scarpe" means shoes in Italian. "Scarpe" also means [Shoes](https://github.com/shoes/shoes-deprecated) in modern Ruby and webview!
11
11
 
12
- Scarpe isn't feature complete with any version of Shoes (yet?). We're initially targeting Shoes Classic.
12
+ Scarpe isn't feature complete with any version of Shoes (yet?). We're initially targeting [Shoes 3](https://github.com/scarpe-team/scarpe/wiki/ShoesImplementations.md), also called "Red Shoes."
13
13
 
14
14
  ## Wait, What's A Shoes?
15
15
 
16
- Shoes is an old library (really several different ones) that let you build little local desktop computer programs, package them up and give copies to people. Imagine if you can write a tiny little Ruby program (e.g. sneak a peek at the next section) and then it would make a runnable app, opening a window in Ruby, where you could click buttons and play sounds and stuff.
16
+ Shoes is an old library (really [several different ones](https://github.com/scarpe-team/scarpe/wiki/ShoesImplementations.md)) that let you build little local desktop computer programs, package them up and give copies to people. Imagine if you can write a tiny little Ruby program (e.g. sneak a peek at the next section) and then it would make a runnable app, opening a window in Ruby, where you could click buttons and play sounds and stuff.
17
17
 
18
18
  Scarpe is a rewrite of Shoes, because old Shoes doesn't really work any more. There have been a surprising number of rewrites of Shoes over the years -- people love it and miss having it around. This one is ours. Also it uses Webview.
19
19
 
@@ -29,7 +29,7 @@ Shoes.app do
29
29
  end
30
30
  ```
31
31
 
32
- More examples can be found in the `examples` folder!
32
+ More examples can be found in the [`examples` folder](https://github.com/scarpe-team/scarpe/tree/main/examples)!
33
33
 
34
34
  ## Screenshots
35
35
 
@@ -45,31 +45,43 @@ From the button example:
45
45
 
46
46
  ### Quickstart
47
47
 
48
- Scarpe requires [Ruby 3.2](https://www.ruby-lang.org/en/downloads/) or higher! use `rvm` or `rbenv` for version control
48
+ Scarpe requires [Ruby 3.2](https://www.ruby-lang.org/en/downloads/) or higher! You can use `rvm`, `rbenv` or your favourite version control just like normal.
49
49
 
50
- This is where most of the action is happening right now, and to have the full Scarpe experience _today_ this is probably what you want to do.
50
+ This repo is where most of the action is happening right now, and to have the full Scarpe experience _today_ this is probably what you want to do.
51
51
 
52
52
  ```
53
+ # dependencies - Mac version
54
+ brew install portaudio pkg-config # for sound!
55
+ # dependencies - Ubuntu Linux version
56
+ sudo apt install libgtk-3-dev libwebkit2gtk-4.0-dev libportaudio2
57
+
58
+ for any other linux or windows. please see the webview docs for your [platform](https://github.com/webview/webview#prerequisites)
59
+
53
60
  # get it
54
61
  git clone http://github.com/scarpe-team/scarpe
55
62
  cd scarpe; bundle install
63
+
56
64
  # run it
57
65
  ./exe/scarpe examples/button.rb --dev
58
66
  ```
59
67
 
68
+ If you are using Visual Studio Code, you can use this [extension](https://github.com/gintama91/Scarpe-Vscode-Extension). This extension simplifies the process of executing commands by eliminating the need to repeatedly type lengthy file paths, resulting in a more efficient and productive development experience.
69
+
60
70
  ### Finer details
61
71
 
62
72
  First, clone the [main GitHub repository](https://github.com/scarpe-team/scarpe).
63
73
 
64
74
  `bundle install` dependencies like webview from the cloned directory in your Ruby of choice.
65
75
 
66
- You can run without Scarpe being installed by including its directory. For instance, from the "examples" directory you can run `ruby -I../lib hello_world.rb`. You can also install Scarpe locally (`gem build scarpe.gemspec && gem install scarpe-0.1.0.gem`) or using a Gemfile with the "path" option for local Scarpe.
76
+ You can run without Scarpe being installed by including its directory. For instance, from the "examples" directory you can run `ruby -I../lib -I../lacci/lib -rscarpe hello_world.rb`. You can also install Scarpe locally (`gem build scarpe.gemspec && gem install scarpe-0.1.0.gem`) or using a Gemfile with the "path" option for local Scarpe.
67
77
 
68
- Most commonly we are all using this command: `./exe/scarpe examples/button.rb --dev`
78
+ Most commonly we are all using this command: `./exe/scarpe examples/button.rb --dev --debug`
69
79
 
70
80
  The `--dev` flag points to your local scarpe rather than an installed Scarpe gem.
71
81
 
72
- It's very early in the development process. If you'd like to help develop Scarpe, great! It would be useful to drop us a message/issue/PR on GitHub early on, so we know you're working in a particular area, and we can warn you if anybody else is currently doing so.
82
+ The `--debug` flag will dump a ton of useful information to the console if you want to see what's happening with your app.
83
+
84
+ It's very early in the development process. If you'd like to help develop Scarpe, great! It would be useful to drop us a message/issue/PR on GitHub early on, so we know you're working in a particular area, and we can warn you if anybody else is currently doing so. We also have a Discord.
73
85
 
74
86
  We'd love the help!
75
87
 
@@ -79,22 +91,13 @@ By leveraging the `ruby scarpegen.rb` command and the provided resources, you ca
79
91
 
80
92
  ## Are we done yet?
81
93
 
82
- Huh. Great question. Right now we have a few key things we want to achieve. The first is passing all of the examples we can get our hands on. The second is passing HacketyHack. We're manually keeping tabs on that here.
83
-
84
- 🚨 **This is manually checked and not an automation.** 🚨
94
+ Great question! Right now we have a few key things we want to achieve. The first is passing all of the examples we can get our hands on. The second is passing [Hackety-Hack](https://github.com/hacketyhack/hacketyhack). We're manually keeping tabs on that here.
85
95
 
86
96
  ### Webview Display Service Examples Passing
87
97
 
88
- ![](https://geps.dev/progress/16?dangerColor=800000&warningColor=ff9900&successColor=006600)
89
-
90
- __41/288__
91
-
92
- ### GlimmerLibUI Display Service Examples Passing
93
-
94
- ![](https://geps.dev/progress/2?dangerColor=800000&warningColor=ff9900&successColor=006600)
95
-
96
- __4/288__
98
+ ![](https://geps.dev/progress/30?dangerColor=800000&warningColor=ff9900&successColor=006600)
97
99
 
100
+ __92/304__
98
101
  ## Teach me more about Shoes, the DSL, what it is and why it is amazing
99
102
 
100
103
  1. [Nobody Knows Shoes - _why's Manual](https://github.com/whymirror/why-archive/raw/master/shoes/nobody-knows-shoes.pdf)
@@ -105,16 +108,16 @@ __4/288__
105
108
 
106
109
  Scarpe allows you to modify the app's behaviour outside of the normal Shoes API with environment variables.
107
110
 
108
- For example, we are working with multiple display services like Webview, Glimmer, and possibly some others.
109
-
110
- The SCARPE_DISPLAY_SERVICE environment variable allows you to choose one or more display services, from the default Webview service to potentially other experimental or incomplete services. This may be important if you're developing a new display method for Scarpe. The display service variable will contain a name like "wv_local" or "wv_remote" or "glibui" which corresponds to a require-able Ruby file under lib/scarpe, either in the Scarpe gem or another gem your app requires.
111
+ The SCARPE_DISPLAY_SERVICE environment variable allows you to choose one or more display services, from the default Webview service, to [Scarpe-Wasm](https://github.com/scarpe-team/scarpe-wasm) to potentially other experimental or incomplete services. This may be important if you're developing a new display method for Scarpe. The display service variable will contain a name like "wv_local" or "wv_remote" or "wasm_local" which correspond to a require-able Ruby file under lib/scarpe, either in the Scarpe gem or another gem your app requires.
111
112
 
112
113
  Example usage:
113
114
 
114
- `SCARPE_DISPLAY_SERVICE=glibui ./exe/scarpe examples/hello_world.rb`
115
+ `SCARPE_DISPLAY_SERVICE=wv_relay ./exe/scarpe examples/hello_world.rb`
115
116
 
116
117
  The SCARPE_TEST_CONTROL environment variable can contain a path to a test-control-interface script for the Webview display service. If you look at test_helper, it gives some examples of how to use it.
117
118
 
119
+ If you run ./exe/scarpe --dev env, you can see all current environment settings.
120
+
118
121
  ## More info
119
122
 
120
123
  * [Nobody Knows Shoes manual](https://github.com/whymirror/why-archive/raw/master/shoes/nobody-knows-shoes.pdf)
@@ -150,6 +153,10 @@ You can set SCARPE_LOG_CONFIG to an appropriate YAML file to set log levels per-
150
153
 
151
154
  ## Documentation
152
155
 
156
+ Usually it's easiest to [just view the latest on GitHub](https://scarpe-team.github.io/scarpe/).
157
+
158
+ But you can also built it yourself, locally, for testing or to take on the road.
159
+
153
160
  Scarpe uses [YARD](https://yardoc.org/) for basic API documentation. You can run "yard doc" to generate documentation
154
161
  locally, and then view it with "yard server". Point your browser at "http://localhost:8808" for local viewing.
155
162
 
data/Rakefile CHANGED
@@ -10,6 +10,18 @@ Rake::TestTask.new(:test) do |t|
10
10
  t.test_files = FileList["test/**/test_*.rb"]
11
11
  end
12
12
 
13
+ Rake::TestTask.new(:lacci_test) do |t|
14
+ t.libs << "lacci/test"
15
+ t.libs << "lacci/lib"
16
+ t.test_files = FileList["lacci/test/**/test_*.rb"]
17
+ end
18
+
19
+ Rake::TestTask.new(:component_test) do |t|
20
+ t.libs << "scarpe-components/test"
21
+ t.libs << "scarpe-components/lib"
22
+ t.test_files = FileList["scarpe-components/test/**/test_*.rb"]
23
+ end
24
+
13
25
  RuboCop::RakeTask.new
14
26
 
15
- task default: [:test, :rubocop]
27
+ task default: [:test, :lacci_test, :component_test, :rubocop]
@@ -0,0 +1,44 @@
1
+ # CatsCradle and Fiber-Based Testing
2
+
3
+ We've tried a number of things for testing. We mock extensively in many places. We use promises to handle "assert thing X after the next redraw"-type testing.
4
+
5
+ Most recently, we have a Fiber-based approach to testing which is a little weird, but (so far) looks pretty good. Here's a representative test of that kind:
6
+
7
+ ```
8
+ def test_html_dom_multiple_update
9
+ run_test_scarpe_code(<<-'SCARPE_APP', app_test_code: <<-'TEST_CODE')
10
+ Shoes.app do
11
+ para "Hello World"
12
+ end
13
+ SCARPE_APP
14
+ on_heartbeat do
15
+ p = para()
16
+ assert_include dom_html, "Hello World"
17
+ p.replace("Goodbye World")
18
+ wait fully_updated
19
+ assert_include dom_html, "Goodbye World"
20
+ p.replace("Hello Again")
21
+ wait fully_updated
22
+ assert_include dom_html, "Hello Again"
23
+
24
+ test_finished
25
+ end
26
+ TEST_CODE
27
+ end
28
+ ```
29
+
30
+ That's fine. There's a very simple Scarpe app with a single para. The test finds it, then makes sure the page HTML includes the right text. Then it changes it, waits for the redraw and makes sure it contains the new right text. Then, basically, does those same things again. So what's interesting here?
31
+
32
+ Primarily that it waits. You could reasonably think, "waiting is easy - you can use promises or sleeps for that." And normally you'd be right. But in this case, this uses the Webview local display service. It will crash if you don't return control to its main loop within a fraction of a second. And until it gets back to its main loop it can't receive calls from Javascript. Those "dom_html" calls require looping to Webview and back, as (of course) does "wait fully_updated".
33
+
34
+ But this method appears to run through, line by line, until it's done. How?
35
+
36
+ Fibers. Specifically, Ruby 3.0 added some nice Fiber capabilities that we can use. You can go look [at the docs](https://ruby-doc.org/core-3.0.0/Fiber.html#method-i-transfer) if you want.
37
+
38
+ If you check catscradle.rb, you can see us doing a fun little dance where a block like the on_heartbeat above creates a Fiber, and there's a manager Fiber to coordinate them. On every heartbeat and redraw we run the manager Fiber, which in turn runs every other Fiber that's ready, which it tracks via Promises.
39
+
40
+ A ready Fiber will run until it does something blocking, like a dom_html or wait call. Then it returns a Promise object that will be fulfilled when it's ready to run again, like a Promise for being fully redrawn, or a promise for when a snippet of Javascript finishes.
41
+
42
+ Once the manager has run every ready Fiber once, it yields control and waits to be called again.
43
+
44
+ Right now (June 2023) we keep control simple by only being called on heartbeats or redraws, so sometimes a promise *not* involving promises or redraws can wait awhile extra (up to 1/10th of a second or so) before it runs again. It would be possible to run the manager in response to other promises completing, and that would probably be more efficient. I'm just worried about that complicating the flow of control and leading to weird order-dependent bugs. So right now we do the simple thing, which can be slower.
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ def generate_docpages_list
4
+ @file_list = true
5
+
6
+ # Customise these more?
7
+ @items = options.files.select { |m| m.filename.end_with?(".md") }
8
+
9
+ @list_title = "Doc Pages List"
10
+ @list_type = "file"
11
+ generate_list_contents
12
+ @file_list = nil
13
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+ def menu_lists
3
+ [
4
+ {:type => 'docpages', :title => 'Doc Pages', :search_title => 'Doc Pages'},
5
+ {:type => 'class', :title => 'Classes', :search_title => 'Class List'},
6
+ {:type => 'method', :title => 'Methods', :search_title => 'Method List'},
7
+ {:type => 'file', :title => 'Files', :search_title => 'File List'},
8
+ ]
9
+ end
@@ -0,0 +1,16 @@
1
+ Shoes.app do
2
+
3
+ stack width:100, height:100 do
4
+ background "docs/static/avatar.png"
5
+ border blue ,strokewidth: 4
6
+ end
7
+
8
+ stack width:100, height:100 do
9
+ background red
10
+ end
11
+
12
+ stack width:100, height:100 do
13
+ background "rgba(255,200,0,255)"
14
+ end
15
+
16
+ end
@@ -0,0 +1,66 @@
1
+ # Bronx Army Knife
2
+
3
+ # By analogy with "Bronx Cheer."
4
+
5
+ class SystemConfiguration
6
+ def self.checked_run(cmd, msg: "returned an error")
7
+ system(cmd)
8
+ unless $?.success?
9
+ puts "Command failed: #{cmd.inspect} in #{Dir.pwd}; #{$?.inspect}..."
10
+ raise msg
11
+ end
12
+ end
13
+
14
+ def self.basic_install_check
15
+ unless `uname -a`.include?("Darwin")
16
+ raise "Feel free to adjust this app, but right now it's very Mac-specific!"
17
+ end
18
+
19
+ unless system("which ffmpeg")
20
+ raise "Please install FFMPEG! On Mac this might be 'brew install ffmpeg'"
21
+ end
22
+
23
+ unless system("which basic-pitch")
24
+ puts <<~USAGE_TEXT
25
+ You'll need to install basic-pitch. It can be a bit involved.
26
+ Basic-Pitch requires Python 3.7+, or 3.10+ for Mac M1s.
27
+
28
+ See:
29
+ https://github.com/spotify/basic-pitch
30
+ https://basicpitch.spotify.com/
31
+ USAGE_TEXT
32
+ raise "Please install basic-pitch! On Mac this might be 'pip3 install basic_pitch'"
33
+ end
34
+ end
35
+
36
+ def self.mic_device_string
37
+ audio_devices_text = `ffmpeg -f avfoundation -list_devices true -i "" 2>&1`
38
+
39
+ if audio_devices_text.include?("] MacBook Pro Microphone")
40
+ dev_num = audio_devices_text.split("] MacBook Pro Microphone")[0][-1]
41
+ unless ("0".."5").include?(dev_num)
42
+ raise "Couldn't recognise your audio device as a small number in text:\n#{audio_devices_text}\n\n!!!"
43
+ end
44
+ return ":" + dev_num
45
+ end
46
+
47
+ raise "Time to improve the checking to recognise the Mac microphone!"
48
+ end
49
+
50
+ def self.record_audio_to_file(path, seconds: 1)
51
+ @mic_dev ||= mic_device_string
52
+ checked_run("ffmpeg -f avfoundation -i \"#{@mic_dev}\" -t #{seconds}s #{path}")
53
+ end
54
+ end
55
+
56
+ SystemConfiguration.basic_install_check
57
+
58
+ Shoes.app do
59
+ @status_text = para "Right now: nothing recorded"
60
+
61
+ @b = button "record" do
62
+ @status_text.replace("...")
63
+ SystemConfiguration.record_audio_to_file("~/Desktop/test_audio.wav")
64
+ @status_text.replace("Recorded: ~/Desktop/test_audio.wav")
65
+ end
66
+ end
@@ -0,0 +1,21 @@
1
+ Shoes.app height: 200, width: 200, title: "Morning Serenity" do
2
+ @sleepy_person = para "😴"
3
+
4
+ button "Good Morning!" do
5
+ @sleepy_person.replace "😀"
6
+ b = Bloops.new
7
+ b.tempo = 70
8
+
9
+ s1 = b.sound Bloops::SINE
10
+ s1.attack = 0.5
11
+ s1.sustain = 0.3
12
+ s1.decay = 0.4
13
+
14
+ pattern1 = "4:e5 4:d5 4:c5 4:d5 2:e5 4:e5 4:d5 4:c5 4:d5 2:e5 4:d5 4:c5 4:b4 4:c5 2:d5"
15
+
16
+ b.tune s1, pattern1
17
+
18
+ b.play
19
+ end
20
+
21
+ end
@@ -1,14 +1,16 @@
1
1
 
2
2
  b = Bloops.new
3
3
  b.tempo = 180
4
-
5
-
4
+
5
+
6
6
  sound = b.sound Bloops::SQUARE
7
7
  sound.volume = 0.4
8
8
  sound.sustain = 0.3
9
9
  sound.attack = 0.1
10
10
  sound.decay = 0.3
11
-
11
+
12
12
  b.tune sound, "32 + C E F# 8:A G E C - 8:A 8:F# 8:F# 8:F# 2:G"
13
-
14
13
  b.play
14
+
15
+ # Added, or it justs falls off the end
16
+ sleep 0.5 while not b.stopped?
@@ -1,4 +1,4 @@
1
- Shoes.app(debug: true) do
1
+ Shoes.app do
2
2
  @b = button "Go away, button"
3
3
  @b.click {
4
4
  @b.destroy
data/examples/check.rb ADDED
@@ -0,0 +1,18 @@
1
+ Shoes.app do
2
+ stack do
3
+ para "Among these films, which do you prefer?"
4
+ flow { check; para "The Taste of Tea by Katsuhito Ishii" }
5
+ flow { check; para "Kin-Dza-Dza by Georgi Danelia" }
6
+ flow { check; para "Children of Heaven by Majid Majidi" }
7
+ @btn = check; para "The White Balloon by Jafar Panahi"
8
+ flow do
9
+ button "Mark me" do
10
+ @btn.checked = true
11
+
12
+ end
13
+ button "unmark me" do
14
+ @btn.checked = false
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,24 @@
1
+ Shoes.app do
2
+ stack do
3
+ button("More Stuff!") do
4
+ @slot.append do
5
+ ins "I'm enthused."
6
+ title "Enthused!"
7
+ banner "ENTHUSED!"
8
+ end
9
+ end
10
+
11
+ button("No Stuff!") do
12
+ @slot.clear
13
+ end
14
+
15
+ button("Different Stuff!") do
16
+ @slot.clear do
17
+ para "I'm so different!"
18
+ title "I'm like a totally different but emo person! Or possibly chicken."
19
+ end
20
+ end
21
+
22
+ @slot = stack(width: "100%") { para 'Good Morning' }
23
+ end
24
+ end
@@ -0,0 +1,28 @@
1
+ Shoes.app do
2
+ stack do
3
+ title "Downloading Google image", size: 16
4
+ @status = para "Enter URL and press Enter:"
5
+
6
+ url_edit = edit_line
7
+ caption "here is a cute cat url: https://img.freepik.com/premium-photo/funny-smart-cat-professor-with-glasses-illustration-generative-ai_845977-709.jpg?w=700&h=300"
8
+
9
+ button 'Download Image!', color: "#3d5a80", padding_bottom: "8", padding_top: "8", text_color: "white", font_size: "16" do
10
+ download(url_edit.text, save: "downloaded_image.png") do
11
+ @status.replace "Download completed. Click to display the image."
12
+ @download_completed = true
13
+ button 'Display Image', color: "#3d5a80", padding_bottom: "8", padding_top: "8", text_color: "white", font_size: "16" do
14
+ if @download_completed
15
+ @status.replace "Showing you the image..."
16
+ display_image("downloaded_image.png")
17
+ end
18
+ end
19
+ end
20
+ end
21
+
22
+
23
+ end
24
+
25
+ def display_image(image_path)
26
+ image(image_path)
27
+ end
28
+ end
data/examples/edit_box.rb CHANGED
@@ -1,10 +1,8 @@
1
1
  Shoes.app do
2
2
  para "Manuscript:"
3
- @manuscript = edit_box(width: "100%") do
4
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim."
3
+ lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim."
4
+ @manuscript = edit_box(lorem, width: "100%") do |box|
5
+ @char_count.replace("#{box.text.length} characters")
5
6
  end
6
7
  @char_count = para "#{@manuscript.text.length} characters"
7
- @manuscript.change { |text|
8
- @char_count.replace("#{text.length} characters")
9
- }
10
8
  end
data/examples/fonts.rb CHANGED
@@ -1,6 +1,6 @@
1
- Scarpe.app do
1
+ Shoes.app do
2
2
  para "Hello, world!", font: "Arial", size: 20
3
3
  para "Hello, world!", font: "Courier", size: 20
4
4
  para "Hello, world!", font: "MS Gothic", size: 20
5
5
  end
6
-
6
+
@@ -0,0 +1,10 @@
1
+ Shoes.app do
2
+ stack do
3
+ title "Searching", :size => 16
4
+ @status = para "One moment..."
5
+
6
+ download "http://www.google.com/search?q=shoes" do |goog|
7
+ @status.replace "Headers: " + goog.response.headers.inspect
8
+ end
9
+ end
10
+ end
@@ -58,6 +58,8 @@ def highlander_the_selected_item
58
58
  end
59
59
  end
60
60
 
61
+ $dup_list.selected_item = nil
62
+ $bottom_display.replace BOTTOM_DISPLAY_INSTRUCTIONS
61
63
  update_dup_list
62
64
  end
63
65
 
data/examples/link.rb CHANGED
@@ -2,7 +2,7 @@ Shoes.app do
2
2
  def collapsed
3
3
  @para = para(
4
4
  "'Scarpe' means shoes in Italian. 'Scarpe' also means Shoes in...",
5
- link("(show more)") { @para.destroy_self; @para = expanded }
5
+ link("(show more)") { @para.destroy; @para = expanded }
6
6
  )
7
7
  end
8
8
 
@@ -12,7 +12,7 @@ Shoes.app do
12
12
  "Scarpe isn't feature complete with any version of Shoes (yet?). We're initially targeting Shoes Classic. ",
13
13
  link("Learn more", click: "http://github.com/schwad/scarpe"),
14
14
  " ",
15
- link("(show less)") { @para.destroy_self; @para = collapsed }
15
+ link("(show less)") { @para.destroy; @para = collapsed }
16
16
  )
17
17
  end
18
18